I need help with a for loop.

1 次查看(过去 30 天)
Charles
Charles 2014-7-15
I have used the FFT to deconstruct a signal. Now i need to use the given data to reconstruct the waveform with the data extrapolated from the FFT.
I have manually reconstructed a the peeks by assigning variables.
ie. p15=(2.35/141)*sin(2*pi*15*70.922*t-2.94);
However there are 141 data points. The equation in need to program would be (MagFFT/141)*sin(2*pi*BIN#*70.992*t-Phase)
So MagFFT is a variable that corresponds to the magnitued determined from the fft. I need the Bin number to multiply by the change in frequency (70.992)
And finally the variable Phase needs needs to be entered into the eqution aswell.
So hopfully this is clear
I need a for loob to the work the following equation
A*sin(2*pi*B*(70.992)*t+C)
A=MagFFT=Magnitude from FFT B=Bin number C=Phase=phase is a defined variable.
I have attached the session below i that is helpfull.
  1 个评论
Ashish Gudla
Ashish Gudla 2014-8-5
Assuming all you are trying to do is apply the equation for each value in the vector, you could probably do something like this
result = A.*sin(2*pi.*B.*(70.992).*t + C);

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by