DSPRelated.com
Forums
Online · Live + on demand
February 9-11, 2027
Price goes up Jan 1: register now to lock in today's rate
Register Now →

Converting symmetrical FIR Impulse to non-symmetrical ?

Started by elhardt ●August 3, 2008
glen herrmannsfeldt wrote:
> Jerry Avins wrote: >> Tim Wescott wrote: > (snip) > >>> How do analog graphics equalizers handle this problem? > >> I'm not sure. I imagine that they aren't as sharp as users would like >> to imagine. Using analog circuits developed for speaker crossovers >> might work just fine. I'd need to play around with IIR filters to see >> if O could make them work. I smell a chance below fs/4. > > There is a design by Motorola for a graphic equalizer for > the 56001. (Yes, that old.) I believe it is available on > the web. I don't remember how fast it is. I believe it is > 10 band, which would be about an octave each. > > -- glen >
But unless it's designed for live use then it won't match the OP's needs. I was asking about analog circuits on the presumption that they would be closer to minimum phase, or at least lower delay. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" gives you just what it says. See details at http://www.wescottdesign.com/actfes/actfes.html
Thanks for the responses. I'll have to look up the Hilbert Transform thing
that was mentioned to see if that can solve my problem.

As for the shift in talk to standard analog EQ's, that's not what I'm
trying to accomplish.  Mine is currently a 48 band raised cosine filter
bank.  That's 46 bandpass filters, plus low and hi, that fit together
perfectly.  Each band can cut/boost over the entire 96dB range of 16bit
audio. Rane, Behringer, and Lake Audio have raised cosine EQ's that work in
realtime.  I sent an impulse through the Behringer, and just as I thought,
it's not symmetrical.  They may have shaped IIR filters to approximate a
raised cosine type filter bank since their filters are a little sloppy
looking compared to how mine look (or how CoolEdit Pro's Graphic EQ's
look).  I also need to go to 95 bands and maybe even just free-form drawing
of random frequency plots like an FFT filter can do.  The reason for going
the FIR route is because I can do any number of bands, any shape, and even
recalculate my FFT bins on the fly and get changing animated shapes and
filter bank sweeps.  Phase shift is not important to me, just the shape of
the filter and final result.  Only the single problem of shaping a FIR
impulse to look like that of an IIR stands in my way of real-time use.

The other potential route, is to continue doing it in the frequency domain
as I currently am.  I haven't confirmed this yet, but I believe I can pull
off smaller chunks of samples, say 512, window that, then zero pad it out
to 16384.  That will give me the resolution I need in the FFT bins.  I then
do the filtering, then drop all the unused zero padding.  The problem is,
the number of FFT's I have to do goes way up, ending in I believe more
computations than the FIR method.  FIR filtering seems to be the easier and
simpler way to go.

-Elhardt


On 4 Aug, 13:21, Greg Berchin <gberc...@sentientscience.com> wrote:
> elhardt wrote: > > I want to convert a non-realtime audio filter bank I wrote into one that > > works in realtime with low enough latency as not to be noticed when playing > > intruments through it. &#4294967295;That usually means no more than about 10 ms. > > ... > > What I'd like to do is convert that impulse into > > something more like that of an IIR where the initial spike (don't know what > > else to call it) is at the front and the trailing ripples come after that. > > The question is how? &#4294967295;Can I do this with the impulse file itself, or do I > > mess around with the phases in the bins before I do the inverse FFT? > > The impulse response of a minimum-phase system concentrates the > greatest energy in the earliest time period. &#4294967295;Oppenheim & Shafer > describe a method to create a minimum phase system from its magnitude > response, (pg 357 of "Digital Signal Processing", 1975), but it's not > easy. &#4294967295;
Interestingly, it seems the HT relation between log magnitude and phase only applies for the DTFT, i.e. for data sequences of infinite length. O&S [1975] p 357: "For the [DFT] it is *not* [my emphasis] possible in general to develop a parallel notion by which the log magnitude and phase of the DFT can be related." Then they go on to describe a method based on the DFT for which "The real part of the result is log|H(k)|, and the imaginary part is an *approximation* [my emphasis] to the minimum phase." Rune
On 3 Aug, 21:28, Tim Wescott wrote:
>elhardt wrote: >> I want to convert a non-realtime audio filter bank I wrote into one that >> works in realtime with low enough latency as not to be noticed when playing >> intruments through it. &#4294967295;That usually means no more than about 10 ms. > >I'm sure there's a clever way to do this with FIR filters. >What you want is a minimum phase FIR filter;
Looking around to refresh my memory on the properties of Hilbert transforms, I came across this page: http://sepwww.stanford.edu/sep/prof/pvi/spec/paper_html/node8.html which talks about finding a minimum-phase wavelet for a given spectrum, by Kolmogoroff factorization. I haven't read through it closely, but it does mention that the algorithm has trouble with spectra which go to zero amplitude *anywhere*, which might make it unsuitable for the OP's application. -- Wim Lewis <wiml@hhhh.org>, Seattle, WA, USA. PGP keyID 27F772C1
To Wim Lewis, the links you gave don't seem to work.  I just get "Page Not
Found" messages.

