DSPRelated.com
Forums

How are variable filters implemented?

Started by Matti Viljamaa June 24, 2016
On Friday, July 1, 2016 at 6:13:02 PM UTC-4, herrman...@gmail.com wrote:
> (snip) > > > I have not looked at a schematic for a parametric equalizer, but have only seen > > one from the outside. > > I now have a schematic for an analog four band parametric equalizer, and it is > somewhat simpler than I was expecting.
the peak/cut parametric EQ is a BPF in parallel with a wire. the shelving EQ is an LPF or HPF in parallel with a wire. the old analog graphic EQ had BPFs in parallel with each other and lowShelf and hiShelf as bookends. but there was some nasty phase cancellation in between the bands. doing a graphic EQ digitally might be a bunch of parametric EQs in series with a very wide word for the signal to mitigate the buildup of quantization noise. r b-j
For smoother operations you could also use logarithmic scale for coarse
parameter value changes and linear scale for fine tuning. 
---------------------------------------
Posted through http://www.DSPRelated.com
robert bristow-johnson  <rbj@audioimagination.com> wrote:

>the old analog graphic EQ had BPFs in parallel with each other and >lowShelf and hiShelf as bookends. but there was some nasty phase >cancellation in between the bands.
As evidenced by if all the bands were set to +/- zero dB and you switched "EQ out", a noticable coloration went away. Maybe on very pro equipment this artifact was very low level. But for recording and scoring, parametric EQ was (is?) the norm whereas graphic EQ was (is?) the choice for sound reinforcement. S.
On Friday, July 1, 2016 at 9:48:03 PM UTC-7, robert bristow-johnson wrote:

(snip, I wrote)

> > I now have a schematic for an analog four band parametric equalizer, and it is > > somewhat simpler than I was expecting.
> the peak/cut parametric EQ is a BPF in parallel with a wire.
If I didn't see it in the circuit, I wouldn't have known what "in parallel with a wire" looks like, but it seems to be a filter with one wire for both input and output.
> the shelving EQ is an LPF or HPF in parallel with a wire.
The Low Shelf (high-pass) and High Shelf (low pass) seem to be ordinary op-amp based filters. They use dual potentiometers to keep the level constant in the pass band as the filter changes. One before, and one after, the parametric filters.
> the old analog graphic EQ had BPFs in parallel with each other and lowShelf > and hiShelf as bookends. but there was some nasty phase cancellation in > between the bands.
Seems that some of that is a side effect of the equalization itself.
> doing a graphic EQ digitally might be a bunch of parametric EQs in > series with a very wide word for the signal to mitigate the buildup of > quantization noise.
There is a Motorola 56001application note on how to build one. http://pdf1.alldatasheet.com/datasheet-pdf/view/107880/FREESCALE/DSP56001.html Also for the Motorola 56311: http://www.tech.plym.ac.uk/spmc/elec327/ELEC327B/pdf/AN2110.pdf -- glen
On Fri, 1 Jul 2016 12:13:34 -0700 (PDT), Matti Viljamaa
<viljamaadsp@gmail.com> wrote:

