Reply by robert bristow-johnson August 16, 20162016-08-16
On Tuesday, August 16, 2016 at 3:13:43 AM UTC-4, Matti Viljamaa wrote:
> On Tuesday, August 16, 2016 at 8:09:54 AM UTC+3, robert bristow-johnson w=
rote:
> > On Tuesday, August 9, 2016 at 5:59:25 AM UTC-4, Matti Viljamaa wrote: > > > On Thursday, August 4, 2016 at 11:00:43 PM UTC+3, robert bristow-john=
son wrote:
> > > > On Monday, August 1, 2016 at 4:28:51 AM UTC-4, Matti Viljamaa wrote=
:
> > > > > On Thursday, July 21, 2016 at 9:54:24 PM UTC+3, robert bristow-jo=
hnson wrote:
> > > > > > On Monday, July 18, 2016 at 5:25:33 AM UTC-4, Matti Viljamaa wr=
ote:
> > > > > > > On Sunday, July 17, 2016 at 8:46:35 PM UTC+3, robert bristow-=
johnson wrote:
> > > > > > > > On Sunday, July 17, 2016 at 4:16:45 AM UTC-4, Matti Viljama=
a wrote:
> > > > > > > > > On Saturday, July 16, 2016 at 5:24:29 PM UTC+3, Eric Jaco=
bsen wrote:
> > > > > > > > > > On Sat, 16 Jul 2016 02:09:44 -0700 (PDT), Matti Viljama=
a
> > > > > > > > > > <viljamaadsp@gmail.com> wrote: > > > > > > > > > >=20 > > > > > > > > ... > > > > > > > > > >=20 > > > > > > > > > > >Currently I'm leaning towards simple allpass filter ba=
sed "sweepable" filter structures (e.g. this library https://github.com/vin= niefalco/DSPFilters has a sweepable 2nd order allpass), since controlling a= n dry/allpass "mix" makes controlling the gain easy.
> > > > > > > > > >=20 > > > > > > > > > > Allpass filters tend to have flat frequency responses (=
hence the
> > > > > > > > > > name), and modify mainly the phase response. It sound=
s like that's
> > > > > > > > > > not what you want. > > > > > > > > >=20 > > > > > > > > > But it's already working. I can create a peak filter usin=
g a second order allpass by mixing it to the input using the equation:
> > > > > > > > >=20 > > > > > > > > > y =3D (x + A(x) + K * (x - A(x)) / 2 > > > > > > > > >=20 > > > > > > > > > where K is a gain factor. > > > > > > > > >=20 > > > > > > > > > I believe allpasses can form all the other basic filter t=
ypes as well.
> > > > > > > >=20 > > > > > > >=20 > > > > > > > > you can, with a little manipulation, turn those 5 direct fo=
rm coefficients into 5 independent coefficients in the Lattice form. the A= PF form you show will not have an adjustment for the gain at Nyquist, which= you may want. take a look at this old paper:
> > > > > > > > http://www.musicdsp.org/files/EQ-Coefficients.pdf . > > > > > > > >=20 > > > > > > >=20 > > > > > > > How do you know that the filter implementation I'm using does=
have that problem?
> > > > > >=20 > > > > > > read the paper. it's free. last section (Sec 5) before the Co=
nclusion address exactly the APF formulation you mention above.
> > > > > >=20 > > > > > > > Also why is no gain adjusment at Nyquist a problem? > > > > > >=20 > > > > > > it cramps the frequency response so that it does not well match=
the analog prototype.
> > > > >=20 > > > > > Can you be more specific? > > > > >=20 > > > > > Like how does it cramp? > > > > >=20 > > > >=20 > > > > bilinear transform has a frequency warping effect that makes the ba=
ndwidth of the digital filter slightly smaller than the analog prototype it= is based on.
> > > >=20 > > > > it becomes a bigger problem if the resonant frequency is set very h=
igh, close to Nyquist.
> > > >=20 > > > > > In my tests of the construct I have not heard problems. Should th=
ey be heard? Or only heard at Nyquist (which I'm not really equalizing at, = most of my equalization occurs below 16kHz)?
> > > >=20 > > > > if you're sampling at 44.1 kHz, 16 kHz is getting pretty close to N=
yquist. you may need to adjust the bandwidth (make it larger) or the Q (ma= ke it smaller) so that the bandwidth comes out to what you originally inten= d.
> > > >=20 > > > > r b-j > > >=20 > > > I'm still unsure about what the problem of "cramping" specifically is=
.
> >=20 > > frequency warping caused by the bilinear transform move the two bandedg=
es of some bandwidth closer to each other than they originally were set to.= it makes the bandwidth smaller.
> >=20 > > >=20 > > > Does this problem cause "warping" of the entire frequency spectrum? > > >=20 > > > Or is the problem only that the digital filter doesn't match the anal=
og prototype?=20
> >=20 > > sorta both. frequency warping caused by the bilinear transform affects=
the whole frequency spectrum but it's only a problem at the frequencies cl= oser to Nyquist.
> >=20 > > >=20 > > > How is the problem audible? > >=20 > > filters might sound like they have higher Q than was originally set. > >=20 > > r b-j >=20 > Are you also saying that the 2nd order allpass filter implementation in f=
or example the DSPFilters library is fundamentally flawed? Or was it that t= his is a problem specifically caused by the
>=20 > y =3D (x + A(x) + K * (x - A(x)) / 2 >=20 > equation? >=20 > Is there any way to make this (or some alternative structure) work?
it's only about the effect of frequency warping from the bilinear transform= that maps an analog filter transfer function H(s) to a digital filter tran= sfer function H(z). alternative structures are fine because they still res= ult in a similar transfer function H(z). please take a look at this 2 decade old paper of mine: http://www.musicdsp.org/files/EQ-Coefficients.pdf=20 and more recently, i tried beating the math to death here:=20 http://dsp.stackexchange.com/questions/32196/prewarping-both-resonant-freq= uency-f-0-and-bandwidth-or-q-when-using-bilin/32198#32198=20 the principles remain the same now as then. r b-j
Reply by Matti Viljamaa August 16, 20162016-08-16
On Tuesday, August 16, 2016 at 8:09:54 AM UTC+3, robert bristow-johnson wrote:
> On Tuesday, August 9, 2016 at 5:59:25 AM UTC-4, Matti Viljamaa wrote: > > On Thursday, August 4, 2016 at 11:00:43 PM UTC+3, robert bristow-johnson wrote: > > > On Monday, August 1, 2016 at 4:28:51 AM UTC-4, Matti Viljamaa wrote: > > > > On Thursday, July 21, 2016 at 9:54:24 PM UTC+3, robert bristow-johnson wrote: > > > > > On Monday, July 18, 2016 at 5:25:33 AM UTC-4, Matti Viljamaa wrote: > > > > > > On Sunday, July 17, 2016 at 8:46:35 PM UTC+3, robert bristow-johnson wrote: > > > > > > > On Sunday, July 17, 2016 at 4:16:45 AM UTC-4, Matti Viljamaa wrote: > > > > > > > > On Saturday, July 16, 2016 at 5:24:29 PM UTC+3, Eric Jacobsen wrote: > > > > > > > > > On Sat, 16 Jul 2016 02:09:44 -0700 (PDT), Matti Viljamaa > > > > > > > > > <viljamaadsp@gmail.com> wrote: > > > > > > > > > > > > > > > > ... > > > > > > > > > > > > > > > > > > >Currently I'm leaning towards simple allpass filter based "sweepable" filter structures (e.g. this library https://github.com/vinniefalco/DSPFilters has a sweepable 2nd order allpass), since controlling an dry/allpass "mix" makes controlling the gain easy. > > > > > > > > > > > > > > > > > > Allpass filters tend to have flat frequency responses (hence the > > > > > > > > > name), and modify mainly the phase response. It sounds like that's > > > > > > > > > not what you want. > > > > > > > > > > > > > > > > But it's already working. I can create a peak filter using a second order allpass by mixing it to the input using the equation: > > > > > > > > > > > > > > > > y = (x + A(x) + K * (x - A(x)) / 2 > > > > > > > > > > > > > > > > where K is a gain factor. > > > > > > > > > > > > > > > > I believe allpasses can form all the other basic filter types as well. > > > > > > > > > > > > > > > > > > > > you can, with a little manipulation, turn those 5 direct form coefficients into 5 independent coefficients in the Lattice form. the APF form you show will not have an adjustment for the gain at Nyquist, which you may want. take a look at this old paper: > > > > > > > http://www.musicdsp.org/files/EQ-Coefficients.pdf . > > > > > > > > > > > > > > > > > > > How do you know that the filter implementation I'm using does have that problem? > > > > > > > > > > read the paper. it's free. last section (Sec 5) before the Conclusion address exactly the APF formulation you mention above. > > > > > > > > > > > Also why is no gain adjusment at Nyquist a problem? > > > > > > > > > > it cramps the frequency response so that it does not well match the analog prototype. > > > > > > > > Can you be more specific? > > > > > > > > Like how does it cramp? > > > > > > > > > > bilinear transform has a frequency warping effect that makes the bandwidth of the digital filter slightly smaller than the analog prototype it is based on. > > > > > > it becomes a bigger problem if the resonant frequency is set very high, close to Nyquist. > > > > > > > In my tests of the construct I have not heard problems. Should they be heard? Or only heard at Nyquist (which I'm not really equalizing at, most of my equalization occurs below 16kHz)? > > > > > > if you're sampling at 44.1 kHz, 16 kHz is getting pretty close to Nyquist. you may need to adjust the bandwidth (make it larger) or the Q (make it smaller) so that the bandwidth comes out to what you originally intend. > > > > > > r b-j > > > > I'm still unsure about what the problem of "cramping" specifically is. > > frequency warping caused by the bilinear transform move the two bandedges of some bandwidth closer to each other than they originally were set to. it makes the bandwidth smaller. > > > > > Does this problem cause "warping" of the entire frequency spectrum? > > > > Or is the problem only that the digital filter doesn't match the analog prototype? > > sorta both. frequency warping caused by the bilinear transform affects the whole frequency spectrum but it's only a problem at the frequencies closer to Nyquist. > > > > > How is the problem audible? > > filters might sound like they have higher Q than was originally set. > > r b-j
Are you also saying that the 2nd order allpass filter implementation in for example the DSPFilters library is fundamentally flawed? Or was it that this is a problem specifically caused by the y = (x + A(x) + K * (x - A(x)) / 2 equation? Is there any way to make this (or some alternative structure) work?
Reply by Matti Viljamaa August 16, 20162016-08-16
tiistai 16. elokuuta 2016 8.09.54 UTC+3 robert bristow-johnson kirjoitti:
> On Tuesday, August 9, 2016 at 5:59:25 AM UTC-4, Matti Viljamaa wrote: > > On Thursday, August 4, 2016 at 11:00:43 PM UTC+3, robert bristow-johnson wrote: > > > On Monday, August 1, 2016 at 4:28:51 AM UTC-4, Matti Viljamaa wrote: > > > > On Thursday, July 21, 2016 at 9:54:24 PM UTC+3, robert bristow-johnson wrote: > > > > > On Monday, July 18, 2016 at 5:25:33 AM UTC-4, Matti Viljamaa wrote: > > > > > > On Sunday, July 17, 2016 at 8:46:35 PM UTC+3, robert bristow-johnson wrote: > > > > > > > On Sunday, July 17, 2016 at 4:16:45 AM UTC-4, Matti Viljamaa wrote: > > > > > > > > On Saturday, July 16, 2016 at 5:24:29 PM UTC+3, Eric Jacobsen wrote: > > > > > > > > > On Sat, 16 Jul 2016 02:09:44 -0700 (PDT), Matti Viljamaa > > > > > > > > > <viljamaadsp@gmail.com> wrote: > > > > > > > > > > > > > > > > ... > > > > > > > > > > > > > > > > > > >Currently I'm leaning towards simple allpass filter based "sweepable" filter structures (e.g. this library https://github.com/vinniefalco/DSPFilters has a sweepable 2nd order allpass), since controlling an dry/allpass "mix" makes controlling the gain easy. > > > > > > > > > > > > > > > > > > Allpass filters tend to have flat frequency responses (hence the > > > > > > > > > name), and modify mainly the phase response. It sounds like that's > > > > > > > > > not what you want. > > > > > > > > > > > > > > > > But it's already working. I can create a peak filter using a second order allpass by mixing it to the input using the equation: > > > > > > > > > > > > > > > > y = (x + A(x) + K * (x - A(x)) / 2 > > > > > > > > > > > > > > > > where K is a gain factor. > > > > > > > > > > > > > > > > I believe allpasses can form all the other basic filter types as well. > > > > > > > > > > > > > > > > > > > > you can, with a little manipulation, turn those 5 direct form coefficients into 5 independent coefficients in the Lattice form. the APF form you show will not have an adjustment for the gain at Nyquist, which you may want. take a look at this old paper: > > > > > > > http://www.musicdsp.org/files/EQ-Coefficients.pdf . > > > > > > > > > > > > > > > > > > > How do you know that the filter implementation I'm using does have that problem? > > > > > > > > > > read the paper. it's free. last section (Sec 5) before the Conclusion address exactly the APF formulation you mention above. > > > > > > > > > > > Also why is no gain adjusment at Nyquist a problem? > > > > > > > > > > it cramps the frequency response so that it does not well match the analog prototype. > > > > > > > > Can you be more specific? > > > > > > > > Like how does it cramp? > > > > > > > > > > bilinear transform has a frequency warping effect that makes the bandwidth of the digital filter slightly smaller than the analog prototype it is based on. > > > > > > it becomes a bigger problem if the resonant frequency is set very high, close to Nyquist. > > > > > > > In my tests of the construct I have not heard problems. Should they be heard? Or only heard at Nyquist (which I'm not really equalizing at, most of my equalization occurs below 16kHz)? > > > > > > if you're sampling at 44.1 kHz, 16 kHz is getting pretty close to Nyquist. you may need to adjust the bandwidth (make it larger) or the Q (make it smaller) so that the bandwidth comes out to what you originally intend. > > > > > > r b-j > > > > I'm still unsure about what the problem of "cramping" specifically is. > > frequency warping caused by the bilinear transform move the two bandedges of some bandwidth closer to each other than they originally were set to. it makes the bandwidth smaller. > > > > > Does this problem cause "warping" of the entire frequency spectrum? > > > > Or is the problem only that the digital filter doesn't match the analog prototype? > > sorta both. frequency warping caused by the bilinear transform affects the whole frequency spectrum but it's only a problem at the frequencies closer to Nyquist. > > > > > How is the problem audible? > > filters might sound like they have higher Q than was originally set. > > r b-j
Are you also saying that the 2nd order allpass filter implementation in for example the DSPFilters library is fundamentally flawed? Or was it that this is a problem specifically caused by the y = (x + A(x) + K * (x - A(x)) / 2 equation? Is there any way to make this (or some alternative structure) work?
Reply by Matti Viljamaa August 16, 20162016-08-16
Are you also saying that the 2nd order allpass filter implementation in for example the DSPFilters library is fundamentally flawed? Or was it that this is a problem specifically caused by the 

y = (x + A(x) + K * (x - A(x)) / 2 

equation?
Reply by robert bristow-johnson August 16, 20162016-08-16
On Tuesday, August 9, 2016 at 5:59:25 AM UTC-4, Matti Viljamaa wrote:
> On Thursday, August 4, 2016 at 11:00:43 PM UTC+3, robert bristow-johnson wrote: > > On Monday, August 1, 2016 at 4:28:51 AM UTC-4, Matti Viljamaa wrote: > > > On Thursday, July 21, 2016 at 9:54:24 PM UTC+3, robert bristow-johnson wrote: > > > > On Monday, July 18, 2016 at 5:25:33 AM UTC-4, Matti Viljamaa wrote: > > > > > On Sunday, July 17, 2016 at 8:46:35 PM UTC+3, robert bristow-johnson wrote: > > > > > > On Sunday, July 17, 2016 at 4:16:45 AM UTC-4, Matti Viljamaa wrote: > > > > > > > On Saturday, July 16, 2016 at 5:24:29 PM UTC+3, Eric Jacobsen wrote: > > > > > > > > On Sat, 16 Jul 2016 02:09:44 -0700 (PDT), Matti Viljamaa > > > > > > > > <viljamaadsp@gmail.com> wrote: > > > > > > > > > > > > > > ... > > > > > > > > > > > > > > > > >Currently I'm leaning towards simple allpass filter based "sweepable" filter structures (e.g. this library https://github.com/vinniefalco/DSPFilters has a sweepable 2nd order allpass), since controlling an dry/allpass "mix" makes controlling the gain easy. > > > > > > > > > > > > > > > > Allpass filters tend to have flat frequency responses (hence the > > > > > > > > name), and modify mainly the phase response. It sounds like that's > > > > > > > > not what you want. > > > > > > > > > > > > > > But it's already working. I can create a peak filter using a second order allpass by mixing it to the input using the equation: > > > > > > > > > > > > > > y = (x + A(x) + K * (x - A(x)) / 2 > > > > > > > > > > > > > > where K is a gain factor. > > > > > > > > > > > > > > I believe allpasses can form all the other basic filter types as well. > > > > > > > > > > > > > > > > > you can, with a little manipulation, turn those 5 direct form coefficients into 5 independent coefficients in the Lattice form. the APF form you show will not have an adjustment for the gain at Nyquist, which you may want. take a look at this old paper: > > > > > > http://www.musicdsp.org/files/EQ-Coefficients.pdf . > > > > > > > > > > > > > > > > How do you know that the filter implementation I'm using does have that problem? > > > > > > > > read the paper. it's free. last section (Sec 5) before the Conclusion address exactly the APF formulation you mention above. > > > > > > > > > Also why is no gain adjusment at Nyquist a problem? > > > > > > > > it cramps the frequency response so that it does not well match the analog prototype. > > > > > > Can you be more specific? > > > > > > Like how does it cramp? > > > > > > > bilinear transform has a frequency warping effect that makes the bandwidth of the digital filter slightly smaller than the analog prototype it is based on. > > > > it becomes a bigger problem if the resonant frequency is set very high, close to Nyquist. > > > > > In my tests of the construct I have not heard problems. Should they be heard? Or only heard at Nyquist (which I'm not really equalizing at, most of my equalization occurs below 16kHz)? > > > > if you're sampling at 44.1 kHz, 16 kHz is getting pretty close to Nyquist. you may need to adjust the bandwidth (make it larger) or the Q (make it smaller) so that the bandwidth comes out to what you originally intend. > > > > r b-j > > I'm still unsure about what the problem of "cramping" specifically is.
frequency warping caused by the bilinear transform move the two bandedges of some bandwidth closer to each other than they originally were set to. it makes the bandwidth smaller.
> > Does this problem cause "warping" of the entire frequency spectrum? > > Or is the problem only that the digital filter doesn't match the analog prototype?
sorta both. frequency warping caused by the bilinear transform affects the whole frequency spectrum but it's only a problem at the frequencies closer to Nyquist.
> > How is the problem audible?
filters might sound like they have higher Q than was originally set. r b-j
Reply by Eric Jacobsen August 12, 20162016-08-12
On Wed, 10 Aug 2016 15:26:27 GMT, eric.jacobsen@ieee.org (Eric
Jacobsen) wrote:

>On Wed, 10 Aug 2016 07:12:10 -0700 (PDT), mavavilj@student.jyu.fi >wrote: > >>On Wednesday, 10 August 2016 14:53:32 UTC+3, Tauno Voipio wrote: >>> On 10.8.16 10:31, Matti Viljamaa wrote: >>> > On Tuesday, August 9, 2016 at 9:45:30 PM UTC+3, Tauno Voipio wrote: >>> >> On 9.8.16 12:59, Matti Viljamaa wrote: >>> >>> On Thursday, August 4, 2016 at 11:00:43 PM UTC+3, robert bristow-john>>son wrote: >>> >>>> On Monday, August 1, 2016 at 4:28:51 AM UTC-4, Matti Viljamaa wrote: >>> >>>>> On Thursday, July 21, 2016 at 9:54:24 PM UTC+3, robert bristow-john>>son wrote: >>> >>>>>> On Monday, July 18, 2016 at 5:25:33 AM UTC-4, Matti Viljamaa wrote>>: >>> >>>>>>> On Sunday, July 17, 2016 at 8:46:35 PM UTC+3, robert bristow-john>>son wrote: >>> >>>>>>>> On Sunday, July 17, 2016 at 4:16:45 AM UTC-4, Matti Viljamaa wro>>te: >>> >>>>>>>>> On Saturday, July 16, 2016 at 5:24:29 PM UTC+3, Eric Jacobsen w>>rote: >>> >>>>>>>>>> On Sat, 16 Jul 2016 02:09:44 -0700 (PDT), Matti Viljamaa >>> >>>>>>>>>> <viljamaadsp@gmail.com> wrote: >>> >>>>>>>>>> >>> >>>>>>>> ... >>> >>>>>>>>>> >>> >>>>>>>>>>> Currently I'm leaning towards simple allpass filter based "sw>>eepable" filter structures (e.g. this library https://github.com/vinniefalc>>o/DSPFilters has a sweepable 2nd order allpass), since controlling an dry/a>>llpass "mix" makes controlling the gain easy. >>> >>>>>>>>>> >>> >>>>>>>>>> Allpass filters tend to have flat frequency responses (hence t>>he >>> >>>>>>>>>> name), and modify mainly the phase response. It sounds like >>that's >>> >>>>>>>>>> not what you want. >>> >>>>>>>>> >>> >>>>>>>>> But it's already working. I can create a peak filter using a se>>cond order allpass by mixing it to the input using the equation: >>> >>>>>>>>> >>> >>>>>>>>> y = (x + A(x) + K * (x - A(x)) / 2 >>> >>>>>>>>> >>> >>>>>>>>> where K is a gain factor. >>> >>>>>>>>> >>> >>>>>>>>> I believe allpasses can form all the other basic filter types a>>s well. >>> >>>>>>>> >>> >>>>>>> >>> >>>>>>>> you can, with a little manipulation, turn those 5 direct form co>>efficients into 5 independent coefficients in the Lattice form. the APF fo>>rm you show will not have an adjustment for the gain at Nyquist, which you >>may want. take a look at this old paper: >>> >>>>>>>> http://www.musicdsp.org/files/EQ-Coefficients.pdf . >>> >>>>>>>> >>> >>>>>>> >>> >>>>>>> How do you know that the filter implementation I'm using does hav>>e that problem? >>> >>>>>> >>> >>>>>> read the paper. it's free. last section (Sec 5) before the Concl>>usion address exactly the APF formulation you mention above. >>> >>>>>> >>> >>>>>>> Also why is no gain adjusment at Nyquist a problem? >>> >>>>>> >>> >>>>>> it cramps the frequency response so that it does not well match th>>e analog prototype. >>> >>>>> >>> >>>>> Can you be more specific? >>> >>>>> >>> >>>>> Like how does it cramp? >>> >>>>> >>> >>>> >>> >>>> bilinear transform has a frequency warping effect that makes the ban>>dwidth of the digital filter slightly smaller than the analog prototype it >>is based on. >>> >>>> >>> >>>> it becomes a bigger problem if the resonant frequency is set very hi>>gh, close to Nyquist. >>> >>>> >>> >>>>> In my tests of the construct I have not heard problems. Should they>> be heard? Or only heard at Nyquist (which I'm not really equalizing at, mo>>st of my equalization occurs below 16kHz)? >>> >>>> >>> >>>> if you're sampling at 44.1 kHz, 16 kHz is getting pretty close to Ny>>quist. you may need to adjust the bandwidth (make it larger) or the Q (mak>>e it smaller) so that the bandwidth comes out to what you originally intend>>. >>> >>>> >>> >>>> r b-j >>> >>> >>> >>> I'm still unsure about what the problem of "cramping" specifically is>>. >>> >>> >>> >>> Does this problem cause "warping" of the entire frequency spectrum? >>> >>> >>> >>> Or is the problem only that the digital filter doesn't match the anal>>og prototype? >>> >>> >>> >>> How is the problem audible? >>> >> >>> >> >>> >> Matti, you should get a good textbook on digital signal processing. >>> >> My favorite is Rick Lyons' Understanding Digital Signal Processing. >>> >> The part on IIR filter design using the bilinear transform explains >>> >> it better than the space allows here. >>> >> >>> >> What are you attempting to achieve at the end? Equalization, filtering >>> >> or both? Match amplitude or amplitude and phase? Delay specifications? >>> >> >>> >> -- >>> >> >>> >> -TV >>> > >>> > I just need a sweepable 2nd order allpass filter. My idea being to make>> "arbitrary shapes" using many of such cascaded. And the APF structure that>> I posted earlier is the only one I know for performing filtering using an >>allpass filter. >>> > >>> > And I actually have this working already. Until RBJ posed that the stru>>cture contains the above mentioned problem ("no gain at Nyquist"), which I'>>m now trying to clarify, whether it really is a problem. >>> > >>> > I don't know what other options I have if I want to perform "arbitrary >>shape" (and sweepable/tunable/dynamic) filtering in the simplest way possib>>le (for now). >>> > >>> >>> >>> I have a feeling thet you may be barking up the wrong tree. >>> >>> You have avoided all discussion about delay/phase behaviour, but >>> an all-pass is just a phase twister. It cannot alone be the thing >>> for arbitrary shape filter. My guess is that you have a certain >>> implementation with all-passes in mind, but you have not wanted to >>> tell what your aim really is, e.g. where the sweep/tune/dynamic >>> input comes from and what will the final result be. >>> >>> -- >>> >>> -TV >> >>I've chosen allpasses, because using the structure mentioned earlier it sho>>uld be able to make all filter shapes (band, shelf, LP, HP). And combining >>many of these should give me more complex shapes. It should be simple since>> I'd only use allpasses. > >The point is that an allpass is not frequency selective. It passes >all frequencies equally, hence the name. It cannot, therefore, be >used to create a filter that is frequency selective (i.e., attenuates >some frequencies and not others). > >>What do you mean by delay/phase behaviour? I'm not that versed in filter de>>sign to know what specifying these means, but am (in this thread) trying to>> find an implementation that allows "arbitrary shape" and dynamic/tunable f>>iltering. > >And many people have given you a lot of good advice, but you are not >taking it and not listening if you still want to use allpass >structures. It has also been explained to you many times that >"arbitrary shape" is not really possible and there will be limitations >in what you can and cannot do. > >I would suggest going back to the beginnings of the threads you have >started and re-read all of them. > >>I'm using a control signal to control the filter parameters that may as wel>>l be from parameters given to the user, like in a typical parametric equali>>zer. > >
> >I tried to respond to mavavilj and Randy's post, but there was some >sort of a problem with the header, (441 error, header too long) so >I'll say it here: > >It's pretty fundamental that you can cancel signals with an opposite >phase, which is how multipath channels get frequency selective, too, >even when all the paths are all-pass. > >But in filter design when you say: > >"What do you mean by delay/phase behaviour? I'm not that versed in >filter design to know what specifying these means, but am (in this >thread) trying to find an implementation that allows "arbitrary shape" >and dynamic/tunable filtering." > >you're not going to get very far with all-pass structures. > >My wording was too absolute, though.
Once again, I can't respond directly to malaviij post because of Error 441 Header Line Too Long. So when he asked for elaboration, this is my response: Creating frequency selectivity with all-pass structures requires careful coordination of the phase output characteristic of each filter, because an all-pass filter is really just a phase modifier. If you don't understand delay/phase behavior, you won't be able to do anything with all-pass structures.
Reply by August 12, 20162016-08-12
On Thursday, August 11, 2016 at 1:22:59 AM UTC-4, mava...@student.jyu.fi wr=
ote:
> On Wednesday, 10 August 2016 18:26:31 UTC+3, Eric Jacobsen wrote: > > On Wed, 10 Aug 2016 07:12:10 -0700 (PDT), mavavilj@student.jyu.fi > > wrote: > >=20 > > >On Wednesday, 10 August 2016 14:53:32 UTC+3, Tauno Voipio wrote: > > >> On 10.8.16 10:31, Matti Viljamaa wrote: > > >> > On Tuesday, August 9, 2016 at 9:45:30 PM UTC+3, Tauno Voipio wrote=
:
> > >> >> On 9.8.16 12:59, Matti Viljamaa wrote: > > >> >>> On Thursday, August 4, 2016 at 11:00:43 PM UTC+3, robert bristow=
-john=3D
> > >son wrote: > > >> >>>> On Monday, August 1, 2016 at 4:28:51 AM UTC-4, Matti Viljamaa w=
rote:
> > >> >>>>> On Thursday, July 21, 2016 at 9:54:24 PM UTC+3, robert bristow=
-john=3D
> > >son wrote: > > >> >>>>>> On Monday, July 18, 2016 at 5:25:33 AM UTC-4, Matti Viljamaa =
wrote=3D
> > >: > > >> >>>>>>> On Sunday, July 17, 2016 at 8:46:35 PM UTC+3, robert bristow=
-john=3D
> > >son wrote: > > >> >>>>>>>> On Sunday, July 17, 2016 at 4:16:45 AM UTC-4, Matti Viljama=
a wro=3D
> > >te: > > >> >>>>>>>>> On Saturday, July 16, 2016 at 5:24:29 PM UTC+3, Eric Jacob=
sen w=3D
> > >rote: > > >> >>>>>>>>>> On Sat, 16 Jul 2016 02:09:44 -0700 (PDT), Matti Viljamaa > > >> >>>>>>>>>> <viljamaadsp@gmail.com> wrote: > > >> >>>>>>>>>> > > >> >>>>>>>> ... > > >> >>>>>>>>>> > > >> >>>>>>>>>>> Currently I'm leaning towards simple allpass filter base=
d "sw=3D
> > >eepable" filter structures (e.g. this library https://github.com/vinni=
efalc=3D
> > >o/DSPFilters has a sweepable 2nd order allpass), since controlling an =
dry/a=3D
> > >llpass "mix" makes controlling the gain easy. > > >> >>>>>>>>>> > > >> >>>>>>>>>> Allpass filters tend to have flat frequency responses (he=
nce t=3D
> > >he > > >> >>>>>>>>>> name), and modify mainly the phase response. It sounds =
like =3D
> > >that's > > >> >>>>>>>>>> not what you want. > > >> >>>>>>>>> > > >> >>>>>>>>> But it's already working. I can create a peak filter using=
a se=3D
> > >cond order allpass by mixing it to the input using the equation: > > >> >>>>>>>>> > > >> >>>>>>>>> y =3D3D (x + A(x) + K * (x - A(x)) / 2 > > >> >>>>>>>>> > > >> >>>>>>>>> where K is a gain factor. > > >> >>>>>>>>> > > >> >>>>>>>>> I believe allpasses can form all the other basic filter ty=
pes a=3D
> > >s well. > > >> >>>>>>>> > > >> >>>>>>> > > >> >>>>>>>> you can, with a little manipulation, turn those 5 direct fo=
rm co=3D
> > >efficients into 5 independent coefficients in the Lattice form. the A=
PF fo=3D
> > >rm you show will not have an adjustment for the gain at Nyquist, which=
you =3D
> > >may want. take a look at this old paper: > > >> >>>>>>>> http://www.musicdsp.org/files/EQ-Coefficients.pdf . > > >> >>>>>>>> > > >> >>>>>>> > > >> >>>>>>> How do you know that the filter implementation I'm using doe=
s hav=3D
> > >e that problem? > > >> >>>>>> > > >> >>>>>> read the paper. it's free. last section (Sec 5) before the =
Concl=3D
> > >usion address exactly the APF formulation you mention above. > > >> >>>>>> > > >> >>>>>>> Also why is no gain adjusment at Nyquist a problem? > > >> >>>>>> > > >> >>>>>> it cramps the frequency response so that it does not well mat=
ch th=3D
> > >e analog prototype. > > >> >>>>> > > >> >>>>> Can you be more specific? > > >> >>>>> > > >> >>>>> Like how does it cramp? > > >> >>>>> > > >> >>>> > > >> >>>> bilinear transform has a frequency warping effect that makes th=
e ban=3D
> > >dwidth of the digital filter slightly smaller than the analog prototyp=
e it =3D
> > >is based on. > > >> >>>> > > >> >>>> it becomes a bigger problem if the resonant frequency is set ve=
ry hi=3D
> > >gh, close to Nyquist. > > >> >>>> > > >> >>>>> In my tests of the construct I have not heard problems. Should=
they=3D
> > > be heard? Or only heard at Nyquist (which I'm not really equalizing a=
t, mo=3D
> > >st of my equalization occurs below 16kHz)? > > >> >>>> > > >> >>>> if you're sampling at 44.1 kHz, 16 kHz is getting pretty close =
to Ny=3D
> > >quist. you may need to adjust the bandwidth (make it larger) or the Q=
(mak=3D
> > >e it smaller) so that the bandwidth comes out to what you originally i=
ntend=3D
> > >. > > >> >>>> > > >> >>>> r b-j > > >> >>> > > >> >>> I'm still unsure about what the problem of "cramping" specifical=
ly is=3D
> > >. > > >> >>> > > >> >>> Does this problem cause "warping" of the entire frequency spectr=
um?
> > >> >>> > > >> >>> Or is the problem only that the digital filter doesn't match the=
anal=3D
> > >og prototype? > > >> >>> > > >> >>> How is the problem audible? > > >> >> > > >> >> > > >> >> Matti, you should get a good textbook on digital signal processin=
g.
> > >> >> My favorite is Rick Lyons' Understanding Digital Signal Processin=
g.
> > >> >> The part on IIR filter design using the bilinear transform explai=
ns
> > >> >> it better than the space allows here. > > >> >> > > >> >> What are you attempting to achieve at the end? Equalization, filt=
ering
> > >> >> or both? Match amplitude or amplitude and phase? Delay specificat=
ions?
> > >> >> > > >> >> -- > > >> >> > > >> >> -TV > > >> > > > >> > I just need a sweepable 2nd order allpass filter. My idea being to=
make=3D
> > > "arbitrary shapes" using many of such cascaded. And the APF structure=
that=3D
> > > I posted earlier is the only one I know for performing filtering usin=
g an =3D
> > >allpass filter. > > >> > > > >> > And I actually have this working already. Until RBJ posed that the=
stru=3D
> > >cture contains the above mentioned problem ("no gain at Nyquist"), whi=
ch I'=3D
> > >m now trying to clarify, whether it really is a problem. > > >> > > > >> > I don't know what other options I have if I want to perform "arbit=
rary =3D
> > >shape" (and sweepable/tunable/dynamic) filtering in the simplest way p=
ossib=3D
> > >le (for now). > > >> > > > >>=3D20 > > >>=3D20 > > >> I have a feeling thet you may be barking up the wrong tree. > > >>=3D20 > > >> You have avoided all discussion about delay/phase behaviour, but > > >> an all-pass is just a phase twister. It cannot alone be the thing > > >> for arbitrary shape filter. My guess is that you have a certain > > >> implementation with all-passes in mind, but you have not wanted to > > >> tell what your aim really is, e.g. where the sweep/tune/dynamic > > >> input comes from and what will the final result be. > > >>=3D20 > > >> --=3D20 > > >>=3D20 > > >> -TV > > > > > >I've chosen allpasses, because using the structure mentioned earlier i=
t sho=3D
> > >uld be able to make all filter shapes (band, shelf, LP, HP). And combi=
ning =3D
> > >many of these should give me more complex shapes. It should be simple =
since=3D
> > > I'd only use allpasses. > >=20 > > The point is that an allpass is not frequency selective. It passes > > all frequencies equally, hence the name. It cannot, therefore, be > > used to create a filter that is frequency selective (i.e., attenuates > > some frequencies and not others). >=20 > Using the structure mentioned above I can perform both peak/bell shaped g=
ain and cut. Since the dry signal is mixed with the allpassed signal creati= ng a phase cancellation in the phase shifted regions.
>=20 > For example here: > http://www.cs.tut.fi/~ts/Allpass_Lecture.pdf >=20 > is seen that allpasses can build all the other basic filter shapes as wel=
l. The use of allpass filter sections connected in parallel to achieve arbitra= ry amplitude response is a specialized technique, far from mainstream filte= r design approaches. As a result you 're likely on your own when it comes = to problem solving your way through a particular design since few if any po= sters here have experience with this method. The good people on this forum have urged you to pursue your own self study.= I agree this may be the best way to proceed if you wish to use this type = of design.
Reply by August 12, 20162016-08-12
On Thursday, 21 July 2016 21:54:24 UTC+3, robert bristow-johnson  wrote:
> On Monday, July 18, 2016 at 5:25:33 AM UTC-4, Matti Viljamaa wrote: > > On Sunday, July 17, 2016 at 8:46:35 PM UTC+3, robert bristow-johnson wr=
ote:
> > > On Sunday, July 17, 2016 at 4:16:45 AM UTC-4, Matti Viljamaa wrote: > > > > On Saturday, July 16, 2016 at 5:24:29 PM UTC+3, Eric Jacobsen wrote=
:
> > > > > On Sat, 16 Jul 2016 02:09:44 -0700 (PDT), Matti Viljamaa > > > > > <viljamaadsp@gmail.com> wrote: > > > > >=20 > > > ... > > > > >=20 > > > > > >Currently I'm leaning towards simple allpass filter based "sweep=
able" filter structures (e.g. this library https://github.com/vinniefalco/D= SPFilters has a sweepable 2nd order allpass), since controlling an dry/allp= ass "mix" makes controlling the gain easy.
> > > > >=20 > > > > > Allpass filters tend to have flat frequency responses (hence the > > > > > name), and modify mainly the phase response. It sounds like tha=
t's
> > > > > not what you want. > > > >=20 > > > > But it's already working. I can create a peak filter using a second=
order allpass by mixing it to the input using the equation:
> > > >=20 > > > > y =3D (x + A(x) + K * (x - A(x)) / 2 > > > >=20 > > > > where K is a gain factor. > > > >=20 > > > > I believe allpasses can form all the other basic filter types as we=
ll.
> > >=20 > >=20 > > > you can, with a little manipulation, turn those 5 direct form coeffic=
ients into 5 independent coefficients in the Lattice form. the APF form yo= u show will not have an adjustment for the gain at Nyquist, which you may w= ant. take a look at this old paper:
> > > http://www.musicdsp.org/files/EQ-Coefficients.pdf . > > >=20 > >=20 > > How do you know that the filter implementation I'm using does have that=
problem?
>=20 > read the paper. it's free. last section (Sec 5) before the Conclusion a=
ddress exactly the APF formulation you mention above.
>=20 > > Also why is no gain adjusment at Nyquist a problem? >=20 > it cramps the frequency response so that it does not well match the analo=
g prototype.
>=20 > there is another paper by Orfanidis > http://www.ece.rutgers.edu/~orfanidi/ece348/peq.pdf=20 >=20 > r b-j
I've had a look at the paper, but I don't first of all understand whether= =20 H(z)=3D1/2[(1+K)+(1-K)A(z)] is really the same as y =3D (x + A(x) + K * (x - A(x)) / 2 and secondly (even after reading that particular chapter 5) I don't underst= and where it says about the "no gain at Nyquist" -problem.
Reply by August 12, 20162016-08-12
On Thursday, 11 August 2016 22:05:00 UTC+3, Eric Jacobsen  wrote:
> On Wed, 10 Aug 2016 15:26:27 GMT, eric.jacobsen@ieee.org (Eric > Jacobsen) wrote: > > >On Wed, 10 Aug 2016 07:12:10 -0700 (PDT), mavavilj@student.jyu.fi > >wrote: > > > >>On Wednesday, 10 August 2016 14:53:32 UTC+3, Tauno Voipio wrote: > >>> On 10.8.16 10:31, Matti Viljamaa wrote: > >>> > On Tuesday, August 9, 2016 at 9:45:30 PM UTC+3, Tauno Voipio wrote: > >>> >> On 9.8.16 12:59, Matti Viljamaa wrote: > >>> >>> On Thursday, August 4, 2016 at 11:00:43 PM UTC+3, robert bristow-john= > >>son wrote: > >>> >>>> On Monday, August 1, 2016 at 4:28:51 AM UTC-4, Matti Viljamaa wrote: > >>> >>>>> On Thursday, July 21, 2016 at 9:54:24 PM UTC+3, robert bristow-john= > >>son wrote: > >>> >>>>>> On Monday, July 18, 2016 at 5:25:33 AM UTC-4, Matti Viljamaa wrote= > >>: > >>> >>>>>>> On Sunday, July 17, 2016 at 8:46:35 PM UTC+3, robert bristow-john= > >>son wrote: > >>> >>>>>>>> On Sunday, July 17, 2016 at 4:16:45 AM UTC-4, Matti Viljamaa wro= > >>te: > >>> >>>>>>>>> On Saturday, July 16, 2016 at 5:24:29 PM UTC+3, Eric Jacobsen w= > >>rote: > >>> >>>>>>>>>> On Sat, 16 Jul 2016 02:09:44 -0700 (PDT), Matti Viljamaa > >>> >>>>>>>>>> <viljamaadsp@gmail.com> wrote: > >>> >>>>>>>>>> > >>> >>>>>>>> ... > >>> >>>>>>>>>> > >>> >>>>>>>>>>> Currently I'm leaning towards simple allpass filter based "sw= > >>eepable" filter structures (e.g. this library https://github.com/vinniefalc= > >>o/DSPFilters has a sweepable 2nd order allpass), since controlling an dry/a= > >>llpass "mix" makes controlling the gain easy. > >>> >>>>>>>>>> > >>> >>>>>>>>>> Allpass filters tend to have flat frequency responses (hence t= > >>he > >>> >>>>>>>>>> name), and modify mainly the phase response. It sounds like = > >>that's > >>> >>>>>>>>>> not what you want. > >>> >>>>>>>>> > >>> >>>>>>>>> But it's already working. I can create a peak filter using a se= > >>cond order allpass by mixing it to the input using the equation: > >>> >>>>>>>>> > >>> >>>>>>>>> y =3D (x + A(x) + K * (x - A(x)) / 2 > >>> >>>>>>>>> > >>> >>>>>>>>> where K is a gain factor. > >>> >>>>>>>>> > >>> >>>>>>>>> I believe allpasses can form all the other basic filter types a= > >>s well. > >>> >>>>>>>> > >>> >>>>>>> > >>> >>>>>>>> you can, with a little manipulation, turn those 5 direct form co= > >>efficients into 5 independent coefficients in the Lattice form. the APF fo= > >>rm you show will not have an adjustment for the gain at Nyquist, which you = > >>may want. take a look at this old paper: > >>> >>>>>>>> http://www.musicdsp.org/files/EQ-Coefficients.pdf . > >>> >>>>>>>> > >>> >>>>>>> > >>> >>>>>>> How do you know that the filter implementation I'm using does hav= > >>e that problem? > >>> >>>>>> > >>> >>>>>> read the paper. it's free. last section (Sec 5) before the Concl= > >>usion address exactly the APF formulation you mention above. > >>> >>>>>> > >>> >>>>>>> Also why is no gain adjusment at Nyquist a problem? > >>> >>>>>> > >>> >>>>>> it cramps the frequency response so that it does not well match th= > >>e analog prototype. > >>> >>>>> > >>> >>>>> Can you be more specific? > >>> >>>>> > >>> >>>>> Like how does it cramp? > >>> >>>>> > >>> >>>> > >>> >>>> bilinear transform has a frequency warping effect that makes the ban= > >>dwidth of the digital filter slightly smaller than the analog prototype it = > >>is based on. > >>> >>>> > >>> >>>> it becomes a bigger problem if the resonant frequency is set very hi= > >>gh, close to Nyquist. > >>> >>>> > >>> >>>>> In my tests of the construct I have not heard problems. Should they= > >> be heard? Or only heard at Nyquist (which I'm not really equalizing at, mo= > >>st of my equalization occurs below 16kHz)? > >>> >>>> > >>> >>>> if you're sampling at 44.1 kHz, 16 kHz is getting pretty close to Ny= > >>quist. you may need to adjust the bandwidth (make it larger) or the Q (mak= > >>e it smaller) so that the bandwidth comes out to what you originally intend= > >>. > >>> >>>> > >>> >>>> r b-j > >>> >>> > >>> >>> I'm still unsure about what the problem of "cramping" specifically is= > >>. > >>> >>> > >>> >>> Does this problem cause "warping" of the entire frequency spectrum? > >>> >>> > >>> >>> Or is the problem only that the digital filter doesn't match the anal= > >>og prototype? > >>> >>> > >>> >>> How is the problem audible? > >>> >> > >>> >> > >>> >> Matti, you should get a good textbook on digital signal processing. > >>> >> My favorite is Rick Lyons' Understanding Digital Signal Processing. > >>> >> The part on IIR filter design using the bilinear transform explains > >>> >> it better than the space allows here. > >>> >> > >>> >> What are you attempting to achieve at the end? Equalization, filtering > >>> >> or both? Match amplitude or amplitude and phase? Delay specifications? > >>> >> > >>> >> -- > >>> >> > >>> >> -TV > >>> > > >>> > I just need a sweepable 2nd order allpass filter. My idea being to make= > >> "arbitrary shapes" using many of such cascaded. And the APF structure that= > >> I posted earlier is the only one I know for performing filtering using an = > >>allpass filter. > >>> > > >>> > And I actually have this working already. Until RBJ posed that the stru= > >>cture contains the above mentioned problem ("no gain at Nyquist"), which I'= > >>m now trying to clarify, whether it really is a problem. > >>> > > >>> > I don't know what other options I have if I want to perform "arbitrary = > >>shape" (and sweepable/tunable/dynamic) filtering in the simplest way possib= > >>le (for now). > >>> > > >>>=20 > >>>=20 > >>> I have a feeling thet you may be barking up the wrong tree. > >>>=20 > >>> You have avoided all discussion about delay/phase behaviour, but > >>> an all-pass is just a phase twister. It cannot alone be the thing > >>> for arbitrary shape filter. My guess is that you have a certain > >>> implementation with all-passes in mind, but you have not wanted to > >>> tell what your aim really is, e.g. where the sweep/tune/dynamic > >>> input comes from and what will the final result be. > >>>=20 > >>> --=20 > >>>=20 > >>> -TV > >> > >>I've chosen allpasses, because using the structure mentioned earlier it sho= > >>uld be able to make all filter shapes (band, shelf, LP, HP). And combining = > >>many of these should give me more complex shapes. It should be simple since= > >> I'd only use allpasses. > > > >The point is that an allpass is not frequency selective. It passes > >all frequencies equally, hence the name. It cannot, therefore, be > >used to create a filter that is frequency selective (i.e., attenuates > >some frequencies and not others). > > > >>What do you mean by delay/phase behaviour? I'm not that versed in filter de= > >>sign to know what specifying these means, but am (in this thread) trying to= > >> find an implementation that allows "arbitrary shape" and dynamic/tunable f= > >>iltering. > > > >And many people have given you a lot of good advice, but you are not > >taking it and not listening if you still want to use allpass > >structures. It has also been explained to you many times that > >"arbitrary shape" is not really possible and there will be limitations > >in what you can and cannot do. > > > >I would suggest going back to the beginnings of the threads you have > >started and re-read all of them. > > > >>I'm using a control signal to control the filter parameters that may as wel= > >>l be from parameters given to the user, like in a typical parametric equali= > >>zer. > > > > > > > I tried to respond to mavavilj and Randy's post, but there was some > sort of a problem with the header, (441 error, header too long) so > I'll say it here: > > It's pretty fundamental that you can cancel signals with an opposite > phase, which is how multipath channels get frequency selective, too, > even when all the paths are all-pass. > > But in filter design when you say: > > "What do you mean by delay/phase behaviour? I'm not that versed in > filter design to know what specifying these means, but am (in this > thread) trying to find an implementation that allows "arbitrary shape" > and dynamic/tunable filtering." > > you're not going to get very far with all-pass structures.
Can you elaborate?
Reply by Eric Jacobsen August 11, 20162016-08-11
On Wed, 10 Aug 2016 15:26:27 GMT, eric.jacobsen@ieee.org (Eric
Jacobsen) wrote:

>On Wed, 10 Aug 2016 07:12:10 -0700 (PDT), mavavilj@student.jyu.fi >wrote: > >>On Wednesday, 10 August 2016 14:53:32 UTC+3, Tauno Voipio wrote: >>> On 10.8.16 10:31, Matti Viljamaa wrote: >>> > On Tuesday, August 9, 2016 at 9:45:30 PM UTC+3, Tauno Voipio wrote: >>> >> On 9.8.16 12:59, Matti Viljamaa wrote: >>> >>> On Thursday, August 4, 2016 at 11:00:43 PM UTC+3, robert bristow-john= >>son wrote: >>> >>>> On Monday, August 1, 2016 at 4:28:51 AM UTC-4, Matti Viljamaa wrote: >>> >>>>> On Thursday, July 21, 2016 at 9:54:24 PM UTC+3, robert bristow-john= >>son wrote: >>> >>>>>> On Monday, July 18, 2016 at 5:25:33 AM UTC-4, Matti Viljamaa wrote= >>: >>> >>>>>>> On Sunday, July 17, 2016 at 8:46:35 PM UTC+3, robert bristow-john= >>son wrote: >>> >>>>>>>> On Sunday, July 17, 2016 at 4:16:45 AM UTC-4, Matti Viljamaa wro= >>te: >>> >>>>>>>>> On Saturday, July 16, 2016 at 5:24:29 PM UTC+3, Eric Jacobsen w= >>rote: >>> >>>>>>>>>> On Sat, 16 Jul 2016 02:09:44 -0700 (PDT), Matti Viljamaa >>> >>>>>>>>>> <viljamaadsp@gmail.com> wrote: >>> >>>>>>>>>> >>> >>>>>>>> ... >>> >>>>>>>>>> >>> >>>>>>>>>>> Currently I'm leaning towards simple allpass filter based "sw= >>eepable" filter structures (e.g. this library https://github.com/vinniefalc= >>o/DSPFilters has a sweepable 2nd order allpass), since controlling an dry/a= >>llpass "mix" makes controlling the gain easy. >>> >>>>>>>>>> >>> >>>>>>>>>> Allpass filters tend to have flat frequency responses (hence t= >>he >>> >>>>>>>>>> name), and modify mainly the phase response. It sounds like = >>that's >>> >>>>>>>>>> not what you want. >>> >>>>>>>>> >>> >>>>>>>>> But it's already working. I can create a peak filter using a se= >>cond order allpass by mixing it to the input using the equation: >>> >>>>>>>>> >>> >>>>>>>>> y =3D (x + A(x) + K * (x - A(x)) / 2 >>> >>>>>>>>> >>> >>>>>>>>> where K is a gain factor. >>> >>>>>>>>> >>> >>>>>>>>> I believe allpasses can form all the other basic filter types a= >>s well. >>> >>>>>>>> >>> >>>>>>> >>> >>>>>>>> you can, with a little manipulation, turn those 5 direct form co= >>efficients into 5 independent coefficients in the Lattice form. the APF fo= >>rm you show will not have an adjustment for the gain at Nyquist, which you = >>may want. take a look at this old paper: >>> >>>>>>>> http://www.musicdsp.org/files/EQ-Coefficients.pdf . >>> >>>>>>>> >>> >>>>>>> >>> >>>>>>> How do you know that the filter implementation I'm using does hav= >>e that problem? >>> >>>>>> >>> >>>>>> read the paper. it's free. last section (Sec 5) before the Concl= >>usion address exactly the APF formulation you mention above. >>> >>>>>> >>> >>>>>>> Also why is no gain adjusment at Nyquist a problem? >>> >>>>>> >>> >>>>>> it cramps the frequency response so that it does not well match th= >>e analog prototype. >>> >>>>> >>> >>>>> Can you be more specific? >>> >>>>> >>> >>>>> Like how does it cramp? >>> >>>>> >>> >>>> >>> >>>> bilinear transform has a frequency warping effect that makes the ban= >>dwidth of the digital filter slightly smaller than the analog prototype it = >>is based on. >>> >>>> >>> >>>> it becomes a bigger problem if the resonant frequency is set very hi= >>gh, close to Nyquist. >>> >>>> >>> >>>>> In my tests of the construct I have not heard problems. Should they= >> be heard? Or only heard at Nyquist (which I'm not really equalizing at, mo= >>st of my equalization occurs below 16kHz)? >>> >>>> >>> >>>> if you're sampling at 44.1 kHz, 16 kHz is getting pretty close to Ny= >>quist. you may need to adjust the bandwidth (make it larger) or the Q (mak= >>e it smaller) so that the bandwidth comes out to what you originally intend= >>. >>> >>>> >>> >>>> r b-j >>> >>> >>> >>> I'm still unsure about what the problem of "cramping" specifically is= >>. >>> >>> >>> >>> Does this problem cause "warping" of the entire frequency spectrum? >>> >>> >>> >>> Or is the problem only that the digital filter doesn't match the anal= >>og prototype? >>> >>> >>> >>> How is the problem audible? >>> >> >>> >> >>> >> Matti, you should get a good textbook on digital signal processing. >>> >> My favorite is Rick Lyons' Understanding Digital Signal Processing. >>> >> The part on IIR filter design using the bilinear transform explains >>> >> it better than the space allows here. >>> >> >>> >> What are you attempting to achieve at the end? Equalization, filtering >>> >> or both? Match amplitude or amplitude and phase? Delay specifications? >>> >> >>> >> -- >>> >> >>> >> -TV >>> > >>> > I just need a sweepable 2nd order allpass filter. My idea being to make= >> "arbitrary shapes" using many of such cascaded. And the APF structure that= >> I posted earlier is the only one I know for performing filtering using an = >>allpass filter. >>> > >>> > And I actually have this working already. Until RBJ posed that the stru= >>cture contains the above mentioned problem ("no gain at Nyquist"), which I'= >>m now trying to clarify, whether it really is a problem. >>> > >>> > I don't know what other options I have if I want to perform "arbitrary = >>shape" (and sweepable/tunable/dynamic) filtering in the simplest way possib= >>le (for now). >>> > >>>=20 >>>=20 >>> I have a feeling thet you may be barking up the wrong tree. >>>=20 >>> You have avoided all discussion about delay/phase behaviour, but >>> an all-pass is just a phase twister. It cannot alone be the thing >>> for arbitrary shape filter. My guess is that you have a certain >>> implementation with all-passes in mind, but you have not wanted to >>> tell what your aim really is, e.g. where the sweep/tune/dynamic >>> input comes from and what will the final result be. >>>=20 >>> --=20 >>>=20 >>> -TV >> >>I've chosen allpasses, because using the structure mentioned earlier it sho= >>uld be able to make all filter shapes (band, shelf, LP, HP). And combining = >>many of these should give me more complex shapes. It should be simple since= >> I'd only use allpasses. > >The point is that an allpass is not frequency selective. It passes >all frequencies equally, hence the name. It cannot, therefore, be >used to create a filter that is frequency selective (i.e., attenuates >some frequencies and not others). > >>What do you mean by delay/phase behaviour? I'm not that versed in filter de= >>sign to know what specifying these means, but am (in this thread) trying to= >> find an implementation that allows "arbitrary shape" and dynamic/tunable f= >>iltering. > >And many people have given you a lot of good advice, but you are not >taking it and not listening if you still want to use allpass >structures. It has also been explained to you many times that >"arbitrary shape" is not really possible and there will be limitations >in what you can and cannot do. > >I would suggest going back to the beginnings of the threads you have >started and re-read all of them. > >>I'm using a control signal to control the filter parameters that may as wel= >>l be from parameters given to the user, like in a typical parametric equali= >>zer. > >
I tried to respond to mavavilj and Randy's post, but there was some sort of a problem with the header, (441 error, header too long) so I'll say it here: It's pretty fundamental that you can cancel signals with an opposite phase, which is how multipath channels get frequency selective, too, even when all the paths are all-pass. But in filter design when you say: "What do you mean by delay/phase behaviour? I'm not that versed in filter design to know what specifying these means, but am (in this thread) trying to find an implementation that allows "arbitrary shape" and dynamic/tunable filtering." you're not going to get very far with all-pass structures. My wording was too absolute, though.