Professional Documents
Culture Documents
........................................................................................................................................ 1
EXERCISE 1................................................................................................................................................1
Comment.......................................................................................................................................................2
EXERCISE 2................................................................................................................................................2
Comment.......................................................................................................................................................3
Conclusion....................................................................................................................................................3
EXERCISE 1
clf;
%M = input('Down-sampling factor = ');
M =2
n = 0:99;
x = sin(2*pi*0.043*n) + sin(2*pi*0.031*n);
y = decimate(x,M,'fir');
subplot(2,1,1);
stem(n,x(1:100));
title('Input Sequence');
xlabel('Time index n');
ylabel('Amplitude');
subplot(2,1,2);
m = 0:(100/M)-1;
stem(m,y(1:100/M));
title('Output Sequence');
xlabel('Time index n');
ylabel('Amplitude');
M =
1
Comment
The frequency of the output signal is decreaased by the factor of 2.
EXERCISE 2
clf;
% M=input('Down Sampling Factor= ');
M=4;
n=0:119;
x=sin(2*pi*0.045*n)+sin(2*pi*0.029*n);
y=decimate(x,M,'fir');
subplot(2,1,1);
stem(n,x(1:120));
title('Input Sequence');
xlabel('Time index n');
ylabel('Amplitude');
subplot(2,1,2);
m = 0:(120/M)-1;
stem(m,y(1:120/M));
title('Output Sequence');
xlabel('Time index n');
ylabel('Amplitude');
Comment
The frequency of the output signal is decreaased by the factor of 3.
Conclusion
All the problem have been performed successfully and desired results have been obtained.