Eugene
Guest
|
Posted:
Wed Dec 15, 2004 1:35 pm Post subject:
FFT build with DSP |
|
|
Hello Shawn Steenhagen,
yes I have this document,
can you tell me, if I think right?
so, I take my output, a then I should build a magnitude of FFT of
output. abs(x) (I think, I need it that's why, because I take only
positive magnitude)
I found on mathworks.de one text, it stand there, that I should "scale
the fft so that it is not a function of the length of output." also
X=X/sizeof(X)
then I should take the square of the magitude. (Why?)
after this functions I can show my output array with "code compese
studio" with graph/time_single. But I see only my array Values, but no
frequency.
Should I change any properties there?
thank you |
|
Shawn Steenhagen
Guest
|
Posted:
Fri Dec 17, 2004 12:36 am Post subject:
Re: FFT build with DSP |
|
|
The Y(n) = fft(x) is a complex result. i.e. each bin is a complex number:
Y(n) = a(n) + b(n)*j.
To take the magnitude of a complex number:
|Y(n)| = sqrt( a(n)^2 + b(n)^2);
Using the 55 rfft( ) function the real and imaginary part of the result are
stored in consecutive memory locations in the result array, so if I Call
rfft(xin, etc.) I calculate the magnitude as
Ymag[1] = sqrt( xin[2]*xin[2] + xin[3]*xin[3])
Ymag[2] = sqrt( xin[4]*xin[4] + xin[5]*xin[5])
etc. (use a for loop)
Then you can use CCS to plot the vector Ymag[] and you will see the
magnitude.
(of course the above assumes a sqrt( ) function exists for the 55. It may
be easier to just look at the magnitude squared )
YMagsq[1] = xin[2]*xin[2] + xin[3]*xin[3]
I'm not sure you are understanding some basic concepts with regard to the
FFT and complex arithmetic. I suggest reading up on it.
-Shawn
"Eugene" <johnbesel@web.de> wrote in message
news:6484110f.0412150035.76c8a8e4@posting.google.com...
| Quote: | Hello Shawn Steenhagen,
yes I have this document,
can you tell me, if I think right?
so, I take my output, a then I should build a magnitude of FFT of
output. abs(x) (I think, I need it that's why, because I take only
positive magnitude)
I found on mathworks.de one text, it stand there, that I should "scale
the fft so that it is not a function of the length of output." also
X=X/sizeof(X)
then I should take the square of the magitude. (Why?)
after this functions I can show my output array with "code compese
studio" with graph/time_single. But I see only my array Values, but no
frequency.
Should I change any properties there?
thank you |
|
|