21.07.2015 Views

"TMS320C55x DSP Library DSPLIB Programmer's Reference"

"TMS320C55x DSP Library DSPLIB Programmer's Reference"

"TMS320C55x DSP Library DSPLIB Programmer's Reference"

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

sineThe twiddle table should be aligned to the nx word boundary; i.e., thelowest log 2 (nx) least significant bits of the twiddle table starting addressshould be zero.Implementation Notes Implemented as a complex IFFT of size nx/2 followed by an unpack stage tounpack the real IFFT results. Therefore, Implementation Notes for the cfftfunction apply to this case.Notice that normally an IFFT of a real sequence of size N, produces a complexsequence of size N (or 2*N real numbers) that will not fit in the input sequence.To accommodate all the results without requiring extra memory locations, theoutput reflects only half of the spectrum (complex output). This still providesthe full information because an IFFT of a real sequence has even symmetryaround the center or nyquist point(N/2).When scale = 1, this routine prevents overflow by scaling by 2 at each IFFTintermediate stages and at the unpacking stage.ExampleSee examples/rifft subdirectorysineFunctionSineushort oflag = sine (DATA *x, DATA *r, ushort nx)(defined in sine.asm)Argumentsx[nx]r[nx]nxoflagPointer to input vector of size nx. x contains the angle inradians between [–pi, pi] normalized between (–1,1) in q15formatx = xrad /piFor example:45 o = pi/4 is equivalent to x = 1/4 = 0.25 = 0x200 in q15format.Pointer to output vector containing the sine of vector x inq15 formatNumber of elements of input and output vectors.nx ≥ 4Overflow flag. If oflag = 1, a 32-bit overflow has occurred. If oflag = 0, a 32-bit overflow has not occurred.4-88

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!