How can I plot the result obtained from Fourier analysis of the figure?

1 view (last 30 days)
I solved Fourier analysis of a waveform shown in the figure; however, when I try to plot the equation obtained with Fourier analysis I could not see the result as expected. I'm sure that there is no fault in my equation. I think the problem sources from the resolution of the value of "i" in the loop, but I could not figure out the problem exaclty. Could you please correct my codes given below?
Note: The period of the figure is 12pi.
Thanks in advance...
clear all;close all;clc;
beta = 0:.01:(12*pi);
N=1000;
y=0;
for i=1:1:N
y = y+(((1/(6*pi*i))*((-2*cos(12/13*pi*i)+1+2*cos(24/13*pi*i)-cos(36/13*pi*i)+2*cos(4*pi*i)-cos(40/13*pi*i)-2*cos(64/13*pi*i)+2*cos(76/13*pi*i)-2*cos(88/13*pi*i)+2*cos(100/13*pi*i)-2*cos(112/13*pi*i)+cos(124/13*pi*i)+cos(128/13*pi*i)+cos(132/13*pi*i)-cos(140/13*pi*i)-2*cos(144/13*pi*i)+cos(12*pi*i)))*(sin(i*beta))));
end
hold on
y=y+(1/13);
plot(beta,y); grid;

Answers (0)

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!