Inverted(?) allpass filter?
-
- KVRist
- Topic Starter
- 125 posts since 2 Nov, 2014
QUICK update:
I've found odd, yet charming blog, explaining bunch of allpass related topics in accessible manner.
http://www.katjaas.nl/hilbert/hilbert.html
If you scroll down to "complexification using all-pass filters" you'll get flowchart for building biquad two pole allpass filter, which I've implemented. If you "tune" the 6 coefficients right you get allpass which exhibit "inverted" (speaking relative to classic allpass filter design) delay group of roughly 60-100 samples at HF. It looks like a group delay "notch" at around 5-7 kHz. You can change the "resonance" or whatever of an group delay. I cannot seem to achive "group delay notch" at lower freq, cuz it merges into classical "group delay positive low shelf". Amplitude indeed stays flat across all range.
I guess the big idea is that you SOMEHOW transpose the "notches" of group delay, using cascade of multiple allpass filters, so that you can overlay the group delay notches and composite them in a manner that is seen in previously mention http://citeseerx.ist.psu.edu/viewdoc/do ... 1&type=pdf in Figure 6. You can even see the notches in green line, and it's mentioned, that he used 20 allpass units, and voila...there are 20 notches. I think...
The trick it seems, is pushing the group delay notch down the spectrum, and here is where all the weird multiple bandpassing and downsampling tricks found in PDF above comes into play. I haven't got a clue on how to achive that.
TLDR: My brain hurts.I have not given up yet, but that's just a matter of time
EDIT: thanks for all the ideas guys.
I've found odd, yet charming blog, explaining bunch of allpass related topics in accessible manner.
http://www.katjaas.nl/hilbert/hilbert.html
If you scroll down to "complexification using all-pass filters" you'll get flowchart for building biquad two pole allpass filter, which I've implemented. If you "tune" the 6 coefficients right you get allpass which exhibit "inverted" (speaking relative to classic allpass filter design) delay group of roughly 60-100 samples at HF. It looks like a group delay "notch" at around 5-7 kHz. You can change the "resonance" or whatever of an group delay. I cannot seem to achive "group delay notch" at lower freq, cuz it merges into classical "group delay positive low shelf". Amplitude indeed stays flat across all range.
I guess the big idea is that you SOMEHOW transpose the "notches" of group delay, using cascade of multiple allpass filters, so that you can overlay the group delay notches and composite them in a manner that is seen in previously mention http://citeseerx.ist.psu.edu/viewdoc/do ... 1&type=pdf in Figure 6. You can even see the notches in green line, and it's mentioned, that he used 20 allpass units, and voila...there are 20 notches. I think...
The trick it seems, is pushing the group delay notch down the spectrum, and here is where all the weird multiple bandpassing and downsampling tricks found in PDF above comes into play. I haven't got a clue on how to achive that.
TLDR: My brain hurts.I have not given up yet, but that's just a matter of time
EDIT: thanks for all the ideas guys.
-
- KVRist
- Topic Starter
- 125 posts since 2 Nov, 2014
- KVRist
- 347 posts since 20 Apr, 2005 from Moscow, Russian Federation
... but it also changed the shape of delay distribution from bell-like to low shelf-like.
I've just (out of curiosity) tried it with a regular allpass formulae and after Q > .5 the delay curve becomes bell-like (more Q -> higher/narrower bell). Regardless of F. So I guess it depends on what filter (code) you use and how exactly it's "tuned".
P.S. That "regular formulae" (for direct form biquad) is something like:
I've just (out of curiosity) tried it with a regular allpass formulae and after Q > .5 the delay curve becomes bell-like (more Q -> higher/narrower bell). Regardless of F. So I guess it depends on what filter (code) you use and how exactly it's "tuned".
P.S. That "regular formulae" (for direct form biquad) is something like:
Code: Select all
% matlab/octave syntax:
% f - frequency, q - resonance, fs - sampling rate
w = 2*pi*f/fs;
r = sin(w)/(2*q);
p = 2*cos(w);
a = [1 -p/(1 + r) (1 - r)/(1 + r)];
b = [a(3) a(2) a(1)];
// ..............................
// a and b in C syntax:
a[0] = b[2] = 1;
a[1] = b[1] = -p/(1 + r);
a[2] = b[0] = (1 - r)/(1 + r);
/* a - denominator, b - numerator. Also, if I remember correctly,
Octave plotting functions (that I use to test) use "negated
denominator convention" so depending on actual filter
implementation one may need to change sign of a[1] and a[2] */
- KVRAF
- 7890 posts since 12 Feb, 2006 from Helsinki, Finland
Right... so we can take a real one-pole and rotate the pole (and zero) around the unit circle by multiplying with exp(i*w) where i is the imaginary unit and w is the angular frequency you want to tune for; this will give you a complex one-pole. If you do this twice, for both the positive and negative frequencies, you'll get a conjugate pair of filters and if you multiply the two together, all the complex parts vanish and you have a real-valued two-pole.
There is a slight gotcha: the bell won't quite be symmetric since the poles at positive and negative frequencies interact to certain extent, skewing the response towards DC or Nyquist depending on which one is closer. This becomes less significant when you increase the Q as the bell-shapes get more narrow and therefore won't overlap as much, but it's something to be aware of.
-
- KVRian
- 1273 posts since 9 Jan, 2006
Yes, the delay length sets the frequency. So adding a filter, with it's own delay, will detune it. Also as the filter delay is frequency dependent the partials detune by differing amounts, which may start to sound inharmonic (I guess. Never tried it out )
Last edited by matt42 on Tue Oct 01, 2019 6:37 am, edited 1 time in total.