I don't necessarily need to go completely to a zero amplitude level.  I
could probably get away with going to about -80dB, so it might work. 
However, if the math gets too involved to be done in real-time to change
the filter on the fly, that won't be good.

When I get a chance, I'm going to try to play around with the phases in my
FFT bins, like adjusting them to a sawtooth pattern, just to see what I
get, and see and hear how it sounds compared to them all set to zero as
they currently are.  If all else fails, I'll have to consider doing all the
filtering in the frequency domain using the zero padding method I mentioned
above.

Thanks for the responses.

-Elhardt

On Aug 3, 6:49&#4294967295;am, "elhardt" <elha...@att.net> wrote:
> I want to convert a non-realtime audio filter bank I wrote into one that > works in realtime with low enough latency as not to be noticed when playing > intruments through it. &#4294967295;That usually means no more than about 10 ms. > > Currently the taps in my FIR filter are computed from an inverse FFT where > I've set the bins to whatever freq response I want. &#4294967295;From that I get an > impulse of 2x the number of bins. &#4294967295;This produces a symmetrical impulse (or > at least after I shift it into the proper position). &#4294967295;I'm currently working > with 8192 bins, which gives me an impulse of 16384, where the main spike > portion is of course near the center, about 8192 samples in. &#4294967295;If I'm > correct, that means I'm probably going to hear about a 185 ms delay between > input vs output. &#4294967295;What I'd like to do is convert that impulse into > something more like that of an IIR where the initial spike (don't know what > else to call it) is at the front and the trailing ripples come after that. > The question is how? &#4294967295;Can I do this with the impulse file itself, or do I > mess around with the phases in the bins before I do the inverse FFT?
You can use cepstral methods to convert a linear phase FIR filter into a FIR filter that's a very close approximation to minimum phase in many cases (for reasonable definitions of "close"). You do need to tweak your impulse response a bit so that you don't end up trying to take the log of an exact zero. Here's one cepstral recipe from the music-dsp list: http://www.music.columbia.edu/pipermail/music-dsp/2004-February/059372.html . IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M http://www.nicholson.com/rhn/dsp.html
Ron N wrote:

> Here's one cepstral recipe from the music-dsp list:
Looks to be the same as the method that I mentioned earlier. No surprise there, as it's derived from the same source. Again, watch out for aliasing of ln|magnitude|. Greg
On 8 Aug, 17:13, Ron N <ron.nichol...@gmail.com> wrote:

> Here's one cepstral recipe from the music-dsp list:
http://www.music.columbia.edu/pipermail/music-dsp/2004-February/059372.html Does that link work properly? I just get 'unable to open page' errors. Rune
Rune Allnor wrote:

> Does that link work properly? I just get 'unable to open page' > errors.
Worked for me earlier, but doesn't now. Probably just a temporary glitch.
On 8 Aug, 20:35, Greg Berchin <gberc...@sentientscience.com> wrote:
> Rune Allnor wrote: > > Does that link work properly? I just get 'unable to open page' > > errors. > > Worked for me earlier, but doesn't now. &#4294967295;Probably just a temporary > glitch.
It was. Downloaded the code. It works. Rune