# Question about FFT analysis of a signal

In labs we had to measure the oscillations of a pendulum using an electric sensor. So basically, my data consists of time and voltage (which represents amplitude) pairs. The task was then to perform FFT analysis on this data to obtain the frequency of the pendulum.

After going through the motions using QtiPlot (removing mistakes, fixing offset, smoothing and interpolating), I get the major peak at 2.61Hz, however, if I perform a sinusoidal fit (using SigmaPlot), I obtain the period to be 1.94s. Both of this values have a very high precision and are completely irreconcilable.

$$T=1.9312\pm2.6044E-005$$ according to this fit

the green is the smoothed and interpolated data, right is the fft, left is the same fft zoomed in

My procedure with the data regarding the fft is to first find the offset by calculating the average value. Then I smooth data. Then I cut data so that I have 2^n point, and finally I interpolate points with the same number of starting points. After that, I ask the QtiPlot to perform FFT. The algoritm used to smooth is FFT filter, but I honestly haven't noticed a major difference when using some different algorythm.

• I am open to using some other program, I just want this to work D': – fazan Nov 17 '19 at 15:40
• Can you please post an image of the data? The time traces with the fit overlayed as well as the fft? – jgerber Nov 17 '19 at 16:23
• Are you comparing the 2.6 Hz to 1.94 sec? – Kyle Kanos Nov 17 '19 at 16:32
• @jgerber I added the images of the data, sorry for not insluding them originally – fazan Nov 17 '19 at 16:49
• @KyleKanos I guess? I'm not sure what you are asking me. I am using the fit as a check whether I am doing the fft right – fazan Nov 17 '19 at 16:49

$$T=1.94$$ sec is certainly compatible with the big, but noisy peak at .5Hz. Why are you worrying about the tiny peak at about 2.6Hz? Your data looks very noisy so random but meaningless peaks are to be expected.

I still don't understand why your FFT is so noisy given the smooth data of black points in the first plot. You say that you interpolate? Why do you do this? FFT works with discrete data sets. You presumable measured your amplitude against time at $$2^N$$ points and these are your black dots. (FFT workbest with data sets that are powers of 2). You should then apply FFT to this discrete data set to get the Fourier transform at $$2^N$$ values of the frequency. You then plot these with PlotPoints set equal to $$2^N$$. Did you do this? It looks athough you poltting our frequency with a resolution in excess of $$2^{-N}$$. If so, you probably introduced all sorts of aliasing artifacts.

One more thing! You said that you "smoothed". I though that by this you meant "apodized" Looking at your first and second plot, however, it looks as if you cut off the data suddenly at $$t=0$$ and $$t=40$$. If you kept those violent ending in the FT then your FT plot wll be full of rapid oscillation artifacts ("diffraction rings") at the frequency of (1/Time Range). These will completely swamp the data you want. Further, if you plot these high frequency oscillations without carefully choosing your plotting preferences, this can give the kind of cruddy FT plot that you have. Look up apodization on Wikipedia and implement it to slowly turn off your data at the starting and ending times.

• but, does't the fft give out the angular frequencies? – fazan Nov 17 '19 at 17:11
• The units on the axis in your plots say quite clearly that they are in Hz (i.e cycles per second) not in radians/per second. So your FFT is not giving you angular frequencies. T=2 gives frequency of .5Hz. – mike stone Nov 17 '19 at 17:13
• okay, thanks. and also, how can I tell my peak from the noise around zero (the two massive peaks)? – fazan Nov 17 '19 at 17:15
• I don't see any peaks around zero. Only the noisy one at .5Hz. I expect it is noisy because of the way you have messed up the data with the red lines in your first plot. Such crude time (looks like 1 sec sampling) resolution is sure to turn good data into bad. – mike stone Nov 17 '19 at 17:28
• the red lines are just the plot of the fit. in the fft I used smoothed raw data (green line). thank you for your answer though, it really cleared up this mess for me. – fazan Nov 17 '19 at 17:39

You don't provide enough information, so the following is just some speculation.

It is possible that the amplitude of the pendulum is large enough (as you know, the period is the same only for small amplitudes, and motion is not sinusoidal for large amplitudes), or the amplitude changes significantly during one experiment due to dissipation? In that case, there is no single inherent frequency, so different methods can provide different results.

• I am certain that I am within small-angle approximation regime, and while the amplitude does change, it is not a strongly damped pendulum. I added more pictures to better illustrate my predicament. – fazan Nov 17 '19 at 16:51