필터 지우기
필터 지우기

I need help with a for loop.

조회 수: 1 (최근 30일)
Charles
Charles 2014년 7월 15일
댓글: Ashish Gudla 2014년 8월 5일
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