mnentwig wrote:> ... Effectively, the impulse response is infinitely long,Only if the FFT is infinitely long. You sais so yourself in what I snipped.> and wraps from one cycle into the next.Wraps? What do you mean?> Needless to say, in many cases I don't have the luxury of using for > example a 16 million point FFT.And rarely will an impulse response that long be beneficial in practice.> But sometimes it -is- possible, and why should I then make my own life > more difficult? The audio example is IMO one such case, and using > overlap-and-add etc would only give worse results, because of the > finite-length impulse response.What benefit do you expect from an impulse response measured in plural minutes? Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Online · Live + on demand
February 9-11, 2027
Price goes up Jan 1: register now to lock in today's rate
Register Now →
Low pass filter
Started by ●September 12, 2007
Reply by ●September 16, 20072007-09-16
Reply by ●September 17, 20072007-09-17
On Sep 12, 4:30 am, "rob83" <roberto_gle...@hotmail.com> wrote:> Hello everybody, > > I am new to new to DSP. So if my question(s) are fundamentally wrong or > just too naive I apologize in advance. > This is the problem I have: > > I have an input array of time domain samples (4096) which I feed into an > FFT algorithm. I can compute the inverse FFT and get back my original > data. > I want to apply a low pass filter to get rid of undesired high frequency > components. When I do this (apply FFT,then an Equi-Ripple low pass filter > followed by the inverse FFT)I get a very different output. > > Should't my data go back to the time-domain after an inverse FFT (minus > the noise created by the high frequency componets? > > Regards, > RobRob, If you have a non-periodic signal, you will want to understand overlap- and-save and overlap-and-add. However, once you have that understood, test your model with a simple signal like a single frequency. Try it first by simply applying IFFT immediately after the FFT (dont' filter it yet). If that doesn't work, then you need to fixed the problem, which could be due to any number of things, such as having channels out of order or reversed. If you don't understand OLA and OLS, then you can still check out your FFT-to-IFFT like I described, but you need to use a signal that is is periodic over your FFT interval (= Number of points divided by the sample rate).
Reply by ●September 17, 20072007-09-17
Markus wrote:> >OLS/OLA are methods to implement FIR filters, not approximations. If > >you don't agree, you can start with this: > > >http://www.dspguide.com/ch9/3.htm > > Right. It implements the convolution on different segments, the > superposition principle holds, and we sum them up afterwards. Agree. > > But the maximum impulse response lenght is tied to the FFT size, right?No. Just as one breaks up the input signal in OLS/A into segements for block-processing, one can break up the impulse response into segments. I've myself used OLS to implement FIR filters with more than a million number of taps for real-time audio processing at 96kHz sampling rate (the largest FFT size was 32k).> So let's forget my bloated argument about localization in time/frequency,Good idea.> and I simply say instead "I have to design a finite length FIR filter". > > My point is: If I run a single FFT on my whole signal, I -don't- have to > "design" the filter.This is a typical mistake. If you want to modify every single FFT coefficient of your signal, it follows that you may only advance the frame by one single sample for each segment of processing if you want to avoid time-domain aliasing (because of the N=M+L-1 formula). This means that your filter's impulse response is just the inverse FFT of the multipliers you use in the frequency domain. This is one way to "design" FIR filters. However, it introduces a lot of ripple in the frequency domain, which could easily be overcome using a shorter filter (for example using windowing).> I simply evaluate the desired frequency response at > the resulting frequencies, and that's it. Effectively, the impulse > response is infinitely long, and wraps from one cycle into the next.No, the impulse response has finite length - it is no longer than the length of the FFT that you are using.> Needless to say, in many cases I don't have the luxury of using for > example a 16 million point FFT. > But sometimes it -is- possible, and why should I then make my own life > more difficult? The audio example is IMO one such case, and using > overlap-and-add etc would only give worse results, because of the > finite-length impulse response.Markus, I'm sorry to say but the above paragraph is nonsense.> As you suggested, I might cook up an example program for FFT-convolution > one day. But probably somebody has done the work already.I think it would be another good idea.> > Best Regards > > MarkusRegards, Andor
Reply by ●September 17, 20072007-09-17
Gentlemen, it seems we are not "converging" with this discussion, so we may have hit on something. So I'll do my "homework", write some code and post the results for discussion. It may take a couple of days, though, the working week just started. But I do hold up the claim that the "simple" FFT/ apply frequency response/IFFT method is ideal, when my filter is specified in the frequency domain and the signal is cyclic: There is no ripple in the frequency domain, the frequency response is _exactly_ as specified: The signal has only energy at some specific frequencies, since it's periodic, and I don't care about the in-between. If I would use the unwrapped impulse response in a non-cyclic filter, then there would be frequency domain ringing, because suddenly there is energy between the former "frequency bins".> No, the impulse response has finite length - it is no longer than thelength of the FFT that you are using. Well, the impulse response of an equivalent non-cyclic filter would be infinitely long. For the cyclic filter, the tails wrap around. The last paragraph in the reference http://www.dspguide.com/ch9/3.htm discusses this.>> I've myself used OLS to implement FIR filters with more than a millionnumber of taps for real-time audio processing And I'm using the simple-and-stupid FFT-and-back method regularly in the lab to create cyclic IQ data streams for radio frequency testing, with some millions of complex samples. On the spectrum analyzer, the spectrum is sharp like cake cut with a knife, all the way down to the instrument noisefloor. Time-domain ringing and intersymbol interference, that's another issue altogether :) Cheers Markus
Reply by ●September 17, 20072007-09-17
Markus wrote:> Gentlemen, > > it seems we are not "converging" with this discussion, so we may have hit > on something. > So I'll do my "homework", write some code and post the results for > discussion. > It may take a couple of days, though, the working week just started. > > But I do hold up the claim that the "simple" FFT/ apply frequency > response/IFFT method is ideal, when my filter is specified in the > frequency domain and the signal is cyclic: > There is no ripple in the frequency domain, the frequency response is > _exactly_ as specified: > The signal has only energy at some specific frequencies, since it's > periodic, and I don't care about the in-between.Clearly. What you are doing is to simply adjust the coefficients of the Fourier sum (not series) of a periodic bandlimited signal.> If I would use the unwrapped impulse response in a non-cyclic filter, then > there would be frequency domain ringing, because suddenly there is energy > between the former "frequency bins". > > > No, the impulse response has finite length - it is no longer than the > > length of the FFT that you are using. > > Well, the impulse response of an equivalent non-cyclic filter would be > infinitely long. For the cyclic filter, the tails wrap around. > The last paragraph in the referencehttp://www.dspguide.com/ch9/3.htm > discusses this. > > >> I've myself used OLS to implement FIR filters with more than a million > > number of taps for real-time audio processing > And I'm using the simple-and-stupid FFT-and-back method regularly in theI didn't mean to compare notes. It was a counter-example to your idea that the filter impulse length was related to the size of the FFT.> lab to create cyclic IQ data streams for radio frequency testing, with > some millions of complex samples.Couldn't you just use a bunch of oscillators? The FFT/IFFT approach seems somewhat roundabout, and the number of harmonics is always bound by the length of the test signal ...> On the spectrum analyzer, the spectrum is sharp like cake cut with a > knife, all the way down to the instrument noisefloor.That's because you don't have any input signal in between the bins: 0 in, 0 out.> Time-domain ringing and intersymbol interference, that's another issue > altogether :) > > Cheers > > MarkusRegards, Andor
Reply by ●September 17, 20072007-09-17
>Clearly. What you are doing is to simply adjust the coefficients of >the Fourier sum (not series) of a periodic bandlimited signal.Yes. This may be just what I want, and the audio signal is already bandlimited. Now if the customer asks for an 'ideal lowpass filter' I'll say "sure I can do that, but you'll have to set the CD player to 'repeat one track' mode afterwards :) The idea is ridiculous for audio, but the arbitrary-waveform generator in the RF lab is built for that particular job.>I didn't mean to compare notes. It was a counter-example to your idea >that the filter impulse length was related to the size of the FFT.OK, I got that. Probably I can split the impulse response into a sum of segments, and use distributivity (a+b) * (c+d) = a*c + a*d + b*c + b*d? Anyway, I'm going to figure it out, I found references for example here: http://www.ludd.luth.se/~torger/brutefir.html>That's because you don't have any input signal in between the bins: 0 >in, 0 out.Yes. Cheers Markus
Reply by ●September 17, 20072007-09-17
Markus wrote:> >I didn't mean to compare notes. It was a counter-example to your idea > >that the filter impulse length was related to the size of the FFT. > > OK, I got that. > Probably I can split the impulse response into a sum of segments, and use > distributivity (a+b) * (c+d) = a*c + a*d + b*c + b*d?It's even simpler than that. You can break up the impulse response h into two parts, h1 and h2. Let's say the length of h is N, and the length of h1 is N1 < N. Then convolution by h is the same thing as convolving with (h1 + z^-N1 h2), ie. you have y = x * h = x * (h1 + z^-N1 h2) = (x * h1) + z^-N1 (x * h2)> Anyway, I'm going to figure it out, I found references for example > here: http://www.ludd.luth.se/~torger/brutefir.htmlYes, good starting point.> > >That's because you don't have any input signal in between the bins: 0 > >in, 0 out. > > Yes. > > Cheers > > MarkusRegards, Andor
Reply by ●September 17, 20072007-09-17
rob83 wrote:> Hello everybody, > > I am new to new to DSP. So if my question(s) are fundamentally wrong or > just too naive I apologize in advance. > This is the problem I have: > > I have an input array of time domain samples (4096) which I feed into an > FFT algorithm. I can compute the inverse FFT and get back my original > data. > I want to apply a low pass filter to get rid of undesired high frequency > components. When I do this (apply FFT,then an Equi-Ripple low pass filter > followed by the inverse FFT)I get a very different output. > > Should't my data go back to the time-domain after an inverse FFT (minus > the noise created by the high frequency componets?Did you figure out yet that equiripple filters are applied in the time domain directly? To filter in the frequency domain, you need to implement overlap-add or overlap-save and multiply by a realizable frequency mask. That mask is calculated by taking the FFT of a realizable time-domain filter's impulse response. Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯







