0% found this document useful (0 votes)
77 views

Matlab Sampling

The document describes an experiment using MATLAB to sample a sinusoidal signal at different sampling rates and reconstruct the signal using a low pass filter. It aims to verify the Nyquist sampling theorem. The code samples the signal at rates below, at, and above the Nyquist rate and plots the original, sampled, and reconstructed signals. It concludes that the experiment implements sampling at various rates and verifies the Nyquist theorem through observing the waveforms.

Uploaded by

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

Matlab Sampling

The document describes an experiment using MATLAB to sample a sinusoidal signal at different sampling rates and reconstruct the signal using a low pass filter. It aims to verify the Nyquist sampling theorem. The code samples the signal at rates below, at, and above the Nyquist rate and plots the original, sampled, and reconstructed signals. It concludes that the experiment implements sampling at various rates and verifies the Nyquist theorem through observing the waveforms.

Uploaded by

Syeda Inaas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

EXPERIMENT NO.

AIM: To write a MATLAB program to sample the sinusoidal message signal at different sampling rate
and verify the Nyquist criteria. Also reconstruct the sampled signal using low pass filter (Using FDA Tools).

APPARATUS: MATLAB Software

THEORY:

Sampling: Sampling is the process in which a continuous time signal is sampled by measuring its
amplitude at discrete instants.

Sampling Theorem: The Sampling Theorem states that a signal whose spectrum is band-limited to Fm
Hz can be reconstructed exactly (without error) from its samples taken uniformly at a frequency Fs ≥
2Fm (Samples per second).
In other words, the minimum sampling frequency is Fs = 2·Fm.
The frequency 2· Fm is called the Nyquist sampling rate.
The corresponding sampling interval Ts = 1/ (Fs) is called Nyquist interval.

MATLAB CODE:

clc

clear all

close all

fm=1

t=1:0.1:10

x=sin(2*pi*fm*t);

subplot(331)

plot(t,x)

title('x(t)')

xlabel('time')

ylabel('amplitude')

%undersampled

fs1=0.5*fm;

t1=0:0.1/fs1:10;

A=sin(2*pi*fm*t1);

subplot(332)

stem(t1,A)
title('undersampled')

xlabel('time')

ylabel('amplitude')

A1=filter(fm,1,A)

subplot(333)

plot(t1,A1)

title('reconstructed undersampled')

xlabel('time')

ylabel('amplitude')

%critically sampled

fs2=fm*2

t2=0:0.1/fs2:10

B=sin(2*pi*fm*t2)

subplot(334)

stem(t2,B)

title('critically sampled')

xlabel('time')

ylabel('amplitude')

B1=filter(fm,1,B)

subplot(335)

plot(t2,B1)

title('reconstructed critically sampled')


xlabel('time')

ylabel('amplitude')

%oversampled

fs3=fm*6

t3=0:0.1/fs3:10

C=sin(2*pi*fm*t3)

subplot(336)

stem(t3,C)

title('over sampled')

xlabel('time')

ylabel('amplitude')

C1=filter(fm,1,C)

subplot(337)

plot(t3,C1)

title('reconstructed oversampled')

xlabel('time')

ylabel('amplitude')

OUTPUT WAVEFORM:
CONCLUSION:
We have implemented the sampling of a sinusoidal signal at various sampling rates and verified
Nyquist theorem for sampling of signals through MATLAB code and have observed the waveforms
and have also reconstructed the original signal after sampling.

You might also like