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.

fltoq15Figure 4–21. r Array in Memoryoldest x( ) entrynewest x( ) entryr(0)r(1)•r(nx–2)r(nx–1)lowest memory addresshighest memory addressExampleBenchmarksSee examples/firs subdirectory(preliminary)Cycles † Core: nx[5 + (nh–2)]Overhead: 72Code size(in bytes)133† Assumes all data is in on-chip dual-access RAM and that there is no bus conflict due to twiddletable reads and instruction fetches (provided linker command file reflects those conditions).fltoq15FunctionFloating-point to Q15 Conversionushort errorcode = fltoq15 (float *x, DATA *r, ushort nx)(defined in fltoq15.asm)Argumentsx[nx]r[nx]nxerrorcodePointer to floating-point input vector of size nx. x shouldcontain the numbers normalized between (–1,1). Theerrorcode returned value will reflect if that condition is notmet.Pointer to output data vector of size nx containing the q15equivalent of vector x.Length of input and output data vectorsThe function returns the following error codes:1 – if any element is too large to represent in Q15 format2 – if any element is too small to represent in Q15 format3 – both conditions 1 and 2 were encounteredDescriptionConvert the IEEE floating-point numbers stored in vector x into Q15 numbersstored in vector r. The function returns the error codes if any element x[i] is notrepresentable in Q15 format.Function Descriptions4-49

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

Saved successfully!

Ooh no, something went wrong!