>On Friday, July 1, 2016 at 3:25:00 PM UTC+3, Bob Masta wrote: >> On Thu, 30 Jun 2016 06:31:00 -0700 (PDT), Matti Viljamaa >> <viljamaadsp@gmail.com> wrote: >>=20 >> >On Thursday, June 30, 2016 at 4:17:14 PM UTC+3, Bob Masta wrote: >> >> On Wed, 29 Jun 2016 03:33:18 -0700 (PDT), Matti Viljamaa >> >> <viljamaadsp@gmail.com> wrote: >> >>=20 >> >> >On Tuesday, June 28, 2016 at 11:46:59 PM UTC+3, herrman...@gmail.com = >wrote: >> >> >> On Monday, June 27, 2016 at 9:13:48 PM UTC-7, robert bristow-johnso= >n wrote: >> >> >> > if you have infinite computational power, you can slew the user= >=20 >> >> >> > parameter each and every sample and recalculate all of the coeffi= >cients=20 >> >> >> > each sample. >> >> >>=20 >> >> >> Having not actually tried it, if you have a ROM look-up table with = >filters of >> >> >> various center frequencies and Qs, does that help? >> >> >>=20 >> >> >> Changing the center frequency is like changing the sampling rate.= >=20 >> >> >>=20 >> >> >> With the size of ROMs today, you could put a really large table of >> >> >> precomputed coefficients in, and just look one up when needed. >> >> >>=20 >> >> >> Maybe 1024 center frequencies, equally distributed in log frequency >> >> >> space, and 1024 Qs. Choose the closest one. >> >> > >> >> >Does this kind of "quantization" of the frequencies lead to the stepp= >ing being heard when the parameters are changed? I.e. that the auditory res= >ponse sounds "stepped"? Or is there a way, e.g. dense enough table, so that= > the response still sounds smooth? >> >>=20 >> >> The quantization of frequencies is just the equivalent of >> >> lots of bands on a multi-band graphic equalizer... the >> >> number of bands would have no "stepping" effect on the sound >> >> when they are being changed. The size of the change would >> >> of course affect the sound, but I'm not sure how to decide >> >> what is an artifact and what is a desired effect. >> > >> >But when you sweep the parametric equalizer over the bands? Generally in= > parametric equalizers you don't hear it jumping from band to another, but = >rather changing the cutoff sounds like it's continuously varied. >>=20 >> You won't hear a jumping effect in any case... the bands are >> way too close together for that, and there are no gaps >> between them. Remember that the actual filter response will >> always be spread over multiple bands, so what happens when >> you move the "nominal" cutoff from band F to band F+1 is >> that many adjacent bands are all changing slightly. =20 >>=20 > >So judging by this, is it possible to create smooth parameter variation by = >making a table of e.g. 1024 values for each parameters (cutoff, Q etc.) and= > then changing between them when the user modifies the parameters? Is this = >how they do it in parametric equalizers?
Once again, it would *really* help us if you would explain exactly what you are trying to do. If you want an arbitrary "drawable" response, then you don't deal with parameters like Q and cutoff... you just create a graph of the desired response, made up of (say) 512 points representing the target magnitude spectrum at 512 frequencies from 0 to Nyquist-1. Then you convert that to 1024 FIR weights, apply a window function to avoid sharp discontinuities at the ends, and you are done. When you talk about "smooth parameter variation", it's not clear what you mean. How do you want to control the parameters? A parametric EQ gives you a knob for each parameter, and you can have a continuously variable Q or center frequency or whatever. Even in a digital implementation, the steps of the knob can be way finer than any ear can perceive. That would certainly be a "smooth parameter variation". But exactly the same is true of the steps in each slider of a graphical EQ... way too fine to be an issue. In fact there is no issue about smoothness in any digital implementation that comes to mind, any more than there would be in an analog implementation. The real issue is how you are going to set the 512 (or 1024 or whatever) sliders. You are probably not talking about having a physical array of 512 sliders, so what exactly do you have in mind? Where does the desired target response originate? How does it vary in time? Best regards, Bob Masta DAQARTA v9.20 Data AcQuisition And Real-Time Analysis www.daqarta.com Scope, Spectrum, Spectrogram, Sound Level Meter Frequency Counter, Pitch Track, Pitch-to-MIDI FREE 8-channel Signal Generator, DaqMusiq generator Science with your sound card!
On Saturday, July 2, 2016 at 3:34:52 PM UTC+3, Bob Masta wrote:
> On Fri, 1 Jul 2016 12:13:34 -0700 (PDT), Matti Viljamaa > <viljamaadsp@gmail.com> wrote: > > >On Friday, July 1, 2016 at 3:25:00 PM UTC+3, Bob Masta wrote: > >> On Thu, 30 Jun 2016 06:31:00 -0700 (PDT), Matti Viljamaa > >> <viljamaadsp@gmail.com> wrote: > >>=20 > >> >On Thursday, June 30, 2016 at 4:17:14 PM UTC+3, Bob Masta wrote: > >> >> On Wed, 29 Jun 2016 03:33:18 -0700 (PDT), Matti Viljamaa > >> >> <viljamaadsp@gmail.com> wrote: > >> >>=20 > >> >> >On Tuesday, June 28, 2016 at 11:46:59 PM UTC+3, herrman...@gmail.com = > >wrote: > >> >> >> On Monday, June 27, 2016 at 9:13:48 PM UTC-7, robert bristow-johnso= > >n wrote: > >> >> >> > if you have infinite computational power, you can slew the user= > >=20 > >> >> >> > parameter each and every sample and recalculate all of the coeffi= > >cients=20 > >> >> >> > each sample. > >> >> >>=20 > >> >> >> Having not actually tried it, if you have a ROM look-up table with = > >filters of > >> >> >> various center frequencies and Qs, does that help? > >> >> >>=20 > >> >> >> Changing the center frequency is like changing the sampling rate.= > >=20 > >> >> >>=20 > >> >> >> With the size of ROMs today, you could put a really large table of > >> >> >> precomputed coefficients in, and just look one up when needed. > >> >> >>=20 > >> >> >> Maybe 1024 center frequencies, equally distributed in log frequency > >> >> >> space, and 1024 Qs. Choose the closest one. > >> >> > > >> >> >Does this kind of "quantization" of the frequencies lead to the stepp= > >ing being heard when the parameters are changed? I.e. that the auditory res= > >ponse sounds "stepped"? Or is there a way, e.g. dense enough table, so that= > > the response still sounds smooth? > >> >>=20 > >> >> The quantization of frequencies is just the equivalent of > >> >> lots of bands on a multi-band graphic equalizer... the > >> >> number of bands would have no "stepping" effect on the sound > >> >> when they are being changed. The size of the change would > >> >> of course affect the sound, but I'm not sure how to decide > >> >> what is an artifact and what is a desired effect. > >> > > >> >But when you sweep the parametric equalizer over the bands? Generally in= > > parametric equalizers you don't hear it jumping from band to another, but = > >rather changing the cutoff sounds like it's continuously varied. > >>=20 > >> You won't hear a jumping effect in any case... the bands are > >> way too close together for that, and there are no gaps > >> between them. Remember that the actual filter response will > >> always be spread over multiple bands, so what happens when > >> you move the "nominal" cutoff from band F to band F+1 is > >> that many adjacent bands are all changing slightly. =20 > >>=20 > > > >So judging by this, is it possible to create smooth parameter variation by = > >making a table of e.g. 1024 values for each parameters (cutoff, Q etc.) and= > > then changing between them when the user modifies the parameters? Is this = > >how they do it in parametric equalizers? > > Once again, it would *really* help us if you would explain > exactly what you are trying to do. If you want an arbitrary > "drawable" response, then you don't deal with parameters > like Q and cutoff... you just create a graph of the desired > response, made up of (say) 512 points representing the > target magnitude spectrum at 512 frequencies from 0 to > Nyquist-1. Then you convert that to 1024 FIR weights, apply > a window function to avoid sharp discontinuities at the > ends, and you are done.
I want to understand general ways of transforming filters that are specified "statically" (i.e. that the coefficients are supposed to stay static) into dynamically variable filters. Many filter books seem to describe filters mainly only statically as if they would be "designed and then left so", eventhough most digital audio applications call for parameters that the user can vary in real-time.
>I want to understand general ways of transforming filters that are >specified "statically" (i.e. that the coefficients are supposed to stay
static)
>into dynamically variable filters. Many filter books seem to describe
filters
>mainly only statically as if they would be "designed and then left so", >eventhough most digital audio applications call for parameters that the
user
>can vary in real-time.
Maybe some example case could help here? --------------------------------------- Posted through http://www.DSPRelated.com
On Saturday, July 2, 2016 at 5:37:06 PM UTC+3, jtp_1960 wrote:
> >I want to understand general ways of transforming filters that are > >specified "statically" (i.e. that the coefficients are supposed to stay > static) > >into dynamically variable filters. Many filter books seem to describe > filters > >mainly only statically as if they would be "designed and then left so", > >eventhough most digital audio applications call for parameters that the > user > >can vary in real-time. > > Maybe some example case could help here? > --------------------------------------- > Posted through http://www.DSPRelated.com
I believe you can pick any filter design and it doesn't specify how to make a "variable" version of it. Rather, it only gives the equations for designing a static filter or static filters. So the question then is, how to make it variable like in a typical, practical parametric equalizer.
Matti Viljamaa  <viljamaadsp@gmail.com> wrote:

