MATLAB code for Sampling Theorem verification -under sampling

Aim: Write MATLAB code for Sampling Theorem verification -under sampling

Requirements: PC with MATLAB software

Program:

clc;
clear all;
close all;
fm=600;
x=sin(2*pi*fm*t);
fx=fft(x,64);
xr=ifft(fx,64);
fx=[fx(34:64) fx(1:33)];
subplot(1,3,1);
stem(x);
title('sampled signal')
subplot(1,3,2);
stem(f,abs(fx)),axis([-300 300 0 30]);
title('frequency spectrum')
subplot(1,3,3);
stem(xr);
title('recovered signal');

Output: