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.

firsnh2oflagHalf the number of coefficients of the filter (due tosymmetry there is no need to provide the otherhalf). For example, if the filter coefficients are {h0,h1, h2, h2, h1, h0}, then nh2 = 3. Must be aminimum value of 3. For smaller filters, zero pad thecoefficients to meet the minimum value.Overflow error flag (returned value) If oflag = 1, a 32-bit data overflow occurred in anintermediate or final result.If oflag = 0, a 32-bit overflow has not occurred.DescriptionComputes a real FIR filter (direct-form) with nh2 symmetric coefficients usingthe FIRS instruction approach. The filter is assumed to have a symmetric impulseresponse, with the first half of the filter coefficients stored in the array h.The real input data is stored in vector x. The filter output result is stored in vectorr. This function maintains the array dbuffer containing the previous delayedinput values to allow consecutive processing of input data blocks. This functioncan be used for both block-by-block (nx ≥ 2) and sample-by-sample filtering(nx = 1). In-place computation (r = x) is allowed.Algorithmnh21r[j] h,...,[k]* (x[j k] x[j k 2*nh2 1] )k00 j nxOverflow Handling MethodologyNo scaling implemented for overflow prevention.Special Requirementsnh must be a minimum value of 3. For smaller filters, zero pad the h[] array.Coefficient array h[nh2] must be located in internal memory since it is accessedusing the C55x coefficient bus, and that bus does not have accessto external memory.Implementation Notes The first element in the dbuffer array (index = 0) is the entry index for the inputhistory. It is treated as an unsigned 16-bit value by the function even thoughit has been declared as signed in C. The value of the entry index is equal tothe index – 1 of the oldest input entry in the array. The remaining elementsmake up the input history. Figure 4–19 shows the array in memory with anentry index of 2. The newest entry in the dbuffer is denoted by x(j–0), whichin this case would occupy index = 3 in the array. The next newest entry isx(j–1), and so on. It is assumed that all x() entries were placed into the arrayby the previous invocation of the function in a multiple-buffering scheme.The dbuffer array actually contains one more history value than is needed toimplement this filter. The value x(j–2*nh2) does not enter into the calculationsFunction Descriptions4-47

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

Saved successfully!

Ooh no, something went wrong!