# Finding an average of a signal using Fast Fourier Transform?

1. Jun 1, 2010

### stevenphy2

Hi all,
I have discrete data of a signal but I do not know the periods of the signal.
The signal is like a "beat" I guess, but not really sure.
I plan to use fft in matlab to get it's frequency spectrum and get the 0Hz value as the average of the signal.
Any other ways to do this?
Thanks.

2. Jun 2, 2010

### n.karthick

If you really want to know only average of the signal, you can simply add all the values of your signal (discrete data) and divide by total number of samples. Why to take fft? Anyway fft also does exactly the same thing to find value at 0Hz.

3. Jun 2, 2010

### stevenphy2

Adding them and divide it by the total number of samples will work only if my signal is of complete periods, right?
For example, if my full signal is a cosine wave, but I just have data that are half of the wavelength, it will not give me an average of zero.
I am wondering if there is something that can generate a "meaningful average" even if I do not have exactly complete wavelengths, say I have 5.5 wavelengths..?

4. Jun 2, 2010

### n.karthick

Yes you are right. I think, you should first find the fundamental period of your signal (in case you dont know). Once you know that, you can find average of your signal from the samples of one period.