Error getting Fourier transform of a 1d signal

조회 수: 3 (최근 30일)
Anshuman Pal
Anshuman Pal 2020년 3월 2일
댓글: Star Strider 2020년 3월 5일
Hello,
I have an almost-sinusoidal signal (see attached file), which I believe is composed of a mixture of maybe 2 (or 3) Fourier modes:
I wanted to verify this by plotting its Fourier transform. I expected a flat signal with a bunch of peaks at the signal harmonics. However, using fft() on the signal gives me a 2d plot that makes absolutely no sense to me. Can someone please help me to understand what is going on?
  댓글 수: 4
Star Strider
Star Strider 2020년 3월 2일
Remember that you need to plot the absolute value (use the abs function) of the fresult fo the fft.
Also, since the signal has a D-C offset, subtract the mean of the signal before taking the fft in order to see the peaks more clearly:
FTsignal = fft(signal - mean(signal))/numel(signal);
assuming that ‘signal’ is a vector.
Anshuman Pal
Anshuman Pal 2020년 3월 3일
Thank you, this is precisely what I needed!
One final question --- I expect the wavenumber of one peak to be an integer multiple of the other. How can I verify/disprove this?

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2020년 3월 3일
The easiest way to determine the location of the peaks is to use the findpeaks function (with the appropriate name-value pairs to isolate your peaks of interest). I cannot guarantee that the frequencies will be integer multiples of each other, however findpeaks is the best way to identify them.
Improve the frequency resolution by increasing the length of the fft itself. Specify an appropriately large value for ‘n’ (the second argument) to increase the frequency resolution to whatever you want.
  댓글 수: 6
Anshuman Pal
Anshuman Pal 2020년 3월 5일
Thank you. And on what basis do you choose the values for the parameters MinPeakProminence in findpeaks and the number of bins in histfit?
Star Strider
Star Strider 2020년 3월 5일
As always, my pleasure!
I experimented with them until I got the result I wanted.
With respect to peak prominences, it is possible to get those directly from findpeaks by requesting extra outputs, then choosing the minimum that returns what you want. Here, I just experimented.
The same for histfit. I experimented with different bin numbers until I got what appeared to me to be an acceptable result.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spectral Estimation에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by