Digital Signal Processing Reference
In-Depth Information
>> % Part (a)
>> figure(5)
% Select figure 5 for plots
>> clf
% Clear figure 5
>> k = [-5:5];
% k = [-5 -4 ...0 ...4 5]
>> f1 = sin(0.1*pi*k);
% Calculate function f1
>> subplot(2,2,1);
% Divides fig 5 into (m = 2)
% vertical and (n = 2)
% horizontal sub-figures.
% The last argument (p = 1)
% accesses sub-figures
% (1 <= p <= m*n).
>> stem(k,f1,'filled');
grid on;
% DT plot of f1 versus k
>> xlabel('k') ;
% Label of X-axis
>> ylabel('f1[k]')
% Label of Y-axis
>> % Part (b)
>> k = [-7:7];
% k overwritten to
% [-7 -6 ...0 ...6 7]
>> f2 = 2.
(-k) ;
% Calculate function f2
>> subplot(2,2,2);
% Selectp=2sub-figure
>> stem(k,f2,'filled');
grid on;
% DT plot of f2 versus k
>> xlabel('k');
% Label of X-axis
>> ylabel('f2[k]');
% Label of Y-axis
>> % Part (c)
>> k = [0:9]; % k overwritten to
[0 1 ...8 9]
>>f3=[1111133333];%Calculate function f3
>> subplot(2,2,3);
% Selectp=3sub-figure
>> stem(k,f3,'filled');
grid on;
% DT plot of f3 versus k
>> xlabel('k');
% Label of X-axis
>> ylabel('f3[k]');
% Label of Y-axis
>> % Part (d)
>> k = [0:9];
>>f4=[0123450000];%Calculate function f4
>> subplot(2,2,4);
% Selectp=4sub-figure
>> stem(k,f4, 'filled');
grid;
% DT plot of f2 versus k
>> xlabel('k');
% Label of X-axis
>> ylabel('f4[k]');
% Label of Y-axis
>> print -dtiff plot.tiff;
% Save the figure as a
% TIFF file
Search WWH ::




Custom Search