Question about taking fft of a set of real values, laying positive values of the vector, followed by 0, followed by negative values

1 次查看(过去 30 天)
I have the 1-dimensional FPU problem, and I have the following code:
YX(IT,1:N+1)=[0 Y(IT,1:N )];
sXF(IT,:)=imag(fft([YX(IT,1:N+1) 0 -YX(IT,N+1:-1:2)]))/sqrt(2*(N+1));
I am trying to understand why the positive values of YX, are laid with 0 and the negative values before taking the fft?
I tried to look in the matlab documentation for fft, and I see the following under "Compute the two-sided spectrum P2. Then compute the single-sided spectrum P1 based on P2 and the even-valued signal length L."
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1)
I see the signal is doubled here. Why is this done? And perhaps these two are unrelated questions.

回答(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