hey guys, i need help to save the peak values of my FFT waveform. Is there a function i can use??

2 次查看(过去 30 天)
hey guys, Im doing an fft on a nonsinusoidal waveform, my FFt graph has a fundamental and harmonics. I would like to save the magnitude values of the fundamental and the harmonics plus thier corresponding frequencies. I tried the find peak function but that gave me all the peaks including the noise values. I only want the fundamental and the harmonic components. Can anyone help me? I will attach a picture of my FFt waveform

回答(1 个)

Star Strider
Star Strider 2016-1-28
The findpeaks function will do everything you asked. It has a number of name-value pair arguments such as 'MinPeakHeight' and 'MinPeakDistance' that will constrain the results it returns. (These have been expanded in recent releases, so earlier versions may not have all of them.)
  4 个评论
Image Analyst
Image Analyst 2016-1-28
The "workspace function" displays the workspace panel in the MATLAB development environment so you can see your variables. It is not used for saving variables to the workspace. The variables are already in the workspace immediately after calling findpeaks().
The save() function is used to save those variables to a disk file, in case you want to do that.
We have no idea what threw the error you mentioned. Please copy ALL THE RED TEXT and paste it back here so we can see the actual code and the actual error message.
Star Strider
Star Strider 2016-1-28
I’m fairly certain Olando is referring to the To Workspace block. There are a number of options for it.
I’ve not used Simulink in a while, and I’ve not used that particular sink, so since we’re lacking in other details as well, we can only guess.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by