DSPF_sp_fir_cplx
4.4 Filtering and Convolution
DSPF_sp_fir_cplx
Function
Arguments
Description
Algorithm
4-38
Single-precision complex finite impulse response filter
void DSPF_sp_fir_cplx (const float * restrict x, const float * restrict h, float *
restrict r, int nh, int nr)
x[2*(nr+nh-1)]
Pointer to complex input array. The input data pointer x
must point to the (nh)th complex element; i.e., element
2*(nh-1).
h[2*nh]
Pointer to complex coefficient array (in normal order).
r[2*nr]
Pointer to complex output array.
nh
Number of complex coefficients in vector h.
nr
Number of complex output samples to calculate.
This function implements the FIR filter for complex input data. The filter has
nr output samples and nh coefficients. Each array consists of an even and odd
term with even terms representing the real part and the odd terms the imagi-
nary part of the element. The coefficients are expected in normal order.
This is the C equivalent of the assembly code. Note that the assembly code
is hand optimized and restrictions may apply.
void DSPF_sp_fir_cplx(const float * x, const float * h,
float * restrict r, int nh, int nr)
{
int i,j;
float imag, real;
for (i = 0; i < 2*nr; i += 2)
{
imag = 0;
real = 0;
for (j = 0; j < 2*nh; j += 2)
{
real += h[j] * x[i-j] - h[j+1] * x[i+1-j];
imag += h[j] * x[i+1-j] + h[j+1] * x[i-j];
}
r[i] = real;
r[i+1] = imag;
}
}
Need help?
Do you have a question about the TMS320C67 DSP Series and is the answer not in the manual?
Questions and answers