DSPRelated.com
Forums

Techniques behind arbitrary response or "drawable" equalizers?

Started by Unknown June 14, 2016
On Mon, 13 Jun 2016 21:32:12 -0700 (PDT),
viljamaadsp@gmail.com wrote:

>I need to design a filter that has arbitrary response. Basically, I want to be able to almost "draw" the equalizer curve. > >What are the techniques behind (FFT-based) arbitrary response or "drawable" equalizers such as: > >http://wiki.cockos.com/wiki/index.php/ReaFIR > >or > >http://www.elevayta.net/product4.htm
As I understand it, the FIR tap weights are the same as the impulse response of the filter, so you *should* be able to take the IFFT if the desired spectrum and map it to the tap weights. (Plus some window function.) However, I had trouble implementing that approach a few years back, for generating random noise with an arbitrary spectrum. Might have been my general ignorance, but I finally fell back on what I knew would work. My existing rectangular-band noise used a DFT-type formulation, where for upper and lower cutoffs wU and wL the Nth tap weight was (sin(N*wU) - sin(N * wL)) multiplied by a window function. So I just treated my arbitrary spectrum as a whole mess of little rectangles of varying heights, and summed 'em all up to get each final FIR weight. Not elegant, but it works! 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 Wed, 15 Jun 2016 05:22:25 -0700 (PDT), Greg Berchin
<gjberchin@charter.net> wrote:

>On Tuesday, June 14, 2016 at 4:59:24 PM UTC-5, Randy Yates wrote: > >> This sounds like a good fit (no pun intended) for FDLS (Frequency Domain >> Least Squares). You could compute the phase from the magnitude: the >> input to FDLS requires both (complex). > >VLV apparently did a lot of experimentation applying FDLS to arbitrary freq= >uency responses, creating the phase response from the log of the magnitude = >response. He reported that minimum-phase was, in general, not sufficient to= > guarantee a good fit. I don't know what the criterion for a good fit is, o= >r even if such a criterion exists, but in my experience FDLS works best app= >roximating LTI frequency responses known to have originated in digital or a= >nalog rational transfer functions. > >I wish that Vladimir were here to elaborate.
I'm still sad about that.
>Greg Berchin
On Tuesday, June 14, 2016 at 12:32:16 AM UTC-4, Matti Viljamaa wrote:
> I need to design a filter that has arbitrary response. Basically, I want to be able to almost "draw" the equalizer curve. > > What are the techniques behind (FFT-based) arbitrary response or "drawable" equalizers such as: > > http://wiki.cockos.com/wiki/index.php/ReaFIR > > or > > http://www.elevayta.net/product4.htm
i know Parks-McLellan was mentioned, but i sorta think they just did the basic windowing FIR design with a good (likely Kaiser) window. depends on how long of an FIR that you are allowed. how densely "sampled" must your frequency response be? if it can be more coarsely sampled, like 3 points per octave, then a graphic EQ might be what you want. might have IIR filters in it. r b-j
On Thursday, June 16, 2016 at 8:54:42 AM UTC+3, robert bristow-johnson wrote:
> On Tuesday, June 14, 2016 at 12:32:16 AM UTC-4, Matti Viljamaa wrote: > > I need to design a filter that has arbitrary response. Basically, I want to be able to almost "draw" the equalizer curve. > > > > What are the techniques behind (FFT-based) arbitrary response or "drawable" equalizers such as: > > > > http://wiki.cockos.com/wiki/index.php/ReaFIR > > > > or > > > > http://www.elevayta.net/product4.htm > > i know Parks-McLellan was mentioned, but i sorta think they just did the basic windowing FIR design with a good (likely Kaiser) window. depends on how long of an FIR that you are allowed. > > how densely "sampled" must your frequency response be? if it can be more coarsely sampled, like 3 points per octave, then a graphic EQ might be what you want. might have IIR filters in it. > > r b-j
I prefer it to match the resolution of a FFT. At least of 1024 samples.
Matti Viljamaa  <viljamaadsp@gmail.com> wrote:

