Please discuss discrete Fourier analysis

In summary, the conversation discusses the use of Fourier analysis and the subtleties involved, such as the difference between a Discrete Fourier Transform (DFT) and a Fast Fourier Transform (FFT), and the need for suitable windowing and padding of data. The conversation also touches on the issue of selecting significant components from the frequency spectrum and the potential artifacts introduced by padding and resampling. The conversation concludes with a discussion on the digitizing sample rate and the importance of anti-alias preamp filters in processing real data.
  • #1
mattrix
14
2
TL;DR Summary
What are the subtleties when using Fourier analysis?
It has been 35 years since I did the math for Fourier analysis, and I have forgotten what the subtleties are. Please be kind.
So this is not a how do I calculate a DFT (though that may be my next question) but rather how do I use it, and interpret the results.

All the online and software I find seems to use the FFT algorithm.
If I remember properly the FFT requires 2^n samples. I recall you can zero pad to get the samples, but doesn't this change the fundamental frequency/period. eg if I have data for 'm' complete periods I would expect a prominent peak on the m'th harmonic, but if I have zero padded that peak with be scattered across several harmonics, none of which are related to the period in the data ?

What is the FFT calculating anyway? I want the spectrum of a continuous signal. When I multiply this with a comb function (sample) is the FFT calculating the spectrum of the product or the original continuous signal?

Thats all I can put words to at the moment. I have vague recollections that how you choose the data is important but I can't remember how or why.

I look forward to your comments.
 
  • Like
Likes mcastillo356
Mathematics news on Phys.org
  • #3
A DFT looks at a time window of a function and assumes that the data repeats endlessly. This contrasts with the FT which transforms an infinite set of time samples into an infinite set of frequency samples. The resulting DFT will be a comb of samples which are harmonics of the repeat frequency; there are no other frequencies involved.

The FFT is just a quick method of DFT which works only for blocks of 2n samples. I heard it described as a 'folding' of the array of samples which eliminates the need for many of the calculations that a full DFT will do.

The error that occurs when you try to DFT a non-repeating function by selecting an arbitrary number of samples can be reduced by suitable 'windowing' of the array of samples so that the samples near the centre are weighted bigger than the samples near the end. This has the effect of reducing errors in the fine structure of the signal.

Another bit of arm waving: you can say that the DFT calculates the correlation of the input signal with each of the harmonics of the repeat frequency. That's the same as the frequency domain description of the input signal. There are as many ways of describing these things as you've had hot dinners so you have to pick (a valid) one of them if you want a good feel for the subject.
 
Last edited:
  • Informative
  • Like
Likes Jarvis323 and mattrix
  • #4
Thankyou everyone, I knew there was more to this question than I could recall.
The trouble with University math is that all the functions are easily describable in the time domain, and hence manipulable. Real data doesn't obey these rules.
I am assuming that the real data has,
1. high frequency noise
2. low frequency bias

What I wanted to do with Fourier analysis was to select the significant components from the frequency spectrum and to sum them to get an approximation in the time domain.

I had forgotten about 'windowing' and the artifacts that they produce (such are the ravages of time). However in my case I am 'imposing' a periodic structure on the data: according to me it should be periodic.

The 2^n samples does concern me. If I recall correctly, the lowest frequency detected will have a period of 2^n time samples long (or is that 2^(n-1)?), the 2nd harmonic will have a period half as long.
So if my data has 1260 time samples and I zero pad to 2048 samples, then there will be no component with a period of 1260 samples, although I have 'imposed' that it does repeat after 1260 time samples. What other artifacts does this padding cause?

I guess I could interpolate the data and resample so that there are 2^n samples, but I think this will also cause artifacts?
 
  • #5
The restriction of FFT to ##N=2^n## is archaic. A good modern FFT implementation, such as FFTW or GSL, will be efficient for ##N## a product of small primes.

##1260 = 2^2 \times 3^2 \times 5 \times 7## so it will work fine, no padding necessary.
 
  • Informative
  • Wow
  • Like
Likes sophiecentaur, sysprog, mattrix and 1 other person
  • #6
Thank you DrClaude,
That does what I intended well.
Though it has sent me down a rabbit hole of new searches.
 
  • #7
So does what I intend to do:

Sample the data for 'm' periods: do an FFTW: select suitable components: convert them back to a continuous time waveform.

seem reasonable?

Does it pose any problems or introduce significant artifacts?
 
  • #8
mattrix said:
I am assuming that the real data has,
1. high frequency noise
2. low frequency bias
mattrix said:
Sample the data for 'm' periods: do an FFTW: select suitable components: convert them back to a continuous time waveform.
I may have missed it, but what is the bandwidth of the signal that you want to digitize and process? What is your digitizing sample rate?

Where are you setting the cutoff of your anti-alias preamp filter, and what polynomial are you using in that analog filter? What order?
 
  • #9
