Can an FFT be used to extract individual sinusoids from a set of data points?

  • Context: Undergrad 
  • Thread starter Thread starter jameslat
  • Start date Start date
  • Tags Tags
    Fft Sinusoids
Click For Summary

Discussion Overview

The discussion revolves around the use of Fast Fourier Transform (FFT) to extract individual sinusoids from a set of data points, particularly in the context of signal processing and data analysis. Participants explore both theoretical and practical applications of FFT, including its use in analyzing signals from accelerometers and transforming shapes.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning
  • Experimental/applied

Main Points Raised

  • One participant inquires about extracting individual sinusoids from FFT results, noting that the FFT provides amplitude information for each frequency.
  • Another participant explains that the FFT yields complex values for each harmonic, which can be interpreted in terms of cosine and sine functions.
  • A participant shares Python code demonstrating how to generate a dummy signal, compute its FFT, and extract main frequencies, expressing satisfaction with the straightforwardness of the process.
  • One participant discusses an experiment involving the transformation of shapes and the calculation of a transfer function using FFT, questioning the outcome of applying inverse FFT to a transformed signal.
  • Another participant poses a similar question regarding the result of applying inverse FFT to a different transformed signal, expressing curiosity about the potential outcome.
  • A participant elaborates on the applications of FFT in image analysis, describing how it can be used to identify objects in satellite photos and remove motion blur from images.

Areas of Agreement / Disagreement

Participants express various viewpoints and hypotheses regarding the use of FFT, with some exploring practical applications and others discussing theoretical aspects. There is no consensus on the outcomes of the proposed transformations or the specific results of the inverse FFT applications.

Contextual Notes

Some discussions involve assumptions about the nature of the signals and transformations, and the outcomes of the inverse FFT processes remain unresolved. The applicability of FFT in different contexts, such as signal processing and image analysis, is also noted but not fully explored.

jameslat
Messages
28
Reaction score
0
Hello,

Thank you for taking time to read my post.

Background: I have a accelerometer project that I am playing with that gives me the acceleration of the object. I can plot this data and it looks very nice. I want to integrate this to get the velocity and then integrate it again to get the position over time.

Question: is there a way to extract the individual sinusoids out of a fast Fourier transform of a discrete set of data points?
I understand that the FFT of the set of data points gives me the amplitude of each sinusoids for its respective frequency. But how can I extract the Fourier series representation of my set of data points?
 
Physics news on Phys.org
A FFT will give you a complex value for each harmonic in your set of discrete data points.

Say that the FFT value of the 4. harmonic is ( 0.3 + 0.5i ), you may interprete it as 0.3*cos(4ωt) + 0.5*sin(4ωt)

. . . if I understand you correct.
 
  • Like
Likes   Reactions: jameslat
Works perfectly! I can't believe that it was that straight forward. You have been very helpful. Here is my python code as a contribution to the community (this is obviously for a dummy signal):


Python:
import numpy as n
import matplotlib.pyplot as plt
from scipy.fftpack import fft, ifft, fftfreq

#create our dummy signal
x=[]
xaxis = n.linspace(0,2*n.pi,num=1000)
for i in range(0,xaxis.size):
    x.append( n.exp(-xaxis[i])*n.sin((xaxis[i])))

#take the fft of the dummy signal
xfft = fft(x)

#find out what the 10 main frequencies are and add them to a list
main =[]
tempMain = 0;
for i in range(0,999):
    for j in range(-10,10):
        a_ = n.real(xfft[j])
        b_ = n.imag(xfft[j])
        w_ = 1 #really w=2pi*f, f=1/T, T=2pi therefore w=1
        n_ = 1000
       
        tempMain += (a_*n.cos(j*w_*xaxis[i])+b_*n.sin(j*w_*xaxis[i]))/n_
       
       
       
    main.append(tempMain)
    tempMain = 0

#this will reverse the order of the list. FFT will cause the data to be mirrored.
main=main[::-1]

#plot the beauties. blue is the original, main is the fit
plt.figure()
plt.plot(a,'b')
plt.plot(main, 'r')
plt.show()
Thanks again!
 
Well, I have recently done some experiments, transforming some shapes like the letters 'E' and 'F'.

Then I calculate the transfer function from 'F' to 'E':

FFT(H) = FFT('E') / FFT('F').

Now, if I transform the letter 'O' and calculate:

IFFT( FFT('O') * FFT(H) ), will I get a 'Q' ??
 
will iFFT( FFT('O') * FFT(H) ), result in a backwards 9?
I haven't ever find anything like that before. It seems interesting though.
 
You can do a lot with these transforms.

Say you have a sattelite photo of a milititary airport and you want to know how many jet fighters of which type is parked in this airport, you can employ a lot of people with magnifying glasses to count these planes. But also you could stuff the photo into a computer, that will place silhouttes of the planes into a complex plane. Now the computer can convert edge pixels of the silhouette to complex numbers, that can be FFT-transformed.

The 0. harmonic tells about the mean illumination in the photo. That's not interesting, so all harmonics in the transform is divided by the 0. harmonic to "standardize" the illumination.

The 1. harmonic tells about in which direction the plane is parked. Different directions could be confusing to the computer, but if you divide all the harmonics by the 1. harmonic, so that the 1. harmonic becomes ( 1 + 0i ), all the planes will be parked in the same direction, and with the same size. In this way you have made a "stadardized" FFT of the jet plane, which you could regard as a "finger print" of the plane.

Now the computer just have to find a matching finger print in a look up table to identify the type of plane.

Another example is to remove blur in a photo due to linear motion of an object ( passing car, where the registration number cannot be read due to blur ).
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 24 ·
Replies
24
Views
5K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K