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

Experiment 6

Uploaded by

fps0gamerz
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)
4 views3 pages

Experiment 6

Uploaded by

fps0gamerz
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/ 3

EXPERIMENT NO.

Aim: To study FFT(Sin,Square,Cos)


Software: MATLAB
Roll Number:BT23F04F040 Name:
Vinit Purushottam Kolhe

clc;

close all;

clear all;

t=0:0.001:9;

f=0.9;

% sine wave

y1=2*sin(2*pi*f*t);

subplot(3,4,1);

plot(t,y1);

title('sine wave');

y2=fft(y1);

subplot(3,4,2);

plot(t,y2);

title('fft of sine wave');

y3=fftshift(y2);

subplot(3,33);

plot(t,y3);

title('fftshift of sine wave');

y4=abs(y3);

subplot(3,4,4);

plot(t,y4);
title('abs value of sine wave');

% cosine wave

y5=10*cos(2*pi*f*2*t);

subplot(3,4,5);

plot(t,y5);

title('cosine wave');

y6=fft(y5);

subplot(3,4,6);

plot(t,y6);

title('fft of cosine wave');

y7=fftshift(y6);

subplot(3,4,7);

plot(t,y7);

title('fftshift of cosine wave');

y8=abs(y7);

subplot(3,4,8);

plot(t,y8);

title('abs value of cosine wave');

% square wave

y9=0.5*1*0.5*square(2*pi*f*t);

subplot(3,4,9);

plot(t,y9);

title('square wave');

y10=fft(y9);

subplot(3,4,10);
plot(t,y10);

title('fft of square wave');

y11=fftshift(y10);

subplot(3,4,11);

plot(t,y11);

title('fftshift of square wave');

y12=abs(y11);

subplot(3,4,12);

plot(t,y12);

title('abs value of square wave');

You might also like