You are on page 1of 1

clc

clear all
close all
M=2
L=2
fm=100
fs=2000
n=0:200
x=10*sin(2*pi*fm*1/fs*n)
subplot(3,1,1)
stem(x)
title('Original input signal x(n)')
subplot(3,1,2)
stem(decimate(x,M))
title('Decimated signal x(nM)')
subplot(3,1,3)
stem(interp(x,L))
title('Interpolated signal x(n/L)')

You might also like