>On Thursday, June 16, 2016 at 8:54:42 AM UTC+3, robert bristow-johnson
>> On Tuesday, June 14, 2016 at 12:32:16 AM UTC-4, Matti Viljamaa wrote:
>>> What are the techniques behind (FFT-based) arbitrary response or >>> "drawable" equalizers such as:
>> how densely "sampled" must your frequency response be? if it can be >> more coarsely sampled, like 3 points per octave, then a graphic EQ might >> be what you want. might have IIR filters in it.
> I prefer it to match the resolution of a FFT. At least of 1024 samples.
If you're constrained to use FFT's (why?) then you might want to use an overlap-add method. But, there will be artifacts, and if for example it is an audio application, those artifacts are not so great. Steve
On Monday, June 13, 2016 at 9:32:16 PM UTC-7, Matti Viljamaa wrote:
> I need to design a filter that has arbitrary response. Basically, I want to be able to > almost "draw" the equalizer curve.
> What are the techniques behind (FFT-based) arbitrary response or "drawable" equalizers such as:
> http://wiki.cockos.com/wiki/index.php/ReaFIR
Seems like the traditional graphic equalizer, though in digital form instead of a series of linear potentiometers. There is a Motorola 56001 note on the design of a digital graphic equalizer, which digitizes the position of the linear pots, then uses those with digital filters. For the actual question, similar to Nyquist sampling, you need enough points to accurately represent the function, though in frequency response domain instead of time domain.
On Thursday, June 16, 2016 at 10:37:13 PM UTC+3, Steve Pope wrote:
> Matti Viljamaa <viljamaadsp@gmail.com> wrote: > > >On Thursday, June 16, 2016 at 8:54:42 AM UTC+3, robert bristow-johnson > > >> On Tuesday, June 14, 2016 at 12:32:16 AM UTC-4, Matti Viljamaa wrote: > > >>> What are the techniques behind (FFT-based) arbitrary response or > >>> "drawable" equalizers such as: > > >> how densely "sampled" must your frequency response be? if it can be > >> more coarsely sampled, like 3 points per octave, then a graphic EQ might > >> be what you want. might have IIR filters in it. > > > I prefer it to match the resolution of a FFT. At least of 1024 samples. > > If you're constrained to use FFT's (why?) then you might want to use > an overlap-add method. But, there will be artifacts, and if for > example it is an audio application, those artifacts are not so great. > > Steve
I'm using FFT for analysis purposes, just like in the second example plug-in in the first message. Thus I would like to be able to have the filtering resolution match closely the analysis resolution.
On Thursday, June 16, 2016 at 3:37:13 PM UTC-4, Steve Pope wrote:
> Matti Viljamaa <viljamaadsp@gmail.com> wrote: > > >On Thursday, June 16, 2016 at 8:54:42 AM UTC+3, robert bristow-johnson > > >> On Tuesday, June 14, 2016 at 12:32:16 AM UTC-4, Matti Viljamaa wrote: > > >>> What are the techniques behind (FFT-based) arbitrary response or > >>> "drawable" equalizers such as: > > >> how densely "sampled" must your frequency response be? if it can be > >> more coarsely sampled, like 3 points per octave, then a graphic EQ might > >> be what you want. might have IIR filters in it. > > > I prefer it to match the resolution of a FFT. At least of 1024 samples. >
do you need the same resolution (in frequency "bin" width) at higher frequencies as you do at lower frequencies? that is often not the case, which is why i ask.
> > If you're constrained to use FFT's (why?) then you might want to use > an overlap-add method. But, there will be artifacts, and if for > example it is an audio application, those artifacts are not so great. >
if the length of the frame hop added to the length of the FIR does not exceed the FFT length there are no artifacts with overlap-add, unless you want to blame roundoff error in the FFT and iFFT as "artifacts". but the OP has to "draw" his arbitrary frequency response. reflect that drawing for negative frequencies. send that to an iFFT that is much longer than the specified FIR length (the negative frequencies becomes the upper half of the data going in), and window the result to the specified length of the FIR (using a good window like the Kaiser), that will change the frequency response from his original drawing but he will be able to hit the original quite well. r b-j
On Friday, June 17, 2016 at 10:47:46 AM UTC-7, robert bristow-johnson wrote:

