Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Help in Exponential Fourier Series !!!!

Subject: Help in Exponential Fourier Series !!!!

From: Animesh Pandey

Date: 9 Apr, 2011 11:51:04

Message: 1 of 1

clc
syms an bn a0 t n x;

T = 10
N = 30
x = cos(t).*(heaviside(t+pi/2) - heaviside(t-pi/2));

wo = 2*pi/T;

an1 = int(x.*exp(-n*j*wo*t),t,0,T)*(1/T); %Exponential

an = int(x.*cos(n*pi*t/T),t,-T,T)*(1/T); %Trigonometric
bn = int(x.*sin(n*pi*t/T),t,-T,T)*(1/T);
a0 = int(x,t,-T,T)*(1/T);
cn = sqrt(an*an + bn*bn);
y1 = a0;

pretty(a0);
pretty(an);
pretty(an1);
pretty(bn);
pretty(cn);

for i=1:1:N;
     y1 = y1 + subs(an, i).*cos(2*pi*i*t/T) + subs(bn, i).*sin(2*pi*i*t/T);
     y = y + subs(an1, i).*exp(j*wo*i*t);
end

y
y1
-----------------------------------------------------------------------------------------------------------
'y' and 'y1' are supposed to give the same series ..... but I do not get the correct series with 'y1' (exponential) !!
Please help !!
Thanx

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us