FIRMRInitAlloc

Allocates memory and initializes a multi-rate FIR filter state.

Syntax

Case 1: Operation on integer samples

IppStatus ippsFIRMRInitAlloc_16s(IppsFIRState_16s** ppState, const Ipp16s* pTaps, int tapsLen, int tapsFactor, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp16s* pDlyLine);

IppStatus ippsFIRMRInitAlloc32s_16s(IppsFIRState32s_16s** ppState, const Ipp32s* pTaps, int tapsLen, int tapsFactor, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp16s* pDlyLine);

IppStatus ippsFIRMRInitAlloc32s_16s32f(IppsFIRState32s_16s** ppState, const Ipp32f *pTaps, int tapsLen, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp16s* pDlyLine);

IppStatus ippsFIRMRInitAlloc32f_16s(IppsFIRState32f_16s** ppState, const Ipp32f* pTaps, int tapsLen, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp16s* pDlyLine);

IppStatus ippsFIRMRInitAlloc64f_16s(IppsFIRState64f_16s** ppState, const Ipp64f* pTaps, int tapsLen, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp16s* pDlyLine);

IppStatus ippsFIRMRInitAlloc64f_32s(IppsFIRState64f_32s** ppState, const Ipp64f* pTaps, int tapsLen, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp32s* pDlyLine);

IppStatus ippsFIRMRInitAlloc32sc_16sc(IppsFIRState32sc_16sc** ppState, const Ipp32sc* pTaps, int tapsLen, int tapsFactor, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp16sc* pDlyLine);

IppStatus ippsFIRMRInitAlloc32sc_16sc32fc(IppsFIRState32sc_16sc** ppState, const Ipp32fc* pTaps, int tapsLen, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp16sc* pDlyLine);

IppStatus ippsFIRMRInitAlloc32fc_16sc(IppsFIRState32fc_16sc** ppState, const Ipp32fc* pTaps, int tapsLen, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp16sc* pDlyLine);

IppStatus ippsFIRMRInitAlloc64fc_16sc(IppsFIRState64fc_16sc** ppState,const Ipp64fc* pTaps, int tapsLen, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp16sc* pDlyLine);

IppStatus ippsFIRMRInitAlloc64fc_32sc(IppsFIRState64fc_32sc** ppState, const Ipp64fc* pTaps, int tapsLen, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp32sc* pDlyLine);

Case 2: Operation on floating point samples

IppStatus ippsFIRMRInitAlloc_32f(IppsFIRState_32f** ppState, const Ipp32f* pTaps, int tapsLen, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp32f* pDlyLine);

IppStatus ippsFIRMRInitAlloc64f_32f(IppsFIRState64f_32f** ppState, const Ipp64f* pTaps, int tapsLen, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp32f* pDlyLine);

IppStatus ippsFIRMRInitAlloc_64f(IppsFIRState_64f** ppState, const Ipp64f* pTaps, int tapsLen, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp64f* pDlyLine);

IppStatus ippsFIRMRInitAlloc_32fc(IppsFIRState_32fc** ppState, const Ipp32fc* pTaps, int tapsLen, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp32fc* pDlyLine);

IppStatus ippsFIRMRInitAlloc64fc_32fc(IppsFIRState64fc_32fc** ppState, const Ipp64fc* pTaps, int tapsLen, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp32fc* pDlyLine);

IppStatus ippsFIRMRInitAlloc_64fc(IppsFIRState_64fc** ppState, const Ipp64fc* pTaps, int tapsLen, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp64fc* pDlyLine);

Parameters

pTaps

Pointer to the array containing the tap values. The number of elements in the array is tapsLen.

tapsLen

Number of elements in the array containing the tap values.

tapsFactor

Scale factor for the integer taps.

downFactor

Downsampling factor.

downPhase

Phase for downsampled signal.

upFactor

Upsampling factor.

upPhase

Phase for upsampled signal.

pDlyLine

Pointer to the array containing the delay line values. The number of elements in the array (tapsLen + upFactor - 1) / upFactor.

ppState

Pointer to the pointer to the FIR state structure to be created.

Description

The function ippsFIRMRInitAlloc is declared in the ipps.h file. This function allocates memory and initializes a multi-rate FIR filter state. The initialization functions copy the taps from the tapsLen-length array pTaps into the state structure ppState. To scale integer taps use the tapsFactor value. The array pDlyLine specifies the delay line values. If the pointer to the array pDlyLine is not NULL, the array content is copied into the state structure ppState, otherwise the delay line values in the state structure are initialized to 0.

If the state is not created, the initialization function returns an error status.

The function initializes the state structure ppState of a multi-rate filter; that is, a filter that internally upsamples and/or downsamples using a polyphase filter structure. It initializes the state structure in the same way as described for single-rate filters, but includes additional information about the required upsampling and downsampling parameters.

The parameter upFactor is the factor by which the filtered signal is internally upsampled (see description of the function ippsSampleUp for more details). That is, upFactor-1 zeros are inserted between each sample of the input signal.

The parameter upPhase is the parameter which determines where a non-zero sample lies within the upFactor-length block of upsampled input signal.

The parameter downFactor is the factor by which the FIR response obtained by filtering an upsampled input signal, is internally downsampled (see description of the function ippsSampleDown for more details). That is, downFactor-1 output samples are discarded from each downFactor-length output block of the upsampled filter response.

The parameter downPhase is the parameter which determines where non-discarded sample lies within a block of upsampled filter response.

If the delay line array pDlyLine is non-NULL, its length is defined as (tapsLen + upFactor - 1) / upFactor.

Code example "Using Multi-Rate FIR Functions" shows how to use the function ippsFIRMRInitAlloc_32f.

Return Values

ippStsNoErr

Indicates no error.

ippStsMemAllocErr

Indicates an error when no memory is allocated.

ippStsNullPtrErr

Indicates an error when pTaps or ppState is NULL.

ippStsFIRLenErr

Indicates an error when tapsLen is less than or equal to 0.

ippStsFIRMRFactorErr

Indicates an error when upFactor (downFactor) is less than or equal to 0.

ippStsFIRMRPhaseErr

Indicates an error when upPhase (downPhase) is negative, or greater than or equal to upFactor (downFactor).

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.