How do I correctly graph FFT results in signal processing?

In summary, the conversation involves someone seeking help with graphing frequency data using excel and the fast Fourier transform (FFT). They are having trouble graphing the results and someone suggests removing the DC zero values. The conversation also includes a discussion on sample rate and frequency domains. The suggested solution involves working out constants and plotting the data in time and frequency.
  • #1
phenommsu1
1
0
Hello all. I am working on a problem for class that is taking some time data and changing it to frequency data. I am using excel and the fast Fourier transform(fft).

I am having a problem graphing the results. I am very new to signal processing.

I am only given the data which is 1024 points long.
I will only ask for help with one because if I figure this one out I can do the rest.

The period is .117. Making the sampline rate 1/.117.

I have the two columns of data here is an example.
The first column is (1*(1/.117)/1024) and the second is the fft values.

pres43 abs imag
0.006643282 162509.4667
0.013286565 388.025981
0.019929847 600.4277992
0.026573129 499.1078937
0.033216412 447.4588355
0.039859694 102.7576392
0.046502976 276.7567742
0.053146259 358.0531147
0.059789541 289.5977569
0.066432823 129.8177899
0.073076105 91.85556182
0.079719388 250.3116294
0.08636267 35.77585877
0.093005952 218.271273
0.099649235 216.1229107
0.106292517 215.5078932
0.112935799 110.6895935
0.119579082 153.2837982
0.126222364 194.9400366
0.132865646 96.83955867

My problems is that I don't know how to graph the values correctly. The graph as it stands is not right. Someone told me that I have to remove the DC zero values? I do not know how to do that and that is why I am asking for help.

Thank you
 
Engineering news on Phys.org
  • #2
May be useful

This may be helpful, it may be completely wrong... you presumably understand it better than I do!

I've never been taught Fourier transforms, but I've read about them and used them occasionally - I can't quite make sense of you're data, but here's my basic understanding of FFT & graphing it.

Data in
y = x(t) {REAL amplitude as function of time}

Data out
p = A * g(Bf) {COMPLEX "phasors" as function of frequency; A & B are constants}

|p| = amplitude of wave with frequency f
arg p = phase offset of wave with frequency f

Presumably, you want to produce a graph of amplitude vs. frequency - so by working out the constants A & B, you can produce a table of amplitudes (and if needed, phase offsets) for corresponding frequencies. Once this is done, a simple scatter or line graph will give you what you want (possibly using logarithmic axes).

Also, if your sample rate is too low, or a strong wave with period larger than the data length exists, then you may get a large rise in amplitude towards the lower frequencies.
 
Last edited:
  • #3
if you have N samples in time with Ts(Time sampling or samping rate) so you can write the time like
t=(0:N-1)*Ts;
in the frequency demain, you have Fs=1/Ts, and you have Nfft=1024, so the frequency can be written like
f=(0:Nfft-1)*Fs/Nfft.
Now you can plot your data in time & frequency:
plot(t,data);// in time
plot(f,fft(data,Nfft)); // in frequency.
good luck.
 
  • #4
Bachir said:
if you have N samples in time with Ts(Time sampling or samping rate) so you can write the time like
t=(0:N-1)*Ts;
in the frequency demain, you have Fs=1/Ts, and you have Nfft=1024, so the frequency can be written like
f=(0:Nfft-1)*Fs/Nfft.
Now you can plot your data in time & frequency:
plot(t,data);// in time
plot(f,fft(data,Nfft)); // in frequency.
good luck.

this is in matlab?
 
  • #5
TheAnalogKid83 said:
this is in matlab?
Yes if you want but if you are not familiar with MATLAB just use
f=(0:Nfft-1)*Fs/Nfft to get the spectum bins at right frequencies.
 

1. What is FFT and how does it work?

FFT stands for Fast Fourier Transform, and it is a mathematical algorithm used for signal processing. It works by converting a signal from its original time or spatial domain into a frequency domain, allowing us to analyze and manipulate the signal's frequency components.

2. What are the applications of FFT in signal processing?

FFT has a wide range of applications in signal processing, including audio and image processing, data compression, and digital filtering. It is also commonly used in fields such as telecommunications, radar, and medical imaging.

3. How accurate is FFT in analyzing signals?

FFT is a highly accurate method for analyzing signals, as it utilizes precise mathematical calculations. However, the accuracy can be affected by factors such as sampling rate, signal length, and noise interference.

4. Can I perform FFT on any type of signal?

FFT can be applied to many types of signals, including continuous and discrete signals, periodic and non-periodic signals, and even complex signals. However, the signal must be digital, meaning it has been converted into a series of discrete data points.

5. Are there any limitations or drawbacks to using FFT in signal processing?

One limitation of FFT is the trade-off between time and frequency resolution. In order to achieve a high frequency resolution, the time resolution will be lower, and vice versa. Additionally, FFT assumes that the signal is stationary, meaning it does not change over time, which may not always be the case in real-world applications.

Similar threads

Replies
6
Views
925
Replies
9
Views
2K
  • Electrical Engineering
Replies
1
Views
1K
  • Electrical Engineering
Replies
0
Views
249
Replies
7
Views
806
  • Electrical Engineering
Replies
14
Views
3K
  • Electrical Engineering
Replies
2
Views
974
  • Electrical Engineering
Replies
4
Views
969
Replies
3
Views
1K
  • Electrical Engineering
Replies
4
Views
2K
Back
Top