>I want to understand general ways of transforming filters that are >specified "statically" (i.e. that the coefficients are supposed to stay >static) into dynamically variable filters. Many filter books seem to >describe filters mainly only statically as if they would be "designed >and then left so", eventhough most digital audio applications call for >parameters that the user can vary in real-time.
One thing to be aware of is that the ladder/lattice topology (called ARMA in Mathworks products) is guaranteed to remain stable as you slew between any two sets of coefficients which are themselves stable. Steve
Bob Masta wrote:
> On Fri, 1 Jul 2016 12:13:34 -0700 (PDT), Matti Viljamaa > <viljamaadsp@gmail.com> wrote:
<snip>
> > In fact there is no issue about smoothness in any digital > implementation that comes to mind, any more than there would > be in an analog implementation. >
I wonder if "smooth" doesn't mean "I don't want some really ugly discontinuous output while the operator is moving sliders or knobs." If that is the case, then it's very nearly more of a UI design thing rather than an internal thing - as the "graph" is changing, don't post to the current filter until an appropriate debounce period has passed, and then maybe fade in the new filter while you fade out the old. But I am guessing. <snip>
> Best regards, > > > Bob Masta > > DAQARTA v9.20 > Data AcQuisition And Real-Time Analysis > www.daqarta.com > Scope, Spectrum, Spectrogram, Sound Level Meter > Frequency Counter, Pitch Track, Pitch-to-MIDI > FREE 8-channel Signal Generator, DaqMusiq generator > Science with your sound card! >
-- Les Cargill