0% found this document useful (0 votes)
4 views3 pages

Signal Sampling Techniques Explained

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Signal Sampling Techniques Explained

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

EXPERIMENT-5

clear all; %%fs=2fm criticalsampling


close all; fs2=0.04;
clc; n1=-4:4;
%%continuous time signal x2=cos(2*pi*fm*n1/fs2);
t=-100:01:100; subplot(2,2,3);
fm=0.02; stem(n1,x2);
x=cos(2*pi*t*fm); hold on
subplot(2,2,1); subplot(2,2,3);
plot(t,x); plot(n1,x2,':');
xlabel('time in sec'); title('discrete time signal x(n) fs=2fm');
ylabel('x(t)'); xlabel('n');
title('continuous time signal'); ylabel('x(n)');
%%fs<2fm undersampling %%fs>2fm criticalsampling
fs1=0.02; fs3=0.5;
n=-2:2; n2=-50:50;
x1=cos(2*pi*fm*n/fs1); x3=cos(2*pi*fm*n2/fs3);
subplot(2,2,2); subplot(2,2,4);
stem(n,x1); stem(n2,x3);
hold on hold on
subplot(2,2,2); subplot(2,2,4);
plot(n,x1,':'); plot(n2,x3,':');
title('discrete time signal x(n) title('discrete time signal x(n) fs>2fm');
fs<2fm'); xlabel('n');
xlabel('n'); ylabel('x(n)');
ylabel('x(n)');
clear all; %%fs=2fm Nyquist sampling
close all; fs3=0.04;
clc; fs4=0.08;
%%continuous time composite signal n1=-4:4;
t=-100:01:100; x2=cos(2*pi*fm1*n1/fs3)+cos(2*pi*fm2*n1/fs4);
fm1=0.02; subplot(2,2,3);
fm2=0.04; stem(n1,x2);
x=cos(2*pi*t*fm1)+cos(2*pi*t*fm2); hold on
subplot(2,2,1); subplot(2,2,3);
plot(t,x); plot(n1,x2,':');
xlabel('time in sec'); title('discrete time signal x(n) fs=2fm');
ylabel('x(t)'); xlabel('n');
title('continuous time signal'); ylabel('x(n)');
%%fs<2fm undersampling %%fs>2fm criticalsampling
fs1=0.02; fs5=0.5;
fs2=0.04; fs6=0.6;
n=-2:2; n2=-50:50;
x1=cos(2*pi*fm1*n/fs1) + x3=cos(2*pi*fm1*n2/fs5)+cos(2*pi*fm2*n2/fs6);
cos(2*pi*fm2*n/fs2); subplot(2,2,4);
subplot(2,2,2); stem(n2,x3);
stem(n,x1); hold on
hold on subplot(2,2,4);
subplot(2,2,2); plot(n2,x3,':');
plot(n,x1,':'); title('discrete time signal x(n) fs>2fm');
title('discrete time signal x(n) xlabel('n');
fs<2fm'); ylabel('x(n)');
xlabel('n');
ylabel('x(n)');
clear all; %exactsampling
close all; fs2=2*fmax;
clc; n2=0:1/fs2:2*T;
%%continuous composite signal x2=cos(2*pi*n2*f1)+cos(2*pi*n2*f2);
f1=1000; subplot(2,2,3)
f2=1900; stem(n2,x2);hold on;
fmax=max(f1,f2); plot(n2,x2,'r');grid on;
T=1/min(f1,f2); hold off;
t=0:0.01*T:2*T; title('criticalsampling condition:fs=2f')
x=cos(2*pi*t*f1)+cos(2*pi*t*f2); xlabel('n')
subplot(2,2,1); ylabel('x(n)');
plot(t,x);grid on; %under sampling
title('continuous signal'); fs3=1.2*fmax;
xlabel('t'); n3=0:1/fs3:2*T;
ylabel('x(t)'); x3=cos(2*pi*n3*f1)+cos(2*pi*n3*f2);
%oversampling subplot(2,2,4)
fs1=10*fmax; stem(n3,x3);hold on;
n1=0:1/fs1:2*T; plot(n3,x3);grid on;
x1=cos(2*pi*n1*f1)+cos(2*pi*n1*f2); hold off;
subplot(2,2,2) title('undersampling condition:fs=1.2f')
stem(n1,x1);hold on; xlabel('n')
plot(n1,x1,'r');grid on; ylabel('x(n)');
hold off;
title('oversampling
condition:fs=10f')
xlabel('n')
ylabel('x(n)');

You might also like