Computes bandpass FIR filter coefficients.
IppStatus ippsFIRGenBandpass_64f(Ipp64f rLowFreq, Ipp64f rHighFreq, Ipp64f* pTaps, int tapsLen, IppWinType winType, IppBool doNormal);
rLowFreq |
Normalized low cutoff frequency, must be in the range (0, 0.5) and less than rHighFreq. |
rHighFreq |
Normalized high cutoff frequency, must be in the range (0, 0.5) and greater than rLowFreq. |
pTaps |
Pointer to the array where computed tap values are stored. The number of elements in the array is tapsLen. |
tapsLen |
Number of elements in the array containing the tap values; should be equal or greater than 5. |
winType |
Specifies what type of window is used in computations. The winType must have one of the following values: |
ippWinBartlett Bartlett window; | |
ippWinBlackman Blackman window; | |
ippWinHamming Hamming window; | |
ippWinHann Hann window. | |
doNormal |
Specifies normalized or non-normalized sequence of the filter coefficients is computed. The doNormal must have one of the following values: |
ippTrue The function computes normalized sequence of coefficients. | |
ippFalse The function computes non-normalized sequence of coefficients. |
The function ippsFIRGenBandpass is declared in the ipps.h file. This function computes tapsLen coefficients for bandpass FIR filter with the cutoff frequencies rLowFreq and rHighFreq by windowing the ideal infinite filter coefficients. The parameter winType specifies the type of the window. For more information on window types used by the function, see Windowing Functions. The computed coefficients are stored in the array pTaps.
The example below shows how the function ippsFIRGenBandpass can be used.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error when the pTaps pointer is NULL. |
ippStsSizeErr |
Indicates an error when the tapsLen is less than 5, or rLowFreq is greater than or equal to rHighFreq, or one of the frequency parameters rLowFreq and rHighFreq is out of the range. |
void func_BandPass()
{
int len = 512;
Ipp64f pDst[512];
Ipp64f magn = 4095;
Ipp64f rLowFreq = 0.2;
Ipp64f rHighFreq = 0.3;
int tapslen = 27;
int numIters = 512;
IppsFIRState_64f* pState;
IppStatus st;
Ipp64f* FIRDst = ippsMalloc_64f(512*sizeof(Ipp64f));
Ipp64f* taps = ippsMalloc_64f(tapslen*sizeof(Ipp64f));
Ipp64f* pDL = ippsMalloc_64f(tapslen*sizeof(Ipp64f));
ippsZero_64f(pDL,tapslen);
ippsVectorJaehne_64f(pDst, len, magn);// //generate source vector
//computes tapsLen coefficients for bandstop FIR filter
ippsFIRGenBandpass_64f(rLowFreq, rHighFreq, taps, tapslen, ippWinHamming, ippTrue);
////filter an input vector
ippsFIRInitAlloc_64f(&pState, taps,tapslen, pDL);
ippsFIR_64f(pDst, FIRDst, numIters, pState);
}
Result:
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.