mattrix said:
Thankyou everyone, I knew there was more to this question than I could recall.
The trouble with University math is that all the functions are easily describable in the time domain, and hence manipulable. Real data doesn't obey these rules.
I am assuming that the real data has,
1. high frequency noise
2. low frequency bias

What I wanted to do with Fourier analysis was to select the significant components from the frequency spectrum and to sum them to get an approximation in the time domain.

I had forgotten about 'windowing' and the artifacts that they produce (such are the ravages of time). However in my case I am 'imposing' a periodic structure on the data: according to me it should be periodic.

The 2^n samples does concern me. If I recall correctly, the lowest frequency detected will have a period of 2^n time samples long (or is that 2^(n-1)?), the 2nd harmonic will have a period half as long.
So if my data has 1260 time samples and I zero pad to 2048 samples, then there will be no component with a period of 1260 samples, although I have 'imposed' that it does repeat after 1260 time samples. What other artifacts does this padding cause?

I guess I could interpolate the data and resample so that there are 2^n samples, but I think this will also cause artifacts?
You might be confusing the 2^n window size for an fft with the nyquist frequency? In that case you need to sample at twice the frequency that you want to detect.

The window size affects the resulution of the result, basically the number of bins.
 
  • Like
Likes sophiecentaur and mattrix
  • #10
Jarvis323 said:
In that case you need to sample at twice the frequency that you want to detect.
Not in the real world... :wink:
 
  • #11
berkeman said:
I may have missed it, but what is the bandwidth of the signal that you want to digitize and process? What is your digitizing sample rate?

Where are you setting the cutoff of your anti-alias preamp filter, and what polynomial are you using in that analog filter? What order?

No explicit filtering has been applied. So I guess bandwidth is infinite?

I'm intending to use FFTW to explore the data. And treating this as a math problem (maybe incorrectly?)

IIRC the number of samples I choose to use determines the longest period I can detect in the data.
In the proposed case, 1260 samples/period. By using the FFTW algorithm I am saying the sequence will repeat after these 1260 samples.

I actually expect the data to repeat 13 times in these 1260 odd samples.

The shortest period I can detect is 2 time samples long. Roughly 50 times the expected periodicity in the data.

But I am just pushing numbers around the page now. I don't know if I have answered your questions?
 
Last edited:
  • #12
mattrix said:
I don't know if I have answered your questions?
Not really. Digitizing analog waveforms in the real world involves lots of important considerations, some of which led to my questions for you above.

It would be best if you read through some good references on how to digitize waveforms correctly. Otherwise you will be chasing your tail on a number of issues. This Application Note by Analog Devices is a good place to start:

https://www.google.com/url?sa=t&rct...s/an-282.pdf&usg=AOvVaw3qlhBVdp1LOYzPBtff1c9o

1652023048110.png
 
  • Like
Likes mattrix
  • #13
Thanks berkeman,
A lot of information in that link. I will have to read it a few times to get all this to gel.

In my case, I am presented with data that has already been sampled for digital storage. I do know that it has been oversampled/decimated so I guess some care has been taken with the data.
 
  • Like
Likes berkeman

FAQ: Please discuss discrete Fourier analysis

What is discrete Fourier analysis?

Discrete Fourier analysis is a mathematical technique used to decompose a signal or function into its constituent frequencies. It is a type of Fourier analysis that is specifically applied to discrete, or sampled, data.

How does discrete Fourier analysis differ from continuous Fourier analysis?

The main difference between discrete and continuous Fourier analysis is that discrete Fourier analysis is applied to discrete, or sampled, data while continuous Fourier analysis is applied to continuous, or non-sampled, data. This means that discrete Fourier analysis is more commonly used in digital signal processing, while continuous Fourier analysis is used in fields such as physics and engineering.

What are some applications of discrete Fourier analysis?

Discrete Fourier analysis has a wide range of applications in various fields, including signal processing, image processing, data compression, and audio and video encoding. It is also used in fields such as physics, engineering, and finance for data analysis and modeling.

How is discrete Fourier analysis performed?

Discrete Fourier analysis involves converting a signal or function from its original time or space domain into the frequency domain. This is done by applying the discrete Fourier transform (DFT) algorithm, which is a mathematical formula that calculates the amplitudes and phases of the constituent frequencies in the signal. The DFT algorithm can be implemented using various methods, such as the fast Fourier transform (FFT) algorithm.

What are some advantages of using discrete Fourier analysis?

One of the main advantages of using discrete Fourier analysis is that it allows for the analysis and manipulation of signals or functions in the frequency domain, which can provide valuable insights and facilitate various applications. Additionally, the DFT algorithm can be implemented efficiently using the FFT algorithm, making it a fast and computationally efficient method for analyzing large amounts of data.

Similar threads

Replies
2
Views
1K
Replies
1
Views
2K
Replies
2
Views
3K
Replies
13
Views
2K
Replies
2
Views
1K
Replies
1
Views
2K
Back
Top