Difference between comb and allpass

guygz's icon

guygz

9月 27 2013 | 1:27 午後

Hello there,
It might be an already asked question, but indeed I'm still looking for the answer...

does someone could explain in a quite detailed post the difference between a comb filter and an allpass one ?

Thanks !

Steven Miller's icon

Steven Miller

9月 28 2013 | 12:34 午前

If you look at the 'details' tab of the help patcher for [comb~] and [allpass~] you can see that the implementations are very similar, but with the important difference of how they handle gain coefficients. In plain English (more or less), [comb~] has separate gain controls for the direct, delayed, and fedback & delayed (direct, feedforward and feedback, respectively) versions of the signal. The [allpass~], on the other hand locks the direct and feedback gain together. The allpass will typically be more stable than the comb, as the allpass always balances these two signals whereas with the comb you can get far more variety of settings, some of which will blow up the filter.

VERY generally, an allpass is used as a building block for other things (like reverberators, etc.) and/or for relatively mild phase manipulation whereas comb can be used as a more radical timbral shaper all on its own.

Roman Thilenius's icon

Roman Thilenius

9月 28 2013 | 4:54 午前

you could also say that an allpass consists* of two combs. (*well, _can consist of two combs)

guygz's icon

guygz

9月 28 2013 | 2:20 午後

Okay,
thanks for the complete explanation. I had read the tutorials before but it lost me.. Now it's quite okay ! If I understood well, you'd rather use the comb filter to act on the tone of the output (the french word is the "timbre" sorry for bad translation), whereas if I only want some "kind of discrete" phase interferences I'll use an allpass.

But to change the tone with the comb~, it makes use of phase interferences to attenuate other frequencies isn't it ?
Understand this principle but why do they use the term of "feedforward" ? the delayed signal is simply output or do I miss something? I've got the same probleme of vocabularty for the feedback parameter. I understand the it feed the input with the output, but I don't get this sentence "the output signal it sent that same amount of time ago (which would have included prior delays)", on this context the sentence means for me that it's a simple delayed output that doesn't affect the input, but it would have no sense... I need to be lightened up some times... But thanks anyway

@Roman Thilenius, to complete your answer the allpass~ may even be an addition of severals (quite a lot actually) comb filters with there first parameters differently modulated ?

guygz's icon

guygz

9月 28 2013 | 3:49 午後

One other little thing, I'm annoying as well by the term "maximum delay", the first argument of both objects. What does mean maximum whereas you can exeed the limit with the inlet "delay time" ?
Thanks

Peter McCulloch's icon

Peter McCulloch

9月 28 2013 | 4:21 午後

That's the maximum delay possible. It's like tapin~.

Allpass is also a type of interpolation. For a comb filter you often want a particular tuning. You won't get enough without interpolation, but you'll also notice that linear interpolation has a low pass filtering effect. Allpass interpolation has a flatter frequency response, preserving high frequency components. (This comes at the cost of phase smearing)

(So comb filtering effects will be produced with a feedback delay with a wavelength short enough to be in the audio, rather than rhythmic, range. You could use allpass interpolation for the delay line.)

The latest version of BEAP has a comb filter that I wrote that uses allpass interpolation.

guygz's icon

guygz

9月 28 2013 | 6:10 午後

I noticed that, but I don't get why it's the maximum delay possible whereas you can exceed this limit with the "initial delay"...

I understood the waveshaping caused by a short enought delayed feedback. But I don't really picture the term of interpolation (it as to many senses for me) ? You're speaking of phase interference ?

I'll have a look at to your Beap patch, thanks. But actually I was more trying to understand the parameters and possibilities of comb filter. Could you answer to this part of the post ?

"I Understand this principle but why do they use the term of “feedforward” ? the delayed signal is simply output or do I miss something? I’ve got the same probleme of vocabularty for the feedback parameter. I understand the it feed the input with the output, but I don’t get this sentence “the output signal it sent that same amount of time ago (which would have included prior delays)”, on this context the sentence means for me that it’s a simple delayed output that doesn’t affect the input, but it would have no sense…"

Thank you for helping

guygz's icon

guygz

9月 28 2013 | 6:28 午後

Beforehand, Sorry to be taken for a noob, but I can't find the BEAP project. You've posted it as a project or only in a thread ?

Wetterberg's icon

Wetterberg

9月 29 2013 | 3:41 午後

(oh, and "timbre" is a perfectly valid english term as well)

@peter: Latest version? As in, the update from three days ago? the install I have seems to have your adapted algo in it.

Wetterberg's icon

Wetterberg

9月 29 2013 | 8:57 午後

Did some testing. Okay, that thing rules, Peter. Good job.

Peter McCulloch's icon

Peter McCulloch

9月 30 2013 | 6:30 午後

