Digital Signal Processing Reference
In-Depth Information
3
3
2
2
1
1
0
0
−1
−1
−2
−2
−3
−3
−20
−10
0
10
20
−20
−10
0
10
20
k
k
(a)
(b)
Fig. E.1. Plots of
f [ k ] = 2 cos(0.5 k ) versus k in
the range −20 ≤ k ≤ 20.
(a) CT plot; (b) stem DT plot.
% [x-min x-max y-min y-max]
>> print -dtiff plot.tiff
% Saves figure in the file
% “plot.tiff” in
% the TIFF format
These instructions produce a continuous plot cosine wave, as shown in
Fig. E.1. It is also possible to construct a discrete-time plot using the stem
function:
>> figure(2)
>> stem(k,f,'filled');
% DT plot; option 'filled'
% fills the circles at the
% top of vertical bars
>> xlabel('k');
% Sets label of X-axis to k
>> ylabel('f[k]');
% Sets label of Y-axis to f[k]
>> axis([-25 25 -3 3])
>> print -dtiff plot2.tiff
Both plot and stem functions have a variety of options available, which may
be selected to change the appearance of the figures. The reader is encouraged
to explore these options by seeking help on these functions in M ATLAB .In
addition, there are several other 2D graphical functions in M ATLAB . These
include semilogx , semilogy , loglog , bar , hist , polar , stairs ,
rose , errorbar , compass , and pie .
Search WWH ::




Custom Search