I need help with a for loop.

1 vue (au cours des 30 derniers jours)
Charles
Charles le 15 Juil 2014
Commenté : Ashish Gudla le 5 Août 2014
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 commentaire
Ashish Gudla
Ashish Gudla le 5 Août 2014
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);

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Fourier Analysis and Filtering dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by