Forums

fourier series coefficients

Started by Kurt December 1, 2009
hello all,
I have a one period square wave on the interval[0,2] defined as:
y(t)= 1, 0<=t<1
y(t)= 0, 1<=t<2
I need to find the fourier series coefficients,ck, with
k=-10,-9,...,9,10
I heard using a for loop would work but I am completely stuck on how to move through this problem.
All help is greatly appreciated,
Kurt
you can try

for k=-10:1:10
c(k+11) = here you enter the Ck equation; % you cant have negative indexing in MATLAB
end

Now

c gives you the coefficients

rgds
vishwanath

________________________________
From: Kurt
To: m...
Sent: Tue, 1 December, 2009 12:50:19 PM
Subject: [matlab] fourier series coefficients

 
hello all,
I have a one period square wave on the interval[0,2] defined as:
y(t)= 1, 0<=t<1
y(t)= 0, 1<=t<2
I need to find the fourier series coefficients, ck, with
k=-10,-9,... ,9,10
I heard using a for loop would work but I am completely stuck on how to move through this problem.
All help is greatly appreciated,
Kurt
Hey..

For fourier coeff u have to find the fft of the given sequence using matlab.
Since u have to find the coeff for kranging from -10:1:10, i.e.21 points u
have to define ur function in time domain in 21 samples. Take the fft of
these 21 samples. The resultant is your desired fourier coeff .

Regards-vaibhav

On Thu, Dec 3, 2009 at 5:01 PM, vishwa wrote:

> you can try
>
> for k=-10:1:10
> c(k+11) = here you enter the Ck equation; % you cant have negative indexing
> in MATLAB
> end
>
> Now
>
> c gives you the coefficients
>
> rgds
> vishwanath
>
> ________________________________
> From: Kurt >
> To: m...
> Sent: Tue, 1 December, 2009 12:50:19 PM
> Subject: [matlab] fourier series coefficients
>
> hello all,
> I have a one period square wave on the interval[0,2] defined as:
> y(t)= 1, 0<=t<1
> y(t)= 0, 1<=t<2
> I need to find the fourier series coefficients, ck, with
> k=-10,-9,... ,9,10
> I heard using a for loop would work but I am completely stuck on how to
> move through this problem.
> All help is greatly appreciated,
> Kurt
>
>
>

--
Vaibhav Singh
BE(Hons.) Electronics And Instrumentation
BITS-Pilani