2nd exp of dtsp (2)

Preview:

DESCRIPTION

dtsp matlab experiment.

Citation preview

AIM: to sample continous time signal with different sampling frequencyAPPARATUS:power supply computer matlab software.

PROGRAM:clear all:clear all:clc% to sample continous time signal with different sampling frequencyF=input('enter the signal frequency');T=1/F;A=0;B=2*T;fs1=input('enter the first sampling frequency');fs2=input('enter the second sampling frequency');ts1=1/fs1;ts2=1/fs2;t1=A:ts1:B;t2=A:ts2:B;X1=sin(2*pi*F*t1);X2=sin(2*pi*F*t2);subplot(2,1,1);stem(t1,X1);title('the first sampled signal')subplot(2,1,2);stem(t2,X2);title('the second sampled signal')

clear all:clear all:clc% to sample continous time signal with different sampling frequencyF=input('enter the signal frequency');T=1/F;A=0;B=2*T;fs1=input('enter the first sampling frequency');fs2=input('enter the second sampling frequency');fs3=input('enter the second sampling frequency');ts1=1/fs1;ts2=1/fs2;ts3=1/fs3;t1=A:ts1:B;t2=A:ts2:B;t3=A:ts3:B;X1=sin(2*pi*F*t1);X2=sin(2*pi*F*t2);X3=sin(2*pi*F*t3);subplot(3,1,1);stem(t1,X1);title('the first sampled signal')subplot(3,1,2);stem(t2,X2);title('the second sampled signal')subplot(3,1,3);stem(t3,X3);title('the second sampled signal')

Recommended