[Stk] tuning all pass filters with changes in sampling rate

Perry Cook prc at cs.princeton.edu
Tue Jun 27 12:29:36 PDT 2017


Gary,

You are completely correct.  I was changing the delay length (in my
mind) without changing the sample rate (in my mind).  I think your
view of this in the time domain makes more sense, especially with
long delay lines.  So the all-pass example should be similar, keeping
the coefficients constant essentially preserves the impulse response
as a function of real analog time.

PRC

> On Jun 27, 2017, at 7:20 AM, Gary Worsham <gary.worsham at gmail.com> wrote:
> 
> Hi Perry, 
> 
> I'm stumbling at the comb filter example.  Let's start with delay = 100 msec and feedback = 0.5 @ 20 kHz sampling rate.
> 
> Now we go to 40 kHz sampling rate and as a result we double the length of the delay buffer so the delay time is again 100 msec.  The signal goes through the feedback once every 100 msec and as a result I would expect RT60 to be preserved without changing the feedback value.  What am I missing here?
> 
> I imagine your APF unit circle cut up like a pie with poles on the inside and zeros on the outside in each slice, but my intuition about these things isn't what it used to be.  And perhaps it never was.  My sense about the impulse response of such a thing (based on my observation of long (50) cascades of equal-length APFs in Audacity's "spectrogram" view) Is that you'd get a time-smeared output, with the delayed part being composed of harmonically-related frequency components that resonate at the APF's delay line length.  Maybe what is important here is the "group delay" at those frequencies, which could I suppose have some dependence on the sampling rate.  
> 
> Supposing that the APF coefficients did want to be adjusted with sampling rate, how would you go about it?  You can't just take an APF coefficient of 0.7 and double it because then it will be unstable.  I don't know whether it helps but in general my area of interest is for frequencies < fs/4.
> 
> Keep in mind I have one toe (maybe it's the big one) that knows what I'm talking about and the rest of that foot and all of the other one are flailing in mid air.
> 
> Many thanks!
> 
> Gary W.
> 
> On Mon, Jun 26, 2017 at 4:09 PM, Julius Smith <jos at ccrma.stanford.edu> wrote:
> Hi All - I agree with your reasonings that temporal spacings and decay times should be preserved as much as possible.  Cheers - Julius
> 
> On Mon, Jun 26, 2017 at 3:16 PM, Perry Cook <prc at cs.princeton.edu> wrote:
> Great question.  In the case of all pass filters, I at first felt your intuition correct.
> 
> But as I think of it, maybe not.  My reasoning:
> 
> I’ve most often used all pass with large delay line for reverb and other delay
> effects.  (Schroeder type) Reverbs usually use some comb filters and some
> all pass.  I always view these delays as round-trip times between simulated
> walls.  So the time is important, thus the delay length (as a number of samples)
> must change with sample rate, to keep the time delay the same.
> 
> For the comb filters, the decay time is important, so the coefficient needs to
> change with sample rate to keep the T60 correct.
> 
> For the all-pass filters, maybe we should change them as well, to keep the
> transient response more constant across different sample rates.  An all pass
> shows up as reciprocal pairs of poles/zeros spaced around the unit circle.
> Changing the delay line length changes the number and positions of those,
> but they always equally divide the unit circle.  One could posit different
> arguments that the distance(s) from the unit circle should or should not change.
> 
> One argument:   product of all pole radii = constant      (keep coefficient same)
> 
> Other argument: individual pole radii = constant   (change coefficient)
> 
> 
> Julius specifically called to pipe in here
> 
> PRC
> 
> 
> > On Jun 25, 2017, at 9:02 AM, Gary Worsham <gary.worsham at gmail.com> wrote:
> >
> > Single pole IIR filters can easily be adjusted to a new sampling rate while preserving frequency response since the coefficient includes the sampling rate as part of its formula.
> >
> > However, in sound effects use (my experience anyway) all pass filters are used for phase shifter (e.g. Pink Floyd) and as a component in most reverbs.  These structures tend to be more ad-hoc in their design intention - by which I mean that after a bit of experience, most people would know what to expect from an 800 Hz low pass vs. a 2.5 kHz low pass, but as far as what to expect from these other things, I think mostly we just wing it and see what happens.
> >
> > All-pass tuning (frequency of max phase shift) is related to the length of the all-pass delay, and for delays longer than one sample, this shift is mirrored and copied throughout the spectrum.  So I can adjust the all-pass delay sample length proportionally with the ratio of new/old sample rate and it should preserve the delay time.
> >
> > Next question is about the all-pass coefficient.  Generally I think "how often does the signal go through the coefficient"?  If you adjust the delay length to equalize the time, then my gut feeling is to keep the all-pass coefficients the same regardless of sampling rate.
> >
> > However that is simply a wild guess, so thought I'd check in the the DSP gods.
> >
> > Thanks,
> >
> > GW
> >
> > _______________________________________________
> > Stk mailing list
> > Stk at ccrma.stanford.edu
> > https://cm-mail.stanford.edu/mailman/listinfo/stk
> 
> 
> 
> 
> 
> 
> -- 
> Julius O. Smith III <jos at ccrma.stanford.edu>
> Professor of Music and, by courtesy, Electrical Engineering
> CCRMA, Stanford University
> http://ccrma.stanford.edu/~jos/ 
> 
> 




More information about the Stk mailing list