DSPRelated.com
Forums

Techniques behind arbitrary response or "drawable" equalizers?

Started by Unknown June 14, 2016
On Mon, 4 Jul 2016 18:28:36 -0700 (PDT), radams2000@gmail.com wrote:

>Here's an interesting experiment related to this thread. Feed an audio sign= >al into a windowed fft with 50% overlap. Take the magnitude of each bin and= > apply each bin magnitude value to a peak detector with an adjustable expon= >ential decay rate.=20 >In parallel, feed white noise into a 2nd fft bank, and apply the peak detec= >tor values from the first fft bank as gain factors to each bin of the 2nd f= >ft bank.=20 >Then inverse fft the 2nd bank, convert back to stream, and add this to the = >original input.=20 >What you get is a pretty decent-sounding reverberator where the reverb "tai= >l" is 100% fake. The ear recognizes that the spectrum of the tail is the sa= >me as the spectrum of the direct signal, and it fuses them together into a = >single sound. You can make the tail as long as you want by changing the de= >cay time constant of the peak detector. >All sorts of improvements can be made including frequency-dependant time co= >nstants and adding early reflections.=20 >This may not make the best reverb but it's interesting how the ear can be f= >ooled.=20 > >Bob
That's pretty cool. Makes sense, too.
On Monday, July 4, 2016 at 5:38:26 PM UTC+3, Bob Masta wrote:
> On Sun, 3 Jul 2016 07:28:09 -0700 (PDT), 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. A= > >nd I desire to have the filtering adjust between FFT analysis frames. Perfo= > >rm 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 samp= > >le basis so that it follow the envelopes that I desire. > > Ahh, sounds like you want a "channel vocoder" or just plain > "vocoder" (not to be confused with a "phase vocoder").
Well I think there was a mention of filter banks as an easy option. I just don't know if there's something better. Or how filter banks compare to, say, Parks-Mccellan, in efficiency or performance. I've heard that filter banks may have phase issues between the bands. Is this an issue?
On Monday, July 4, 2016 at 5:38:26 PM UTC+3, Bob Masta wrote:
> On Sun, 3 Jul 2016 07:28:09 -0700 (PDT), 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. A= > >nd I desire to have the filtering adjust between FFT analysis frames. Perfo= > >rm 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 samp= > >le basis so that it follow the envelopes that I desire. > > Ahh, sounds like you want a "channel vocoder" or just plain > "vocoder" (not to be confused with a "phase vocoder").
Well I think there was a mention of filter banks as an easy option. I just don't know if there's something better. Or how filter banks compare to, say, Parks-Mccellan, in efficiency or performance. I've heard that filter banks may have phase issues between the bands. Or perhaps there's some undesired loss of energy between the bands? Is this an issue?
On 5.7.16 08:57, Matti Viljamaa wrote:
> On Monday, July 4, 2016 at 5:38:26 PM UTC+3, Bob Masta wrote: >> On Sun, 3 Jul 2016 07:28:09 -0700 (PDT), 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. A= >>> nd I desire to have the filtering adjust between FFT analysis frames. Perfo= >>> rm 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 samp= >>> le basis so that it follow the envelopes that I desire. >> >> Ahh, sounds like you want a "channel vocoder" or just plain >> "vocoder" (not to be confused with a "phase vocoder"). > > > Well I think there was a mention of filter banks as an easy option. I just don't know if there's something better. Or how filter banks compare to, say, Parks-Mccellan, in efficiency or performance. > > I've heard that filter banks may have phase issues between the bands. Or perhaps there's some undesired loss of energy between the bands? Is this an issue? >
Google for 'Cross-over filter'. -- -TV
Matti Viljamaa  <viljamaadsp@gmail.com> wrote:

>I've heard that filter banks may have phase issues between the bands. Or >perhaps there's some undesired loss of energy between the bands? Is this >an issue?
Back in pure-analog days, some designers liked to place the component filters of a filter bank (graphic or parametric) in parallel rather than in series, out of concern that noise would build up in the series arrangement. You could in fact get strange phasing effects as you summed the individual filters. S.
I think RBJ did a good job of summarizing all the steps you need to go through in order to make fft based approaches equivalent to a linear FIR filter. One topic that often gets overlooked is alias cancellation. You have to remember that when you are using the STFT with a hop size larger than 1, you are sub-sampling the signal , and the aliases created by that sub-sampling only cancel out in the reconstruction when certain specific conditions are met. One condition is that the window used in the STFT must add to unity when shifted and overlapped. The other is that the modifications that you make in the frequency domain must meet the rules that RBJ outlined. 

It can be a bit confusing because aliasing can refer to both errors in the frequency response ("I didn't get what I drew") or in the signal spectrum (" I'm getting extra frequencies that were not in the input signal "). The second type is more problematic because the extra frequencies are not harmonically related to the input frequency and are therefore more audible. 
One other note of caution is that if you are using large fft sizes to get very high frequency resolution, you don't want linear phase because the pre-ringing can be very audible. It's possible to impose min-phase conditions with some extra processing. 
So at the end of the day, if you are dragging a cursor around some fancy GUI to draw a curve, and want real-time EQ changes, there's a lot of number crunching you need to do in real time in order to meet all the conditions above. Which is why a digital version of the good old fashioned graphic EQ from 1965 is not such a bad way to go. You could even juice it up by digitally modeling all the band-to-band interactions and compensating the per-band gain settings  to achieve the goal of  "what you draw is what you get".  IMHO constant-Q equalizers match human hearing better than linear-spaced equalizers based on fft filter-banks, and have the added benefit that they don't let you draw curves that result in audible time-domain artifacts. 


