Main Content

Impulse Response

The impulse response of a digital filter is the output arising from the unit impulse sequence defined as

δ(n)={1,n=0,0,n0.

You can generate an impulse sequence a number of ways; one straightforward way is

imp = [1; zeros(49,1)];

The impulse response of the simple filter with b=1 and a=[1-0.9] is h(n)=0.9n, which decays exponentially.

b = 1;
a = [1 -0.9];

h = filter(b,a,imp);

stem(0:49,h)

Figure contains an axes object. The axes object contains an object of type stem.

A simple way to display the impulse response is with the Filter Visualization Tool, fvtool.

fvtool(b,a)

Figure Filter Visualization Tool - Magnitude Response (dB) contains an axes object and other objects of type uitoolbar, uimenu. The axes object with title Magnitude Response (dB) contains an object of type line.

Click the Impulse Response button, [], on the toolbar, select Analysis > Impulse Response from the menu, or type the following code to obtain the exponential decay of the single-pole system.

fvtool(b,a,'Analysis','impulse')

Figure Filter Visualization Tool - Impulse Response contains an axes object and other objects of type uitoolbar, uimenu. The axes object with title Impulse Response contains an object of type stem.