# Truncating a measured impulse response

Started by December 15, 2011
```Hi,
I have measured the impulse response of a plant using an MLS sequence. I
now have a nice 1.3ms (130k points!) long impulse response, for which I can
take the FFT and see the frequency response.

The impulse response vanishes to almost zero after about 1024 samples. In
fact, if I simply truncate it to 1024 samples, I get an identical frequency
response. However, if I start truncating to less than 1024 samples, I do
see artifacts, so I guess windowing the impulse response would be better.

How are windows specified in this case? It definitely can't be to generate
say a 512 points hanning window and weighting the first 512 points of my
impulse response with it. This would be attenuating most of the important
information!
I guess the window should only be applied to the 'tail' of my impulse
response, whereas the beginning would be unity.

Is there a standard way to do this and specify it?

Thanks!
```
```On 15 Des, 15:05, "gretzteam" <gretzteam@n_o_s_p_a_m.yahoo.com> wrote:
> Hi,
> I have measured the impulse response of a plant using an MLS sequence. I
> now have a nice 1.3ms (130k points!) long impulse response, for which I can
> take the FFT and see the frequency response.

Yes, you *can*. But do you *need* to?

> The impulse response vanishes to almost zero after about 1024 samples. In
> fact, if I simply truncate it to 1024 samples, I get an identical frequency
> response. However, if I start truncating to less than 1024 samples, I do
> see artifacts, so I guess windowing the impulse response would be better.

No. If you have N significant data points,
you *don't* truncate to less than N points.
No amount of windowing will correct for
missing data points.

> How are windows specified in this case? It definitely can't be to generate
> say a 512 points hanning window and weighting the first 512 points of my
> impulse response with it. This would be attenuating most of the important
> information!

Why do you want to window? What are you attempting
to achieve? If the IP is the goal, why mess around
in frequency domain?

What, if anything, do you attempt to achieve by
the DFT? Answering that question first, will go
a long way to find out what, if any, window to
apply.

> I guess the window should only be applied to the 'tail' of my impulse
> response, whereas the beginning would be unity.
>
> Is there a standard way to do this and specify it?

Do you attempt to meet a standard spec? If so, you need
to look up that spec and see what to do.

Rune
```
```>
>No. If you have N significant data points,
>you *don't* truncate to less than N points.
>No amount of windowing will correct for
>missing data points.

Very true. Thanks making it obvious!

>
>Why do you want to window? What are you attempting
>to achieve? If the IP is the goal, why mess around
>in frequency domain?
>
>What, if anything, do you attempt to achieve by
>the DFT? Answering that question first, will go
>a long way to find out what, if any, window to
>apply.

Well I guess I'm chasing two things at the same time, both having different
requirements:

-First I want to get a good frequency domain representation so I can play
with classical control design and get a controller working. This way I also
what you are saying is that for this step, I could simple take the FFT of
the whole data set...

-Second I would like to come up with a parametric model for the plant and
see what I can achieve with the state-space 'modern' control design, while
learning about them at the same time.

Dave

```
```try a raised-cosine window that fades only the last samples smoothly to
zero.
Then widen it, until the error at high frequencies is tolerable.

This is just "a" possible solution, not "the" best one.

If you need a finite-length impulse response that accurately models the
frequency response with best accuracy in some defined frequency region(s),
you can use this program:
http://www.dsprelated.com/showcode/210.php

Relevant sections: demo("componentmodel") and demo("componentmodel2").
As nominal frequency response, use the FFT of the "long" impulse response.
This should give better results for a given IR length than windowing, but
most likely it's "overkill".
```
```>> First I want to get a good frequency domain representation

well, for that I see no need to truncate the impulse response in the first
place. Simply record as many samples as you like, and use FFT. The more
samples you put in (including artificial zero-padding), the smaller the
frequency spacing of the result. 100M points is no big deal on a modern PC,
and the length does NOT need to be a power of two.

The FFT output is the frequency response, as in a Bode plot (Matlab's
"unwrap" comes in handy for the phase). Interpolate as needed.
```
```On Thu, 15 Dec 2011 08:29:20 -0600, gretzteam wrote:

>>No. If you have N significant data points, you *don't* truncate to less
>>than N points. No amount of windowing will correct for missing data
>>points.
>
> Very true. Thanks making it obvious!
>
>
>>Why do you want to window? What are you attempting to achieve? If the IP
>>is the goal, why mess around in frequency domain?
>>
>>What, if anything, do you attempt to achieve by the DFT? Answering that
>>question first, will go a long way to find out what, if any, window to
>>apply.
>
> Well I guess I'm chasing two things at the same time, both having
> different requirements:
>
> -First I want to get a good frequency domain representation so I can
> play with classical control design and get a controller working. This
> design. I guess what you are saying is that for this step, I could
> simple take the FFT of the whole data set...
>
> -Second I would like to come up with a parametric model for the plant
> and see what I can achieve with the state-space 'modern' control design,
> while learning about them at the same time.

I doubt that taking the FFT of the impulse response will give you a
really good frequency-domain representation: you'll end up with lots of
good detail where the plant response happens to be strong, and not-so-
good detail where the plant response is low.  If you then want a nice
quick loop that closes at a significantly higher frequency than the
plant's natural bandwidth, you'll find that information about phase
shifts &c. was swamped out by noise in your initial measurement, and your
system design won't 'go'.

Do frequency sweeps.  It gets the data you need, and insures that you
have the detail where you need it.

The data that you've collected will be OK for getting the parametric
information, but the same comments as to lack of detail at the
frequencies where you want to close the loop still applies.  Getting a
measurement of the plant response to random data with a good high-
frequency content will help.

--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com
```
```On Dec 15, 6:05&#4294967295;am, "gretzteam" <gretzteam@n_o_s_p_a_m.yahoo.com>
wrote:
> Hi,
> I have measured the impulse response of a plant using an MLS sequence. I
> now have a nice 1.3ms (130k points!) long impulse response, for which I can
> take the FFT and see the frequency response.
>...
> How are windows specified in this case? It definitely can't be to generate
> say a 512 points hanning window and weighting the first 512 points of my
> impulse response with it. This would be attenuating most of the important
> information!
> I guess the window should only be applied to the 'tail' of my impulse
> response, whereas the beginning would be unity.
>
> Is there a standard way to do this and specify it?
>
> Thanks!

When analyzing impulse responses it is common to use the exponential
window or windows constructed from half a conventional window
response. If the signal outside the strong impulse response has a low
noise level, you may find the rectangular window satisfactory.

For the exponential window and a discussion of the potential results
of impulse windowing see:

Dale B. Dalrymple
```
```>
>When analyzing impulse responses it is common to use the exponential
>window or windows constructed from half a conventional window
>response. If the signal outside the strong impulse response has a low
>noise level, you may find the rectangular window satisfactory.
>
>For the exponential window and a discussion of the potential results
>of impulse windowing see:
>9C%ED%95%99%EC%88%A0%EC%A7%80_0054.pdf
>
>Dale B. Dalrymple
>

Hi,
The link to this paper doesn't work. Do you have the title so I can google
for it?

Tim:
I went back to the lab and re-measured everything using an exponential sine
sweep, and with a long set of discrete frequency. I didn't really see any
*visible* difference in the exponential sweep and MLS, but I haven't
analyzed the data yet.
The data coming from the tons of discrete frequency is similar too, but it
seems like I would need a lot more points to really see what is going on
with the phase - the unwrapping part isn't so obvious.

Thanks!
Dave
```
```On Dec 16, 4:32&#4294967295;am, "gretzteam" <gretzteam@n_o_s_p_a_m.yahoo.com>
wrote:

> >For the exponential window and a discussion of the potential results
> >of impulse windowing see:
> >9C%ED%95%99%EC%88%A0%EC%A7%80_0054.pdf
>
> >Dale B. Dalrymple
>
> Hi,
> The link to this paper doesn't work. Do you have the title so I can google
> for it?
>

The link just worked for me with Firefox. Be sure your browser uses
the whole link, cut and paste if necessary.

Unbiased expression of FRF with exponential window
function in impact hammer testing
Se Jin Ahn, Weui Bong Jeong*, Wan Suk Yoo
Journal of Sound and Vibration 277 (2004) 931&#4294967295;941

Dale B. Dalrymple

```