Sunday, January 26, 2014

Matlab Program to Perform Magnitude Spectrum

with 0 Comment
%Matlab Program to perform Magnitude Spectrum

clc;
close all;
clear all;
x=[1 2 3 4];
xk=fft(x,8);
xm=abs(xk);
disp(xm);
subplot(2,2,1);
stem(xm);
grid on
title('8 Point Sequence');
xk1=fft(x,16);
xm1=abs(xk1);
disp(xm1);
subplot(2,2,2);
stem(xm1);
grid on
title('16 Point Sequence');
xk2=fft(x,32);
xm2=abs(xk2);
disp(xm2);
subplot(2,2,3);
stem(xm2);
grid on
title('32 Point Sequence');
xk3=fft(x,64);
xm3=abs(xk3);
disp(xm3);
subplot(2,2,4);
stem(xm3);
title('64 Point Sequence');

0 comments:

Post a Comment

Powered by Blogger.

Blog Archive