Developer Reference

  • 2020
  • 07/15/2020
  • Public Content
Contents

ResamplePolyphaseGetFixedFilter

Gets polyphase resampling filter coefficients.

Syntax

IppStatus ippsResamplePolyphaseGetFixedFilter_16s(Ipp16s*
pDst
, int
step
, int
height
, const IppsResamplingPolyphaseFixed_16s*
pSpec
);
IppStatus ippsResamplePolyphaseGetFixedFilter_32f(Ipp32f*
pDst
, int
step
, int
height
, const IppsResamplingPolyphaseFixed_32f*
pSpec
);
Include Files
ipps.h
Domain Dependencies
Headers:
ippcore.h
,
ippvm.h
Libraries:
ippcore.lib
,
ippvm.lib
Parameters
pDst
The pointer to the output vector of filter coefficients.
step
The row step in
pDst
vector.
height
The number of filters (the number of rows in
pDst
vector).
pSpec
The pointer to the resampling state structure.
Description
This function exports filter coefficients from the polyphase resampling structure. If the
step
value is less than the filter length, only first
step
coefficients are exported.
Return Values
ippStsNoErr
Indicates no error.
ippStsNullPtrErr
Indicates an error when one of the specified pointers is
NULL
.
ippStsSizeErr
Indicates an error when
step
or
height
is less than or equal to 0.
ippStsBadArgErr
Indicates an error when
height
is greater than the number of filters in
pSpec
structure.

Example

The code example below demonstrates export and import of the Polyphase Resampling Filter Bank.
int inRate=16000; // input frequency int outRate=8000; // output frequency int history; // half of filter length char fname[]="filter.flt\0"; // coefficient file name { int size,len,height; FILE *file; short *pFilter; IppsresamplingPolyphaseFixed_16s *state; history=(int)(64.0f*0.5*IPP_MAX(1.0,1.0/(double)outRate/(double)inRate))+1; ippsResamplePolyphaseFixedGetSize_16s(inRate, outRate, 2*(history-1), &size, &len, &height, ippAlgHintFast); state = (IppsResamlingPolyphaseFixed_16s*)ippsMalloc_8u(size); ippsResamplePolyphaseFixedInit_16s(inRate,outRate,2*(history-1), 0.95f, 9.0f, state, ippAlgHintFast); pFilter=ippsMalloc_16s(len*height); ippsResamplePolyphaseGetFixedFilter_16s(pFilter,len,height,state); file=fopen(fname,"wb"); fwrite(&size,sizeof(int),1,file); fwrite(&len,sizeof(int),1,file); fwrite(&height,sizeof(int),1,file); fwrite(pFilter,sizeof(short),len*height,file); fclose(file); ippsFree(pFilter); ippsFree (state); } { int size,len,height; FILE *file; short *pFilter; IppsresamplingPolyphaseFixed_16s *state; history=(int)(64.0f*0.5*IPP_MAX(1.0,1.0/(double)outRate/(double)inRate))+1; file=fopen(fname,"rb"); fread(&size,sizeof(int),1,file); fread(&len,sizeof(int),1,file); fread(&height,sizeof(int),1,file); pFilter=ippsMalloc_16s(len*height); fread(pFilter,sizeof(short),len*height,file); fclose(file); state=(IppsresamplingPolyphaseFixed_16s*)ippsMalloc_8u(size); ippsResamplePolyphaseFixedInit_16s(inRate,outRate,2*(history-1), 0.95f, 9.0f, state, ippAlgHintFast); ippsResamplePolyphaseSetFixedFilter_16s((const Ipp16s*)pFilter,len,height, (IppsresamplingPolyphaseFixed_16s*)state); ippsFree(pFilter); // use of polyphase filter … ippsFree(state); }

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804