Pages

Sunday, March 6, 2011

MATLAB PROGRAM TO IMPLEMENT SAMPLING THEOREM for all Nyquist conditions


close all;
clear all;
t=-10:0.01:10;
T=8;
fm=1/T;
x=cos(2*pi*fm*t);
fs1=1.2*fm;
fs2=2*fm;
fs3=8*fm;
n1=-4:1:4;
xn1=cos(2*pi*n1*fm/fs1);
subplot(221)
plot(t,x);
xlabel('time in seconds');
ylabel('x(t)');
title('continous time signal');
subplot(222)
stem(n1,xn1);
hold on;
plot(n1,xn1);
xlabel('n');
ylabel('x(n)');
title('discrete time signal with fs<2fm');
%
n2=-5:1:5;
xn2=cos(2*pi*n2*fm/fs2);
subplot(223)
stem(n2,xn2);
hold on;
plot(n2,xn2);
xlabel('n');
ylabel('x(n)');
title('discrete time signal with fs=2fm');
%
n3=-20:1:20;
xn3=cos(2*pi*n3*fm/fs3);
subplot(224)
stem(n3,xn3);
hold on;
plot(n3,xn3);
xlabel('n');
ylabel('x(n)');
title('discrete time signal with fs>2fm');



2 comments:

  1. Question:
    A signal x(t)=10cos(2000*pi*t)+√2sin(3000*pi*t)+2cos(5000*pi*t+pi/4) is sampled at a rate of 4000Hz.Find the resulting sampled signal,x[n] by using t=nTs.Does this sampling rate cozand aliasing?

    How to solve this question using matlab??

    ReplyDelete
  2. Question:
    A signal x(t)=5cos(6*pi*t)+3sin(8*pi*t) is sampled using sampling frequency of 10 samples per second.The spectrum of x(t) and the spectrum of sample signal.plot the output of reconstruction filter is unique.The reconstruction filter is an idle low pass filter with the bandwidth of fs/2.The pass band gain of filter is Ts=1/fs.

    ReplyDelete