Bob
On Mon, 4 Jul 2016 10:31:44 -0500, Les Cargill
<lcargill99@comcast.com> wrote:

>Bob Masta wrote: >> On Sun, 3 Jul 2016 11:50:45 -0500, Les Cargill >> <lcargill99@comcast.com> wrote: >> >>> Bob Masta wrote: >> >> >> <snipped for brevity> >> >>>> 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. >> >> No doubt true over most of the human audio range. The >> problem for auditory research is that most of it is done on >> rodents, which hear well above 20 kHz. It's not unusual to >> need a flat octave centered at 20 kHz or more, for example. > > >Yeah, I dunno about all that. LPFing most audio @ 10k doesn't >damage it all that much for casual listening. > >> Tweeters tend to have terrible dips at their upper ends. > >But there's generally little up there. It could matter a lot but >it often doesn't - perceptually, the top octave is the least >important. > >> This is compounded by the problem of finding *loud* >> tweeters, since typical research noise exposures are for >> studying high-frequency hearing loss or tinnitus origins >> and/or treatments. To evaluate the efficacy of a treatment, >> you need to be able to produce uniform groups of animals >> with the same loss or tinnitus symptoms, then apply your >> treatment to half and compare. >> > > >I can't say I understand why anyone would consider animals valid test >subjects for evaluations of things related to human hearing.
First of all, because there really isn't any choice. You can't ethically experiment on humans, especially those that involve deliberately inducing hearing loss. The reason the experiements are valid is because there are overall similarities among all mammalian cochleas, regarding things like the structure of the basilar membrane, the arrangements of inner and outer cells, and their neural connections. They operate on the same principles, and are sensitive to the same drugs and sources of trauma. You can measure animal hearing using evoked potentials (where you give a brief tone burst at a certain loudness and frequency, and measure the EEG response from simple scalp electrodes by averaging 1000s of presentations), and tell if they have had a hearing loss due to a loud sound exposure, and you can map out the frequency regions and extent of the loss. (The same procedure can be used in babies and people in comas.) Rodents, in particular, are excellent candidates for this work because their cochleas are encased in a thin eggshell-like structure call the 'bulla', whereas human (primate) cochleas are embedded in a solid 0.25 inch of temporal bone. So you can surgically reach the cochlea, including the hair cells, to insert measurement electrodes, drug-delivery pipettes, or fiber optics to measure blood flow or observe vibration patterns. Virtually all progress in hearing research has come from animal experiments, including development of the cohlear prosthesis. One thing that is happening now is work on regenerating damaged hair cells. It has been known for a long time that this happens in birds and reptiles, so researchers began to examine the molecular biology to see why it doesn't seem to happen in mammals, and how to induce it. Last I heard there were some promising approaches, but don't give up your hearing protectors just yet! 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 Mon, 4 Jul 2016 22:49:39 -0700 (PDT), Matti Viljamaa
<viljamaadsp@gmail.com> wrote:

>On Monday, July 4, 2016 at 5:38:26 PM UTC+3, Bob Masta wrote: >> On Sun, 3 Jul 2016 07:28:09 -0700 (PDT), 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. A= >> >nd I desire to have the filtering adjust between FFT analysis frames. Perfo= >> >rm 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 samp= >> >le basis so that it follow the envelopes that I desire. >> >> Ahh, sounds like you want a "channel vocoder" or just plain >> "vocoder" (not to be confused with a "phase vocoder"). > >Well I think there was a mention of filter banks as an easy option. I just don't know if there's something better. Or how filter banks compare to, say, Parks-Mccellan, in efficiency or performance. > >I've heard that filter banks may have phase issues between the bands. Is this an issue?
Have you searched for "vocoders"? Are they not *exactly* what you are looking for? (If not, please explain.) If "phase issues" are a problem for vocoders, wouldn't you expect that this would be mentioned somewhere? If you think that your project is sufficiently different that these problems may arise for you but not others, you need to explain what's different about your project. 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 Monday, July 4, 2016 at 4:06:52 PM UTC-4, Steve Pope wrote:
> Matti Viljamaa <viljamaadsp@gmail.com> wrote: > > >On Sunday, July 3, 2016 at 10:29:42 PM UTC+3, Steve Pope wrote: > > >> Why do you include the words "using FFT" in the above sentence? > > >Because I don't know of another way of doing spectrum analysis. > > Okay, so you're not so much disinterested in solutions that > do not include an FFT, as you are of the belief that most > or all viable solutions will include an FFT. > > Fair enough. > > Steve
I think the OP is saying that FFT is used to obtain the measurement data that creates the desired filter response goal. I think he is not placing _any_ limitations on how the filter obtains that response goal. M
On 5.7.16 16:25, makolber@yahoo.com wrote:
> On Monday, July 4, 2016 at 4:06:52 PM UTC-4, Steve Pope wrote: >> Matti Viljamaa <viljamaadsp@gmail.com> wrote: >> >>> On Sunday, July 3, 2016 at 10:29:42 PM UTC+3, Steve Pope wrote: >> >>>> Why do you include the words "using FFT" in the above sentence? >> >>> Because I don't know of another way of doing spectrum analysis. >> >> Okay, so you're not so much disinterested in solutions that >> do not include an FFT, as you are of the belief that most >> or all viable solutions will include an FFT. >> >> Fair enough. >> >> Steve > > I think the OP is saying that FFT is used to obtain the measurement data that creates the desired filter response goal. > > I think he is not placing _any_ limitations on how the filter obtains that response goal. > > M
It would also be nice to know if he's looking for a filter matching the measured spectrum, or if the target is a filter to compensate for the measured spectrum. -- -TV