3
AIM: to sample continous time signal with different sampling frequency APPARATUS:power supply computer matlab software. PROGRAM: clear all: clear all: clc % to sample continous time signal with different sampling frequency F=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') 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 -1 -0.5 0 0.5 1 the firstsam pled signal 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 -1 -0.5 0 0.5 1 the second sam pled signal

2nd exp of dtsp (2)

  • Upload
    maaz629

  • View
    213

  • Download
    0

Embed Size (px)

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')