DSPRelated.com
Forums

Frequency domain (DFT) vs. (finite) impulse response

Started by Peter Mairhofer November 25, 2015
Hi,

From a physical, continuous-time system I obtain the following frequency
response by sweeping frequencies up to fs/2=100MHz:

http://snag.gy/jo8kM.jpg

To my understanding, the impulse response is given the IDTFT which is
approximately the IDFT (if the swept input signals are long enough/the
frequency resolution is sufficiently high):

http://snag.gy/weTTz.jpg
http://snag.gy/wIgmX.jpg (zoom showing first 40 samples)

It looks reasonable and physical (similar as the sampled version of an
analog lowpass filter which is the case). The next plot shows the same
but in dB20:

http://snag.gy/BDw9l.jpg

It can be seen that the response goes to "zero" after ~20 samples but
then increases again at the end!

Why is this the case? For a physical system (such as a continuous-time
Butterworth filter) I would assume a rapid decrase towards zero.

What happens if I just use the first 40 samples of h[n] and ignore the
stuff at the end? If I take again the DFT of this and compare both versions:

http://snag.gy/ilrZu.jpg

It can be seen that there is a significant difference in the frequency
response, covering all frequency range!

To confuse myself even more, I use freqz instead of fft to compare the
frequency response:

http://snag.gy/EA4JV.jpg

Now the truncated version looks more correct (smooth response, green)
and the full length version shows wiggling over all frequencies (blue).

If I test the identification (using MATLABs filter), the full version
gives the correct result while the truncated does not.

So my question is: Why do I get the wiggling at the end of the impulse
response? How to I avoid it to get a reasonable, physical behavior (h[n]
decaying to zero) that I can correct using a FIR filter?


Peter


> > So my question is: Why do I get the wiggling at the end of the impulse > response? How to I avoid it to get a reasonable, physical behavior (h[n] > decaying to zero) that I can correct using a FIR filter? > > > Peter
it may be correct. I'll give you my physical intuative view. Consider the swept freq response, it shows a notch. One way to create a notch is to add a signal and a delayed version of the same signal. A 2 term FIR if you will. So that may be what you have. THe impulse response shows the original signal and the delayed version of it. When you add them together and view the result in the freq domain, you get a notch. I could be completly wrong. Mark
Peter Mairhofer  <63832452@gmx.net> wrote:

>From a physical, continuous-time system I obtain the following frequency >response by sweeping frequencies up to fs/2=100MHz: > >http://snag.gy/jo8kM.jpg
>To my understanding, the impulse response is given the IDTFT
Not to nitpick, but there is no "the" impulse response that corresponds to a frequency response. There is an infinite class of impulse responses that will produce the same frequency response. This infinite class can be thought of as applying the class of all-pass filters to one member of the above class of impulse responses. And, although one could debate which impulse response is canonical of the class, for many purposes it is the one obtained by linear prediction. Steve
On Wed, 25 Nov 2015 15:32:13 +0000, Steve Pope wrote:

> Peter Mairhofer <63832452@gmx.net> wrote: > >>From a physical, continuous-time system I obtain the following frequency >>response by sweeping frequencies up to fs/2=100MHz: >> >>http://snag.gy/jo8kM.jpg > >>To my understanding, the impulse response is given the IDTFT > > Not to nitpick, but there is no "the" impulse response that corresponds > to a frequency response. There is an infinite class of impulse > responses that will produce the same frequency response. > > This infinite class can be thought of as applying the class of all-pass > filters to one member of the above class of impulse responses. And, > although one could debate which impulse response is canonical of the > class, for many purposes it is the one obtained by linear prediction.
That only applies if you're talking about magnitude vs. frequency. If you have magnitude & phase vs. frequency then there's just one impulse response. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
>It can be seen that the response goes to "zero" after ~20 samples but >then increases again at the end! > >Why is this the case? For a physical system (such as a continuous-time >Butterworth filter) I would assume a rapid decrase towards zero. > >What happens if I just use the first 40 samples of h[n] and ignore the >stuff at the end? If I take again the DFT of this and compare both >versions: >It can be seen that there is a significant difference in the frequency >response, covering all frequency range!
Hi Peter, When you do the DFT of a signal, you in the first half of the result the positive frequencies, and in the second half of the result the negative frequencies. So you typically use "fftshift" with SCILAB (or its MATLAB equivalent) before plotting the result of the DFT, so as to recenter the zero frequency in a more intuitive way. When you do the IDFT of a Spectrum, it is the same! E.g. you get in the first part the positive times, and in the second part, the negative times. Likewise, you can use also "fftshift" to recenter it in a more intuitive way (zero time shift at the middle of the signal). You will see then a more "natural" impulse response shape. So the impulse response that you get is totally normal, and as we can see the peak at t=0 (or t=N-1 which is about the same, because N-1 = negative time of one sample only in the past), we can conclude that your system is a zero-delay system, or more probably, that you computed the IDFT of a Spectrum with a null phase (appently you only used the frequency response in magnitude), which is equivalent! I hope you will enjoy this duality between temporal and frequency behavior! Julien PS : by the way, if you discard half of the impulse response (negative time delays) as you have done, it is totally normal that the frequency response is totally different: it introduces a big discontinuity between t=0 and t=-1 (that is N-1) by setting x[N-1] = 0. --------------------------------------- Posted through http://www.DSPRelated.com
Tim Wescott  <seemywebsite@myfooter.really> wrote:

>On Wed, 25 Nov 2015 15:32:13 +0000, Steve Pope wrote:
>> Peter Mairhofer <63832452@gmx.net> wrote:
>>>From a physical, continuous-time system I obtain the following frequency >>>response by sweeping frequencies up to fs/2=100MHz:
>>>http://snag.gy/jo8kM.jpg
>>>To my understanding, the impulse response is given the IDTFT >> >> Not to nitpick, but there is no "the" impulse response that corresponds >> to a frequency response. There is an infinite class of impulse >> responses that will produce the same frequency response.
>That only applies if you're talking about magnitude vs. frequency. If >you have magnitude & phase vs. frequency then there's just one impulse >response.
Correct. The OP provided only a magnitude response. Steve