Using fourier transform to find moving average

In summary: The width of the peak reflects this kind of variation.In summary, you can use Fourier transform to find a moving average on a data set by removing high order harmonics from the Fourier transform result and doing a reverse Fourier transform on the new result. However, for more complex data sets, such as climate change data, determining which harmonics to leave out and which window to use can be a challenge. Fourier transform can be useful in identifying and analyzing signals in the data, but it is important to consider the noise and potential sources of variability.
  • #1
brianhurren
71
2
can you use Fourier transform to find a moving average on a data set?

so, you do a Fourier transform on your one dimensional data set.
next remove high order harmonics from FT result.
do reverse Fourier transform on new FT result.

And, vola! smoothed out data set.
 
Mathematics news on Phys.org
  • #2
Some of the high order terms are needed to smooth out the wobbles introduced by the low order terms.
Remove enough high order terms and you get a sine wave no matter what the data was ... so how do you, systematically, decide which terms to remove?
 
  • #3
thats what I would like to know. I heard that FFT is used to analise climate change data, but I can't see how FFt would applie to a random set of data that has no periodic signal, except maybe as a means to calculate a rolling average. exactly as you point out, how do you decide which harmonics to leave out. which window would you use (Hanning, square etc).
 
  • #4
Impossible to tell without specifics.
Do you have an example?

I think it is unlikely that the fft is used in the manner you imagine... i.e. it is probably not being applied to random data with no discernable signal.
 
  • #5
brianhurren said:
can you use Fourier transform to find a moving average on a data set?

Yes, absolutely. The conventional moving average is just a convolution of your original signal with a rectangular window of some length. This is equivalent to pointwise multiplying the Fourier transforms of the signal and a rectangular and inverting (See Convolution, and especially the section on Fast convolution algorithms).

so, you do a Fourier transform on your one dimensional data set.
next remove high order harmonics from FT result.
do reverse Fourier transform on new FT result.

And, vola! smoothed out data set.
Right. And there's no reason you have to limit yourself to a rectangular window filter.
 
  • #6
brianhurren said:
I heard that FFT is used to analise climate change data, but I can't see how FFt would applie to a random set of data that has no periodic signal, except maybe as a means to calculate a rolling average. exactly as you point out, how do you decide which harmonics to leave out. which window would you use (Hanning, square etc).
It's a good question. Mainly you are looking for signals which stand out above the "noise" and which you don't already know about or which have a frequency which is the same as some known, plausible mechanism which affects climate.
How "broad" a peak appears in Fourier space also tells you how far from perfectly periodic a signal might be. Just to give you an example, we expect the seasons in some region to vary on a yearly cycle, but if you were to look at a spectrum of the temperature record, you'd find a peak around 1 cycle/year which is pretty sharp but not a perfect spike. This is because the actual temperature variations can arrive slightly earlier or later each year.
 

Related to Using fourier transform to find moving average

1. What is a Fourier transform?

A Fourier transform is a mathematical tool that decomposes a signal into its constituent frequencies. It converts a time-domain signal into a frequency-domain representation, allowing for analysis of the signal's frequency components.

2. How is a Fourier transform used to find a moving average?

A Fourier transform can be used to find a moving average by first converting the time-domain signal into its frequency-domain representation. Then, a low-pass filter can be applied to the frequency spectrum to remove high-frequency components and retain only the low-frequency components, which represent the moving average of the original signal.

3. What are the advantages of using a Fourier transform to find a moving average?

One advantage of using a Fourier transform to find a moving average is that it allows for a more accurate representation of the signal's frequency components. It also provides a visual representation of the signal's frequency spectrum, making it easier to identify and remove high-frequency noise. Additionally, the use of a Fourier transform can be more efficient than traditional methods of calculating a moving average.

4. Are there any limitations to using a Fourier transform for finding a moving average?

One limitation of using a Fourier transform for finding a moving average is that it assumes the signal is periodic, meaning it repeats itself over time. If the signal is not periodic, the Fourier transform may not accurately represent the signal's frequency components. Additionally, the use of a Fourier transform may require some understanding of mathematical concepts and may not be suitable for those without a technical background.

5. Can a Fourier transform be used to find a moving average in real-time?

Yes, a Fourier transform can be used to find a moving average in real-time. However, this may require specialized hardware or software that can perform the calculations quickly enough to keep up with the changing signal. In some cases, a simpler method of calculating a moving average may be more suitable for real-time applications.

Similar threads

Replies
7
Views
2K
  • General Math
Replies
12
Views
1K
  • General Math
Replies
2
Views
1K
Replies
11
Views
3K
Replies
5
Views
1K
  • General Math
Replies
3
Views
3K
Replies
3
Views
1K
  • General Math
Replies
9
Views
2K
  • Advanced Physics Homework Help
Replies
5
Views
2K
  • General Math
Replies
5
Views
3K
Back
Top