# MATLAB fourier synthesis

Tags:
1. May 12, 2014

### Branny12000

Hi I wanted to check how to do a fourier synthesis to recreate a signal from a frequency spectrum. So I basically have the frequency spectrum so I have the power of the fundamental frequency and the harmonics. Is there a way I can do a synthesis to create a time signal?

2. May 12, 2014

### f95toli

If you have the spectra you should be able to just do an inverse transform (ifft).
There are a few things that can cause problems (read up on the fftshift command in the manual); but it should not be very difficult.

Have a look at some examples in the manual.

3. May 12, 2014

### Branny12000

is there are a way I can do it from fourier synthesis using a version of the code
for i =1:n (N = no of harmonics)
y = y + p(n)*cos(2*pi*n*f*t)

end

where P(n) is the power and f is the fundamental frequency

4. May 16, 2014

### f95toli

Only if the original Fourier transform was done using a discrete cosine transform and the signal had some unusual properties(I think?); the inverse transform fir the cosine transform is as far as I know more complicated than what you have in your program
Hence, I guess the answer is perhaps yes for some signals but not in general.

Have a look at the wiki for discrete cosine transforms if this is really what you need. If your spectra was calculated from the usual FFT you need to use the IFFT function.