DSPRelated.com
Forums

FFT build with DSP

Started by Eugene December 14, 2004
Hello Shawn Steenhagen,

I didn't understand you message,

you wrote:
"
The output of the rfft( ) is a complex result in the form:
y(0)Re y(nx/2)Im  (DC and Nyquist)
y(1)Re y(1)Im
y(2)Re y(2)Im
etc.
"

what does it mean? 

If I use rfft(), then I thoght, I should get a real numbers of fft.
after use rfft() I have one array with numbers of result. if I want to
show it in "code compose studio" from DSP, can I use
Graph/time-Frequency and then time_signal?
I tryed to do it, but I didn't get one peak with sine input.
How can I be sure, that my output is correct ?

thanks in advance
Eugene wrote:
> If I use rfft(), then I thoght, I should get a real numbers of fft.
A real FFT takes reals as the input, but it still produces complex numbers as the output. The FT of a real signal has a symmetric output. A real FFT takes advantage of that by not calculating the portion of the spectrum from N/2 to N-1 (since it's equal to the portion from 0 to N/2-1). -- Jim Thomas Principal Applications Engineer Bittware, Inc jthomas@bittware.com http://www.bittware.com (603) 226-0404 x536 Nothing is ever so bad that it can't get worse. - Calvin
The text I inserted was basically a cut -n- paste from the TI DSP LIB user's
guide. (SPRA480).  Do you have this document?

If your input to the function rfft( ) is an array x[NX], then the COMPLEX
result is stored within x[] in the following form:
x[0],x[1] =  [y(0)Re] [y(nx/2)Im]  (DC and Nyquist)
x[2],x[3] =  [y(1)Re] [y(1)Im]       (bin 1 real and imaginary part)
x[4],x[5]=   [y(2)Re] [y(2)Im]        (bin 2 real and imaginary part)
etc.

If you want to graph the magnitude of the FFT result you'll need to do some
additional computaions before asking CCS to graph it, mainly take the square
root of the sum of squares of the real and imaginary part of each bin.

-Shawn



"Eugene" <johnbesel@web.de> wrote in message
news:6484110f.0412140311.67ead158@posting.google.com...
> Hello Shawn Steenhagen, > > I didn't understand you message, > > you wrote: > " > The output of the rfft( ) is a complex result in the form: > y(0)Re y(nx/2)Im (DC and Nyquist) > y(1)Re y(1)Im > y(2)Re y(2)Im > etc. > " > > what does it mean? > > If I use rfft(), then I thoght, I should get a real numbers of fft. > after use rfft() I have one array with numbers of result. if I want to > show it in "code compose studio" from DSP, can I use > Graph/time-Frequency and then time_signal? > I tryed to do it, but I didn't get one peak with sine input. > How can I be sure, that my output is correct ? > > thanks in advance