DSPRelated.com
Forums

Techniques behind arbitrary response or "drawable" equalizers?

Started by Unknown June 14, 2016
As I tried to point outamples,

I'm trying to perform filtering based on data obtained from FFT analysis. And I desire to have the filtering adjust between FFT analysis frames. Perform a sort of dynamic equalization based on the FFT analysis. But obviously I need a way to "draw" the equalizer curve and update it even on a per sample basis so that it follow the envelopes that I desire.
Matti Viljamaa  <viljamaadsp@gmail.com> wrote:

>As I tried to point outamples, > >I'm trying to perform filtering based on data obtained from FFT >analysis. And I desire to have the filtering adjust between FFT analysis >frames. Perform a sort of dynamic equalization based on the FFT >analysis. But obviously I need a way to "draw" the equalizer curve and >update it even on a per sample basis so that it follow the envelopes >that I desire.
One semi-frustrating thing about the way you are posing this question is that you're asking the group to propose an algorithm, but you have already fixed part of that algorithm (FFT, analysis frames, filtering updated between and within frames). The aspects you have fixed are not necessarily compatible with your desired result. Your question may be (probably is) much simpler without these constraints. Steve
On Sunday, July 3, 2016 at 5:39:50 PM UTC+3, Steve Pope wrote:
> Matti Viljamaa <viljamaadsp@gmail.com> wrote: > > >As I tried to point outamples, > > > >I'm trying to perform filtering based on data obtained from FFT > >analysis. And I desire to have the filtering adjust between FFT analysis > >frames. Perform a sort of dynamic equalization based on the FFT > >analysis. But obviously I need a way to "draw" the equalizer curve and > >update it even on a per sample basis so that it follow the envelopes > >that I desire. > > One semi-frustrating thing about the way you are posing this > question is that you're asking the group to propose an algorithm, > but you have already fixed part of that algorithm (FFT, analysis frames, > filtering updated between and within frames). The aspects > you have fixed are not necessarily compatible with your desired > result. > > Your question may be (probably is) much simpler without these > constraints. > > Steve
But I thought that since the FFT is only used for analysis, then it isn't necessarily related to the filtering algorithm. It's merely used to "make up what to draw in the filter", but not filter per se.
On Sun, 3 Jul 2016 07:46:59 -0700 (PDT), Matti Viljamaa
<viljamaadsp@gmail.com> wrote:

