Digital Signal Processing Reference
In-Depth Information
B = 0 :-1: -length(Imp)+1; zvec = [z.ˆB];
and then the z -transform for index A (i.e., at radian frequency π(A
1 )/SR ) is obtained by multiplying
zvec with the impulse response (i.e., obtaining the correlation between the impulse response and the
complex correlator generated by the negative power sequence of z )
zXform(A) = sum(Imp.*zvec); end
The above uses values of z all around the unit circle, i.e., positive and negative frequencies. To plot
the above with a simple 2-D plot, make the call
plot(abs(zXform))
To evaluate the frequency response at only positive frequencies, use
z = exp(j*(A-1)*pi/SR);
For the second method, we create a matrix, each column of which is the z test or evaluation vector
raised to a power such as 0, -1, etc. The matrix pzMat of arguments for the complex exponential is first
created and then used as an argument for the exp function. Each row of the matrix ZZMat is a power
sequence based on a given value of z ; collectively, all the rows represent power sequences for all the values
of z at which the z -transform is to be evaluated.
Imp = [1 1 1]; B=0:1:length(Imp)-1; SR = 256;
pzMat = (2*pi*(0:1:SR)/SR)'*(-B);
ZZMat = exp(j*pzMat); zXform = ZZMat*Imp'; plot(abs(zXform))
The script LVxFreqRespViaZxform (see exercises below) was used to generate Fig. 2.14 by making
the call
LVxFreqRespViaZxform([1,1,1,1,1,1,1,1],512)
where the first argument is an impulse response, and the second argument is the number of z -transform
and DTFT samples to compute.The figure shows, in plots (a) and (b), the magnitude and phase responses,
respectively, of the z -transform of the impulse response. In the script, all values of z used to evaluate the z -
transform are on the unit circle, and hence the result is identical to samples of the DTFT when evaluated
at the same frequencies. The script computes the equivalent DTFT results, which are shown in plots (c)
and (d) of the figure (which, for convenience shows only the positive frequency response in all plots).
0 . 9 z n
where n is large and not known ahead of time for any particular computation. If, for example, n were, say,
1000, there would be 1000 terms to evaluate, as
Example 2.33.
Efficiently evaluate the z-transform of the FIR whose z-transform is Y(z)
=
1
+
b 1 z 1
b 2 z 2
b 1000 z 1000
Y(z)
=
1
+
+
+
...
+
where b coefficients 1 through 999 are equal to zero.
A useful way to proceed is to assume that the vector of b coefficients will be supplied in complete
form, with only a few nonzero coefficients, such as (for example)
Search WWH ::




Custom Search