@wetterberg Thanks! Yeah, sorry not version as far as "release" but latest commit.

@Guygz You can find a diagram of the innards of comb~ on its help page. (it's under the "details" tab) If you think about feedforward as representing some sort of "future" state, you can see that, since that's impossible to predict, it really just means delaying the input (worth paying attention to how the coefficients get mapped, though!). For comb~, the third inlet is gain for the incoming signal, fourth is gain for the delayed feedforward signal, and fifth is for feedback gain.

Feedforward terms are standard parts of IIR filters. If you look at the biquad~ help file, you'll see that it also has feedforward sections. Feedback terms have substantially greater weight because their effects continue to ripple through (whereas feedforward terms are only calculated once) the system.

The Wikipedia page for comb filters shows the difference in frequency response for feedback vs feedforward. Feedforward is an FIR (Finite Impulse Response) filter, whereas feedback is an IIR (Infinite Impulse Response) filter.

The interpolation has to do with how the filter handles non-integer length sample delays. Comb~ does linear interpolation, which is a form of lowpass filtering. Try setting delays (use sampstoms~) in integer (e.g. 441) vs non-integer (441.49) lengths with high feedback, then send an impulse through comb~. You should notice that integer length delays last longer and are brighter. This is because they aren't using interpolation. Allpass interpolation is designed to have a flatter frequency response, so it does not have as much of a damping effect.

You might also check out teeth~, which permits different feedforward and feedback delays.

guygz's icon

guygz

10月 02 2013 | 6:13 午後

So the signal is delayed previously, after this delay comes the "present signal" and after an other delay of the same value comes the officialy delayed one. It's because of this previous and "hidden" delay that they can predict a "future state of the sound". Comb~ is nothing more than a balanced blend of a signal, a delayed one, and an other double delayed ?
I see that like that, tell me if I got something completely wrong...

I understand as well the -why- of those different frequency response for feedforward and feedback. One is subtracting the frequency of the delay and the other is arising it.

After reading your answer, and seeing the filterdetail help window I really understand better the operation based in comb~, that's great thanks a lot. It could appear simple but it's really comfortable to have a picture of it.

I knew what was an interpolation but didn't see where was is place in this discussion. Now it's okay, if you put only a line between two points you remove possible transitions (hi fq ones) and that's why there is a low pass effect.

When I was reading the tutorial of comb filters, they talked about a delay of one sample or two, you're saying that we can delay for example a two samples and a half and then comb~ interpolates the end of the third sample ?
But the float number your talking about is for delay time, not a number of samples, I don't really get it...
And there's also this stupid question that I can't answer since a week. I would have understand the utility of the first argument (a "maximum delay time") if, once this limit crossed by the second one, the filter blow up or shut off or stop itself to the limit, but nothing of that kind happen.
If you've got : comb~ 15 22 0,8 0,5 0,6
the delay time would be 22 and not 15, so what is the point ?

I'm asking those meticulous questions because I'm actually trying to make a kind of complete reverb patch by my own to enter in an engineer school. But I'm only a sound technician of 20, and I admit I cruelly miss some theoretical studies of the question sometimes... But this forum learn me a lot, and thanks again for the help. What you're saying about allpass and the lowpass effect of comb~ is really interesting and I think I'll use this method to build the diffuse field of it.

I have checked teeth~ and the distinction of the two delays could be really useful to build a more random field !

Peter McCulloch's icon

Peter McCulloch

10月 02 2013 | 8:28 午後

I'm not really sure on the arguments (for the particular reasoning for them); I usually just steal from the help file...

Interpolation is especially significant inside a comb filter because it's going to process the loop many times, rather than just once, so there's a lot more cumulative degradation that comes with interpolation. You'll particularly notice this in the case of Karplus-Strong synthesis. If you're asking for a 2.5 sample delay, then you're going to have to interpolate. (another example of this happens in sound-file playback. If you want to play at 0.8X the speed, you're going to have to either repeat samples (BAD!) or interpolate the in-between values)

In the case of linear interpolation, this means blending 50% of the value at 2 samples, with 50% of the value at three samples. (the % changes with the fractional part)

You could implement a comb filter inside of gen~ that used different interpolation (say cubic or spline) and that should be kinder to the high frequencies.

Using two delays inside a feedback loop is often a part of physical modelling synthesis, btw. (check out some of the examples in the gen~ folder)

guygz's icon

guygz

10月 09 2013 | 3:10 午後

I've checked every object you introduced to me, teeth~ and and allpass~ are really useful to built different kinds of diffuse field indeed.
Thanks again for you're help'n'patience Peter, you're a true teacher !
Bravo

Peter McCulloch's icon

Peter McCulloch

10月 09 2013 | 6:19 午後

Glad to help. I've had some pretty good teachers along the way who have helped me.