Code For Embedded Experiment
Code For Embedded Experiment
clear all
close all
t=0:0.01:0.5;
x=1.5*cos(2*pi*10*t);
y=interp(x,2);
y1=decimate(x,2);
subplot(3,1,1);
stem(x);
xlabel('Discrete time')
ylabel('Ampltude')
title('Input sequence')
subplot(3,1,2);
stem(y);
xlabel('Discrete time')
ylabel('Ampltude')
title('Interpolated output of the input sequence')
subplot(3,1,3);
stem(y1);
xlabel('Discrete time')
ylabel('Ampltude')
title('Decimated output of the input sequnence')
Input sequence
2
Ampltude
0
-1
-2
0 10 20 30 40 50 60
Discrete time
Interpolated output of the input sequence
2
1
Ampltude
-1
-2
0 20 40 60 80 100 120
Discrete time
Decimated output of the input sequnence
2
1
Ampltude
-1
-2
0 5 10 15 20 25 30
Discrete time