# Using Fourier analysis to find frequency-amplitude spectrum?

1. Jan 22, 2005

### jamdr

The signal is from a voltage supply. I see lots of pages on the internet about this, such as this one, which shows what the magnitude spectrum looks like for a square wave with an arbitrary number of co-efficients. But how would I actually create that graph myself?

2. Jan 22, 2005

### dextercioby

Is this a question of COMPUTER PROGRAMMING,MATHS or PHYSICS??

Think deep...To me it looks like pogramming...What programming languages do u know?

Daniel.

3. Jan 22, 2005

### jamdr

It's a math question I suppose. I need to know the steps to find a fourier transformation. I know that MATLAB and other computer programs can solve this type of problem, but I want to understand the math behind it.

4. Jan 22, 2005

### Dr Transport

the Fourier coefficitents are calculated using the formulas

$$F(x) = \sum^{\infty} _{0} A_{n}\cos\left(\frac{n\pi x}{a} \right ) + B_{n}\sin\left (\frac{n\pi x}{a}\right )$$

where

$$A_{n} =\frac{1}{a} \int _{-a} ^{a} F(x)\cos\left (\frac{n\pi x}{a}\right ) dx$$

and

$$B_{n} =\frac{1}{a} \int _{-a} ^{a} F(x)\sin\left (\frac{n\pi x}{a} \right ) dx$$

from here plug in the periodic function and do the integrals...........

5. Jan 22, 2005

### jamdr

Wait, what is a?

6. Jan 22, 2005

### Dr Transport

a is the periodicity of the signal..........

7. Jan 23, 2005

### jamdr

Thanks for the help Dr. Transport. But in the end I ended up using this formula:

$$f_n=\frac{1}{T}\int_0^T v(t) e^{-j n \omega t} dt$$

where n is some arbitrary number of coefficients. Also, n is the index of f (an array). Then I plotted $$\overrightarrow{\left|f\right|}_n$$ versus $$\frac{n}{T}$$

I don't fully understand this, but it seemed to work.

Last edited: Jan 23, 2005
8. Dec 22, 2009

### enshy

the last equation stated is complex Fourier series while the earlier stated equation is trigonometry Fourier series. i'm done.