(snip)

> do you need the same resolution (in frequency "bin" width) at higher frequencies > as you do at lower frequencies? that is often not the case, which is why i ask.
I was just wondering about this. As I noted, the problem sounds like the usual graphic equalizer used in stereo systems, but those have the bins usually octave spaced. As far as I know, the common graphic equalizer uses RLC filters, but as I noted, there is at least an application note for a DSP version. The only analog part is the linear potentiometers to an ADC. There is also the parametric equalizer, which I believe are also traditionally implemented as RLC filters, but could also be done digitally, where you have two or three, maybe more, filters that you can adjust the center frequency, width, and amount of increase or decrease. It would be interesting to have a parametric equalizer where the width was set automatically based on the spacing between the selected frequencies, and, again, to do all the filtering as DSP.
Hhhhey glen!  How're you doing??

:-)


On 6/17/16 7:07 PM, herrmannsfeldt@gmail.com wrote:
> On Friday, June 17, 2016 at 10:47:46 AM UTC-7, robert bristow-johnson wrote: > > (snip) > >> do you need the same resolution (in frequency "bin" width) at higher frequencies >> as you do at lower frequencies? that is often not the case, which is why i ask. > > I was just wondering about this. > > As I noted, the problem sounds like the usual graphic equalizer used in stereo systems, > but those have the bins usually octave spaced.
i dunno, but i think the current "state-of-the-art" is a 31-band with 3/octave. there's a list somewhere of the "standard" frequencies but i think that 20 25 32 40 50 63 80 100 125 160 200 250 320 400 500 625 800 1000 1250 1600 2000 2500 3200 4000 5000 6250 8000 10000 12500 16000 20000 might be them.
> As far as I know, the common graphic equalizer uses RLC filters,
the analog ones of the days of yore.
> but as I noted, > there is at least an application note for a DSP version. The only analog part is > the linear potentiometers to an ADC.
there are digital graphic EQ. some might be FFT or fast-convolution based. of the digital graphic EQs, i think the first one's emulated the analog with a bunch of BPFs (with pots) in parallel. but that has a know problem of a phase cancellation at the skirts of adjacent bands that causes a lump or bump in the transition band in between that is the sum of the two adjacent BPF skirts
> > There is also the parametric equalizer, which I believe are also traditionally implemented > as RLC filters, but could also be done digitally, where you have two or three, maybe more, > filters that you can adjust the center frequency, width, and amount of increase or decrease. > > It would be interesting to have a parametric equalizer where the width was set automatically > based on the spacing between the selected frequencies, and, again, to do all the filtering > as DSP.
so there is a recent AES paper by Jean-Marc Jot and Richard Oliver. it's log-frequency-spaced parametric EQs with Q or bandwidth defined the way it is in the audio EQ cookbook. and they're in cascade, not parallel. and they better have very wide words to deal with the accumulated quantization noise that might be boosted by a later stage. i had thought of this where the BW was 1/3 octave (for a spacing of 1/3 octave). Jot and Oliver can have a wider bell EQ and they deal with the overlap by solving a system of equations. if there's some grad student in EE that wants to do an audio DSP project, it could be converting this cascade case of the parametric EQ bands and turn that into parallel using something like Heaviside partial fraction expansion. even in digital the net quantization noise is expected to be less with parallel SOS over series SOS ("second-order sections" similar to "biquad"). -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."