Allocates memory and initializes the state structure for the biquad IIR filter.
Case 1: Operation on integer samples
IppStatus ippsIIRInitAlloc32s_BiQuad_16s(IppsIIRState32s_16s** ppState, const Ipp32s* pTaps, int numBq, int tapsFactor, const Ipp32s* pDlyLine);
IppStatus ippsIIRInitAlloc32s_BiQuad_16s32f(IppsIIRState32s_16s** ppState, const Ipp32f* pTaps, int numBq, const Ipp32s* pDlyLine);
IppStatus ippsIIRInitAlloc32f_BiQuad_16s(IppsIIRState32f_16s** ppState, const Ipp32f* pTaps, int numBq, const Ipp32f* pDlyLine);
IppStatus ippsIIRInitAlloc64f_BiQuad_16s(IppsIIRState64f_16s** ppState, const Ipp64f* pTaps, int numBq, const Ipp64f* pDlyLine);
IppStatus ippsIIRInitAlloc64f_BiQuad_32s(IppsIIRState64f_32s** ppState, const Ipp64f* pTaps, int numBq, const Ipp64f* pDlyLine);
IppStatus ippsIIRInitAlloc64f_BiQuad_DF1_32s(IppsIIRState64f_32s** ppState, const Ipp64f* pTaps, int numBq, const Ipp32s* pDlyLine);
IppStatus ippsIIRInitAlloc32sc_BiQuad_16sc(IppsIIRState32sc_16sc** ppState, const Ipp32sc* pTaps, int numBq, int tapsFactor, const Ipp32sc* pDlyLine);
IppStatus ippsIIRInitAlloc32sc_BiQuad_16sc32fc(IppsIIRState32sc_16sc** ppState, const Ipp32fc* pTaps, int numBq, const Ipp32sc* pDlyLine);
IppStatus ippsIIRInitAlloc32fc_BiQuad_16sc(IppsIIRState32fc_16sc** ppState, const Ipp32fc* pTaps, int numBq, const Ipp32fc* pDlyLine);
IppStatus ippsIIRInitAlloc64fc_BiQuad_16sc(IppsIIRState64fc_16sc** ppState, const Ipp64fc* pTaps, int numBq, const Ipp64fc* pDlyLine);
IppStatus ippsIIRInitAlloc64fc_BiQuad_32sc(IppsIIRState64fc_32sc** ppState, const Ipp64fc* pTaps, int numBq, const Ipp64fc* pDlyLine);
Case 2: Operation on floating point samples
IppStatus ippsIIRInitAlloc_BiQuad_32f(IppsIIRState_32f** ppState, const Ipp32f* pTaps, int numBq, const Ipp32f* pDlyLine);
IppStatus ippsIIRInitAlloc_BiQuad_DF1_32f(IppsIIRState_32f** ppState, const Ipp32f* pTaps, int numBq, const Ipp32f* pDlyLine);
IppStatus ippsIIRInitAlloc64f_BiQuad_32f(IppsIIRState64f_32f** ppState, const Ipp64f* pTaps, int numBq, const Ipp64f* pDlyLine);
IppStatus ippsIIRInitAlloc_BiQuad_64f(IppsIIRState_64f** ppState, const Ipp64f* pTaps, int numBq, const Ipp64f* pDlyLine);
IppStatus ippsIIRInitAlloc_BiQuad_32fc(IppsIIRState_32fc** ppState, const Ipp32fc* pTaps, int numBq, const Ipp32fc* pDlyLine);
IppStatus ippsIIRInitAlloc64fc_BiQuad_32fc(IppsIIRState64fc_32fc** ppState, const Ipp64fc* pTaps, int numBq, const Ipp64fc* pDlyLine);
IppStatus ippsIIRInitAlloc_BiQuad_64fc(IppsIIRState_64fc** ppState, const Ipp64fc* pTaps, int numBq, const Ipp64fc* pDlyLine);
pTaps |
Pointer to the array containing the taps. The number of elements in the array is 6*numBq. |
tapsFactor |
Scale factor for the taps of integer data type. |
numBq |
Number of cascades of biquads. |
pDlyLine |
Pointer to the array containing the delay line values. |
ppState |
Pointer to the pointer to the biquad IIR state structure. |
The function ippsIIRInitAlloc_BiQuad is declared in the ipps.h file. This function allocates memory and initializes a biquad (BQ) IIR filter state. The initialization functions copy the taps from the array pTaps into the state structure ppState. The tapsFactor is used to scale integer tap values. The array pDlyLine specifies the delay line values. The number of elements in the array pDlyLine is 4*numBq for the function flavor ippsIIRInitAlloc_BiQuad_DF1, and 2* numBq for all other flavors. If the pointer to the array pDlyLine is not NULL, the array content is copied into the context structure, otherwise the delay values of the state structure are set to 0.
The function flavor ippsIIRInitAlloc_BiQuad_DF1 initializes the filter with the biquad section in the direct form I (DF1) [Opp75]. In this case the delay line values are arranged in the array as follows:
x0,-2, x0,-1, B0,2, y0,-2, y0,-1, x1,-2, x1,-1, y1,-2, y1,-1, ... xnumBq-1,-2, xnumBq-1,-1, y numBq-1,-2, y numBq-1,-1.
A biquad IIR filter is defined by a cascade of biquads. The number of cascades of biquads is specified by the numBq value. The 6*numBq -length array pTaps specifies the taps arranged in the array as follows:
B0,0, B0,1, B0,2, A0,0, A0,1, A0,2; B1,0, B1,1, B1,2, A1,0, A1,1, A1,2; . . . AnumBq-1,2
An,0 ≠ 0, Bn,0 ≠ 0
If the state is not created, the initialization function returns an error status.
The initialization functions with the 32s_32f suffixes called with floating-point taps automatically convert the taps into integer data type.
In all cases the data is converted into integer type with scaling for better precision. Example Using the ippsIIR Function to Filter a Sample shows how to convert floating-point taps into integer data type.
ippStsNoErr |
Indicates no error. |
ippStsMemAllocErr |
Indicates an error when no memory allocated. |
ippStsNullPtrErr |
Indicates an error when pTaps or ppState is NULL. |
ippStsIIROrderErr |
Indicates an error when numBq is less than or equal to 0. |
ippStsDivByZeroErr |
Indicates an error when A0, An,0 or Bn,0 is equal to 0. |
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.