>On Sunday, July 3, 2016 at 5:39:50 PM UTC+3, Steve Pope wrote: >> Matti Viljamaa <viljamaadsp@gmail.com> wrote: >> >> >As I tried to point outamples, >> > >> >I'm trying to perform filtering based on data obtained from FFT >> >analysis. And I desire to have the filtering adjust between FFT analysis >> >frames. Perform a sort of dynamic equalization based on the FFT >> >analysis. But obviously I need a way to "draw" the equalizer curve and >> >update it even on a per sample basis so that it follow the envelopes >> >that I desire. >> >> One semi-frustrating thing about the way you are posing this >> question is that you're asking the group to propose an algorithm, >> but you have already fixed part of that algorithm (FFT, analysis frames, >> filtering updated between and within frames). The aspects >> you have fixed are not necessarily compatible with your desired >> result. >> >> Your question may be (probably is) much simpler without these >> constraints. >> >> Steve > >But I thought that since the FFT is only used for analysis, then it isn't necessarily related to the filtering algorithm. It's merely used to "make up what to draw in the filter", but not filter per se.
There was a long discussion in this thread about Overlap-Add (OLA) and Overlap-Save (OLS) algorithms, which use the FFT for filtering. Typically this is done when a time-domain FIR filter requires more computation than the OLS or OLA would (e..g, the FIR is very long). If the FIR isn't so long that you need OLA or OLS, then you probably wouldn't do it and certainly don't need to. So, yeah, as Steve pointed out, you need to really assess your assumptions and sort out what you really need or don't need.
On Sunday, July 3, 2016 at 6:02:01 PM UTC+3, Eric Jacobsen wrote:
> On Sun, 3 Jul 2016 07:46:59 -0700 (PDT), Matti Viljamaa > <viljamaadsp@gmail.com> wrote: > > >On Sunday, July 3, 2016 at 5:39:50 PM UTC+3, Steve Pope wrote: > >> Matti Viljamaa <viljamaadsp@gmail.com> wrote: > >> > >> >As I tried to point outamples, > >> > > >> >I'm trying to perform filtering based on data obtained from FFT > >> >analysis. And I desire to have the filtering adjust between FFT analysis > >> >frames. Perform a sort of dynamic equalization based on the FFT > >> >analysis. But obviously I need a way to "draw" the equalizer curve and > >> >update it even on a per sample basis so that it follow the envelopes > >> >that I desire. > >> > >> One semi-frustrating thing about the way you are posing this > >> question is that you're asking the group to propose an algorithm, > >> but you have already fixed part of that algorithm (FFT, analysis frames, > >> filtering updated between and within frames). The aspects > >> you have fixed are not necessarily compatible with your desired > >> result. > >> > >> Your question may be (probably is) much simpler without these > >> constraints. > >> > >> Steve > > > >But I thought that since the FFT is only used for analysis, then it isn't necessarily related to the filtering algorithm. It's merely used to "make up what to draw in the filter", but not filter per se. > > There was a long discussion in this thread about Overlap-Add (OLA) and > Overlap-Save (OLS) algorithms, which use the FFT for filtering. > Typically this is done when a time-domain FIR filter requires more > computation than the OLS or OLA would (e..g, the FIR is very long). > If the FIR isn't so long that you need OLA or OLS, then you probably > wouldn't do it and certainly don't need to. > > So, yeah, as Steve pointed out, you need to really assess your > assumptions and sort out what you really need or don't need.
I was thinking of trying the windowing method (or frequency sampling) since they're easy methods, but have been concerned with the issues regarding that the quality may not be very good. Parks-Mccellan was said to be too computationally intensive for real-time filtering. LMS I haven't got around, because I don't understand the parameters (specifically, what should the desired signal be if I wish to adjust the input signal towards the magnitude response that I have "drawn", I've only seen noise removal examples). Then there's the filter bank approach which should be fairly simple. That one merely places a lot of filters and tries to shape the overall response by balancing their gains.
Bob Masta wrote:
> On Sat, 2 Jul 2016 14:19:40 -0500, Les Cargill > <lcargill99@comcast.com> wrote: > >> Eric Jacobsen wrote: >>> On Sat, 2 Jul 2016 02:07:47 -0700 (PDT), Matti Viljamaa >>> <viljamaadsp@gmail.com> wrote: >>> >>>> What about the windowing design method? >>>> >>>> The one where the FIR coefficients are designed by taking iFFT of a "desired magnitude response". >>> >>> Usually the windowing method is illustrated by taking an ideal desired >>> time-domain impulse response, like a sinx/x, and applying a windowing >>> function to make it practical for digital application. >>> >>>> Wouldn't this be fairly simple for this application, since then one could pretty much iFFT what the user has drawn into the GUI and there's your filter? >>> >>> As has been mentioned a few times, this doesn't work well unless >>> significant constraints are put on the frequency domain construction >>> of the sampled frequency response. Sharp transitions in the frequency >>> domain will lead to undesired effects, i.e., you can't draw an >>> "arbitrary" filter response and expect it to be realized without a lot >>> of caveats. >>> >>> >>> >>> >> >> A deeply ignernt question might be: >> >> Why is this framed in terms of FIR? Wouldn't it be "easier" to >> compose multiple IIR? >> >> There are lots of VST plugins which do this not by allowing an >> arbitrary EQ "shape" but rather by allowing a small number of >> "points" to be placed and "splining" those into a "shape". Each >> point may have a Q setting as desired >> >> At least for audio, these tend to fit the use cases of EQ better - you >> want a cut @ 4k, a shelf boost @ 100Hz, that sort of thing. An EQ I >> now use just has knobs like it was a piece of equipment. >> >> Perhaps I am answering the question I want to be asked rather >> than the question actually asked, but that's because the >> question I want asked makes more sense to me. >> >> As a general biased observation, I don't see things that do >> what the OP wants much in the wild. And indeed, a FIR of a >> composed-IIR filter would be easy enough to make, but my >> general observation is that convolution is uglier than direct IIR >> filtering for realtime processing. >> >> -- >> Les Cargill > > Since nobody has heard from the OP what he really wants, > it's hard to say. However, my own real-world application is > one example of a "drawable" FIR equalizer that can not > easily be done with conventional parametric EQs. > > The application is for auditory research, where there is > often a need for a sound chamber to deliver acoustic noise > (especially band-limited noise) that has a flat passband. > That means that the system must apply an inverse correction > for the response of the sound system. The raw system > response is easily measured, such as by driving it with a > simple flat noise source and measuring the response with a > flat-responding mic. (Flat condenser mics are easy to come > by, if expensive. Flat sound systems are not, with the > possible exception of electrostatics... which have their own > set of problems.) > > So given the arbitrary sound system response, you can easily > derive the proper driving source response to get the desired > acoustic response, That's essentially the kind of > "drawable" EQ we have been discussing, only here applied to > a flat white source instead of to (say) music program > material. Instead of manually drawing an arbitrary target > response using a bunch of sliders, etc, you get the target > reponse from your prior system response measurement. >
Yes - there have been various products which offer this as a service. It's ostensibly an RTA in the same box as a digital (usually graphic-motif) EQ.
> The beauty, of course, is that the operator doesn't have to > fiddle with controls to flatten the response by eye... it's > pretty much a turn-key system. (But see below.) > > I suppose this approach could be used in sound reinforcement > to produce flat room response, but since a real room is not > as simple as a sound exposure chamber for a box of rodents, > you'd have to decide "flat at which seats?" issues. I > vaguely recall seeing an "active" sytem describe many years > ago in the AES Journal, where they had multiple subsystems > to handle sections of a large hall, but I don't recall if > they described the EQ approach... could have been something > much simpler than we are talking about here. >
Yep. So your system is flat @ position { x, y, z } - what happens when you move your head 1/2 inch? :)
> Whether for sound exposure or room EQ, there is one caveat > that many people don't consider. This has nothing to do > with whether you use manual EQ or an automated FIR approach. > It is that you can't blithely correct for deep dips without > drastic overall power reduction. Consider a simple system > with a single power amp, and a speaker with a 12 dB dip at > frequency F. To correct for that, the EQ needs to provide a > 12 dB peak at F. That means the amp has to provide 4x the > voltage (16x power) at that frequency, which means you need > to leave that much headroom at other "flat" frequencies. >
Just so. The main problem in rooms isn't dips; it's usually peaks caused by reinforcing modes, and those can't really be handled in the frequency domain. As to your speaker with a 12dB dip - it's not that hard to find one that doesn't have that these days, what with even small drivers with low Fs and good compliance.
> Other than response flattening, I can't think of a good > real-world example that cries out for FIR-type solutions. > The OP has hinted that he has dynamic response concerns, as > though he is changing the drawn reponse rapidly in real > time. That seems to imply he is not manually drawing the > target response, but getting it from some other real-time > process.
And that is a problem that must be managed outside the filter level, IMO. That has to do with how parameter changes are evolved. In the DAW world, some filters manage this better than others, but it's generally assumed you're not gonna be rocking the center frequency of a parametric like a wah-wah pedal :) A little hash while you move things happens.
> Background MLSA on the room during a live > performance? Seems a much tougher nut to crack than the EQ > issue! > > 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
Matti Viljamaa wrote:
> As I tried to point outamples, > > I'm trying to perform filtering based on data obtained from FFT > analysis. And I desire to have the filtering adjust between FFT > analysis frames. Perform a sort of dynamic equalization based on the > FFT analysis. But obviously I need a way to "draw" the equalizer > curve and update it even on a per sample basis so that it follow the > envelopes that I desire. >
I know it's a bit frustrating, but what you're asking is akin to "I have a pipe wrench. How to I use that to get to San Francisco?" (with me being foolish with that to make a point). Well, lots of ways :) There exists a product called the dbx Driverack which has "Auto-EQ". I presume you're reimplementing something like that? -- Les Cargill
On Sunday, July 3, 2016 at 7:54:28 PM UTC+3, Les Cargill wrote:
> Matti Viljamaa wrote: > > As I tried to point outamples, > > > > I'm trying to perform filtering based on data obtained from FFT > > analysis. And I desire to have the filtering adjust between FFT > > analysis frames. Perform a sort of dynamic equalization based on the > > FFT analysis. But obviously I need a way to "draw" the equalizer > > curve and update it even on a per sample basis so that it follow the > > envelopes that I desire. > > > > I know it's a bit frustrating, but what you're asking is akin to > "I have a pipe wrench. How to I use that to get to San Francisco?" > (with me being foolish with that to make a point). > > Well, lots of ways :) > > There exists a product called the dbx Driverack which has "Auto-EQ". > I presume you're reimplementing something like that? > > -- > Les Cargill
Have a look at the second link in the very first post. Pretty close what I'm looking to do. I want to analyze a signal using FFT to get data to use for "drawing" the filter curve. Then I want to filter the signal according to that curve.
Matti Viljamaa  <viljamaadsp@gmail.com> wrote:

>Pretty close what I'm looking to do. I want to analyze a signal using >FFT to get data to use for "drawing" the filter curve. Then I want to >filter the signal according to that curve.
Why do you include the words "using FFT" in the above sentence? Steve
On Sunday, July 3, 2016 at 10:29:42 PM UTC+3, Steve Pope wrote:
> Matti Viljamaa <viljamaadsp@gmail.com> wrote: > > >Pretty close what I'm looking to do. I want to analyze a signal using > >FFT to get data to use for "drawing" the filter curve. Then I want to > >filter the signal according to that curve. > > Why do you include the words "using FFT" in the above sentence? > > Steve
Because I don't know of another way of doing spectrum analysis.