IIRLattice

Filters a source vector through a single-rate lattice IIR filter.

Syntax

Intel IPP style:

IppStatus ippsqIIRLatticeDirect_32f (const Ipp32f *pSrc , Ipp32f *pDst , Ipp32u srcLen , const Ipp32f* pkTaps , const Ipp32f* pvTaps , Ipp32u tapsLen , Ipp32f* pDlyLine );

IppStatus ippsqIIRLatticeDirectQ15_16s_Rms (const Ipp16s *pSrc , Ipp16s *pDst , Ipp32u srcLen , const Ipp16s* pkTaps , const Ipp16s* pvTaps , Ipp32u tapsLen , Ipp16s* pDlyLine );

IppStatus ippsqIIRLatticeDirectQ31_32s_Rm (const Ipp32s *pSrc , Ipp32s *pDst , Ipp32u srcLen , const Ipp32s* pkTaps , const Ipp32s* pvTaps , Ipp32u tapsLen , Ipp32s* pDlyLine );

DSP style:

typedef struct {
    Ipp16u  numStages;
    Ipp32f *pState;
    Ipp32f *pkCoeffs;
    Ipp32f *pvCoeffs;
} ippsq_iir_lattice_instance_f32;

void ippsq_iir_lattice_init_f32 (ippsq_iir_lattice_instance_f32 *S , uint16_t numStages , float32_t *pkCoeffs , float32_t *pvCoeffs , float32_t *pState , uint32_t blockSize );

void ippsq_iir_lattice_f32 (const ippsq_iir_lattice_instance_f32 *S , float32_t *pSrc , float32_t *pDst , uint32_t blockSize );

typedef struct {
    Ipp16u  numStages;
    Ipp16s *pState;
    Ipp16s *pkCoeffs;
    Ipp16s *pvCoeffs;
} ippsq_iir_lattice_instance_q15;

void ippsq_iir_lattice_init_q15 (ippsq_iir_lattice_instance_q15 *S , uint16_t numStages , q15_t *pkCoeffs , q15_t *pvCoeffs , q15_t *pState , uint32_t blockSize );

void ippsq_iir_lattice_q15 (const ippsq_iir_lattice_instance_q15 *S , q15_t *pSrc , q15_t *pDst , uint32_t blockSize );

typedef struct {
    Ipp16u  numStages;
    Ipp32s *pState;
    Ipp32s *pkCoeffs;
    Ipp32s *pvCoeffs;
} ippsq_iir_lattice_instance_q31;

void ippsq_iir_lattice_init_q31 (ippsq_iir_lattice_instance_q31 *S , uint16_t numStages , q31_t *pkCoeffs , q31_t *pvCoeffs , q31_t *pState , uint32_t blockSize );

void ippsq_iir_lattice_q31 (const ippsq_iir_lattice_instance_q31 *S , q31_t *pSrc , q31_t *pDst , uint32_t blockSize );

Include Files

ippsq.h

dsp.h

Parameters

pSrc

Pointer to the source vector.

pDst

Pointer to the destination vector.

srcLen, blockSize

Number of elements in the source/destination vectors; can be zero.

pkTaps, pkCoeffs

Pointer to the array containing the lattice coefficients. The number of elements in the array is tapsLen (numTaps for DSP).

pvTaps, pvCoeffs

Pointer to the array containing the ladder coefficients. The number of elements in the array is tapsLen+1 (numTaps+1 for DSP).

tapsLen, numStages

Number of elements in the array containing the tap values.

pDlyLine, pState

Pointer to the array containing the state line values.

Description

The figure below shows the structure of a lattice IIR filter:

This function passes a source vector pSrc containing srcLen samples through a single-rate filter, and stores the resulting srcLen samples in pDst. The values of lattice coefficients k m are specified in the tapsLen-length array pkTaps, and ladder coefficients v m are specified in the (tapsLen+1)-length array pvTaps.

The return value y[n] is defined by the formula for a single-rate IIR filter:

f 0[n] = x[n]

f m+1[n] = f m[n] - k mg m[n]

g m[n] = g m+1[n] + k mf m+1[n]



where:

  • x[n] is the sample to be filtered

  • k m denotes the lattice coefficients

  • v m denotes the ladder coefficients

  • m = 0, … , tapsLen-1.

Note

Parameters in the above description have Intel IPP-style names. For the corresponding DSP-style parameter names, refer to the Parameters section.

Intel IPP style: When using Intel IPP-style APIs, you do not need to call any initialization functions. Intel IPP-style functions directly get all necessary parameters as arguments.

Function flavors with the _Rm suffix perform rounding down.

Function flavors with the _Rms suffix perform rounding down and saturation of the resulting value if it exceeds the data range.

The number of elements in the pDlyLine array should be at least tapsLen+srcLen.

DSP style: Each function type (f32, q15, and q31) has its own state structure, which must be initialized with the corresponding initialization function. The initialization function copies arguments into the state structure and sets the pState array to zero. The number of elements in the pState array should be at least numStages+blockSize.

Scaling, Truncation, Saturation

Intel IPP style:

Function Description
ippsqIIRLatticeDirectQ15_16s_Rms

The pSrc, pDst, pkTaps, pvTaps, and pDlyLine values are represented in Q15 format. For each cascade, the function shifts the result of multiplication of Q15 numbers right by 15 bits, adds the resulting value to the data from the previous cascade, and saturates it in the [IPP_MIN_16S, IPP_MAX_16S] range. The function is not protected from internal overflow.

ippsqIIRLatticeDirectQ31_32s_Rm

The pSrc, pDst, pkTaps, pvTaps, and pDlyLine values are represented in Q31 format. For each cascade, the function shifts the result of multiplication of Q31 numbers right by 31 bits, adds the resulting value to the data from the previous cascade, and does not perform saturation.

DSP style:

Function Description
ippsq_iir_lattice_q15

The pSrc, pDst, pkCoeffs, pvCoeffs, and pState values are represented in Q15 format. For each cascade, the function shifts the result of multiplication of Q15 numbers right by 15 bits, adds the resulting value to the data from the previous cascade, and saturates it in the [IPP_MIN_16S, IPP_MAX_16S] range. The function is not protected from internal overflow.

ippsq_fir_sparse_q31

The pSrc, pDst, pkCoeffs, pvCoeffs, and pState values are represented in Q31 format. For each cascade, the function shifts the result of multiplication of Q31 numbers right by 31 bits, adds the resulting value to the data from the previous cascade, and does not perform saturation.

Return Values

ippStsNoErr

Indicates no error.

ippStsSizeErr

Indicates an error when tapsLen is equal to zero.

ippStsNullPtrErr

Indicates an error when any of the specified pointers is NULL.
For more complete information about compiler optimizations, see our Optimization Notice.