Finding an average of a signal using Fast Fourier Transform?

AI Thread Summary
Using Fast Fourier Transform (FFT) in MATLAB to find the average of a signal by extracting the 0Hz value is questioned, as a simpler method involves calculating the mean of the discrete data directly. However, this direct averaging may not yield accurate results if the data does not represent complete periods of the signal. For signals like cosine waves, incomplete wavelengths can lead to misleading averages, such as zero. It is suggested to first determine the fundamental period of the signal to ensure a meaningful average can be calculated from one complete period. Understanding the signal's characteristics is crucial for accurate analysis.
stevenphy2
Messages
10
Reaction score
0
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.
Is this a bad idea?
Any other ways to do this?
Thanks.
 
Physics news on Phys.org
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.
 
n.karthick said:
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.

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..?
 
stevenphy2 said:
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.

Yes you are right. I think, you should first find the fundamental period of your signal (in case you don't know). Once you know that, you can find average of your signal from the samples of one period.
 
I was reading a Bachelor thesis on Peano Arithmetic (PA). PA has the following axioms (not including the induction schema): $$\begin{align} & (A1) ~~~~ \forall x \neg (x + 1 = 0) \nonumber \\ & (A2) ~~~~ \forall xy (x + 1 =y + 1 \to x = y) \nonumber \\ & (A3) ~~~~ \forall x (x + 0 = x) \nonumber \\ & (A4) ~~~~ \forall xy (x + (y +1) = (x + y ) + 1) \nonumber \\ & (A5) ~~~~ \forall x (x \cdot 0 = 0) \nonumber \\ & (A6) ~~~~ \forall xy (x \cdot (y + 1) = (x \cdot y) + x) \nonumber...
Back
Top