Clear Filters
Clear Filters

How to fix an fft?

5 views (last 30 days)
love kush Pranu
love kush Pranu on 28 Apr 2021
Answered: Imran on 4 Jan 2023
So basically we have to apply the fft function on a given compound wave but the values it is outputiong are slightly off. How do we change this to give a more accurate fourier transform?

Answers (1)

Imran
Imran on 4 Jan 2023
Hello Love,
I understand that you are applying the 'fft' function on a given compound wave, but the output is not accurate.
The reason behind such inaccurate output is that frequency components of your compound signal are not matching exactly with the discrete frequency array, defined for computing ‘fft’. The 'fft' function matches your signal by finding components close to your signal, i.e., it decomposes the signal in cosines and sines that it is allowed to sum over.
If you want to have them exactly in your transformed signal or if you want more accurate output, you must change the sampling points of the 'fft' accordingly. If you are computing n-point DFT, make sure that 'n' is an integral multiple of the number of recorded data points. That is how you can have exact peaks at your predefined frequencies.
I hope this helps.

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!