I’m suppose to do some work with Fourier transformations and I’m still really confused.
I’m given a signal (in this case it is f[t] = sin(2 pi s t / N) where s = 8 and N = 128)
And I’m suppose to find the Real, Imaginary, Phase, and Magnitude.
I understand how to get the Real and Imaginary, but the Phase and the Magnitude are beyond me…
the sudo code for getting the Real and the Imaginary is:
for u = 0 to M-1 do
F[u].real = 0
F[u].imag = 0
for x = 0 to M-1 do
F[u].real += f[x] * cos(- 2 * pi * u * x / M)
F[u].imag += f[x] * sin(- 2 * pi * u * x / M)
end do
F[u].real /= M
F[u].imag /= M
end do
Now somewhere in there is the phase and the magnitude, but where?!
Thanks!
Also, some programmer-equse explination of the basics of FTs would be wonderful as well!
If you think to real and imaginary components as coordinates in an XY plane then the phase is the angle between the vector and the X+ axis, and the magnitude is the length of the vector.
To compute then you just need