<< Chapter < Page | Chapter >> Page > |
For the FFT method, the two vectors (input and convolution)
must both have length
N+M-1
.
The raw output has complex values due to numerical roundoff, andthe command
real
is used to strip away the imaginary parts.
Thus, the FFT based method requires more M
atlab commands to implement.
Observe also that
conv(h,x)
and
conv(x,h)
are the same, whereas
filter(h,1,x)
is not the same as
filter(x,1,h)
.
To view the frequency response of the filter
h
, M
atlab provides the command
freqz
, which automatically
zero pads
By default, the M
atlab command
freqz
creates a length 512 vector containing the specified impulse response
followed by zeros. The FFT of this elongated vector is used forthe magnitude and phase plots, giving the plots a smoother
appearance than when taking the FFT of the raw impulse response. the impulse response and then plots both the magnitude and the phase. Type
freqz(h)
to see that the filter with impulse response
h=[1, 1, 1, 1, 1]
is a (poor) lowpass filter with two dips at 0.4 and
0.8 of the Nyquist frequency as shown in
[link] .
The command
freqz
always normalizes the frequency axis
so that “1.0” corresponds to the Nyquist frequency
.
The passband of this filter(all frequencies less than the point where the magnitude drops
3 dB below the maximum) ends just below
. The maximum magnitude in
the stopband occurs at about
, where it is about
12 dB down from the peak at zero.Better (i.e., closer to the ideal) lowpass filters
would attenuate more in the stopband,would be flatter across the passband,
and would have narrower transition bands.
At first glance it might seem counterintuitive that a useful filter could have an impulse response that isinfinitely long. To see how this infiniteness might arise in a specific case,suppose that the output of a LTI system is created from the input according to the formula
where and are constants. This is shown in the top part of [link] , where the time delay between successive terms(between and for instance) is represented by . This is an example of the -transform. If the initial value is , the response of the system [link] to an impulse (where is the discrete impulse function [link] ) is
If , this impulse response increases towards infinity and the system is said to be unstable. If , the values in the sequence die away towards (but never quite reaching) zero,and the system is stable. In both cases, the impulse response is infinitely long and so the system [link] is IIR. The special case when is called a summer (or, in analogy with continuous time, an integrator ) because sums up all the inputs. The summer is oftenrepresented symbolically as in the lower part of [link] .
Notification Switch
Would you like to follow the 'Software receiver design' conversation and receive update notifications?