Dspf_Sp_Convol - Texas Instruments TMS320C67 DSP Series Programmer's Reference Manual

Library
Hide thumbs Also See for TMS320C67 DSP Series:
Table of Contents

Advertisement

DSPF_sp_convol

DSPF_sp_convol
Function
Arguments
Description
Algorithm
4-50
Single-precision convolution
void DSPF_sp_convol (float *x, float *h, float *r, int nh, int nr)
x
Pointer to real input vector of size = nr+nh-1 a typically
contains input data (x) padded with consecutive nh - 1 zeros
at the beginning and end.
h
pointer to real input vector of size nh in forward order. h
typically contains the filter coefs.
r
Pointer to real output vector of size nr.
Number of elements in vector b. Note: nh ≤ nr nh is typically
nh
noted as m in convol formulas. nh must be a multiple of 2.
nr
Number of elements in vector r. nr must be a multiple of 4.
This function calculates the full-length convolution of real vectors x and h using
time-domain techniques. The result is placed in real vector r. It is assumed that
input vector x is padded with nh-1 no of zeros in the beginning and end. It is
assumed that the length of the input vector h, nh, is a multiple of 2 and the
length of the output vector r, nr, is a multiple of 4. nh is greater thanor equal
to 4 and nr is greater than or equal to nh. The routine computes 4 output sam-
ples at a time. x and h are assumed to be aligned on a double word boundary.
This is the C equivalent of the assembly code. Note that the assembly code
is hand optimized and restrictions may apply.
void DSPF_sp_convol(float *x, float *h, float *r, short nh,
short nr)
{
short
ocntr, icntr;
float
acc ;
for (ocntr = nr ; ocntr > 0 ; ocntr--)
{
acc = 0 ;
for (icntr = nh ; icntr > 0 ; icntr--)
{
acc += x[nr-ocntr+nh-icntr]*h[(icntr-1)];
}
r[nr-ocntr] = acc;
}
}

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C67 DSP Series and is the answer not in the manual?

Questions and answers

Table of Contents