Project Ne10
An open, optimized software library for the ARM architecture.
Functions | Variables
Finite Impulse Response (FIR) Sparse Filters

Functions

ne10_result_t ne10_fir_sparse_init_float (ne10_fir_sparse_instance_f32_t *S, ne10_uint16_t numTaps, ne10_float32_t *pCoeffs, ne10_float32_t *pState, ne10_int32_t *pTapDelay, ne10_uint16_t maxDelay, ne10_uint32_t blockSize)
 Initialization function for the floating-point sparse FIR filter. More...
 
void ne10_fir_sparse_float_c (ne10_fir_sparse_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_float32_t *pScratchIn, ne10_uint32_t blockSize)
 Specific implementation of ne10_fir_sparse_float using plain C. More...
 
void ne10_fir_sparse_float_neon (ne10_fir_sparse_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_float32_t *pScratch, ne10_uint32_t blockSize) asm("ne10_fir_sparse_float_neon")
 Specific implementation of ne10_fir_sparse_float using NEON SIMD capabilities. More...
 

Variables

void(* ne10_fir_sparse_float )(ne10_fir_sparse_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_float32_t *pScratchIn, ne10_uint32_t blockSize)
 Processing function for the floating-point sparse FIR filter. More...
 

Detailed Description

This group of functions implements sparse FIR filters. Sparse FIR filters are equivalent to standard FIR filters except that most of the coefficients are equal to zero. Sparse filters are used for simulating reflections in communications and audio applications.

There are separate functions for floating-point data types. The functions operate on blocks of input and output data and each call to the function processes blockSize samples through the filter. pSrc and pDst points to input and output arrays respectively containing blockSize values.

Algorithm:
The sparse filter instant structure contains an array of tap indices pTapDelay which specifies the locations of the non-zero coefficients. This is in addition to the coefficient array b. The implementation essentially skips the multiplications by zero and leads to an efficient realization.
      y[n] = b[0] * x[n-pTapDelay[0]] + b[1] * x[n-pTapDelay[1]] + b[2] * x[n-pTapDelay[2]] + ...+ b[numTaps-1] * x[n-pTapDelay[numTaps-1]]
  
FIRSparse.gif
Sparse FIR filter. b[n] represents the filter coefficients
pCoeffs points to a coefficient array of size numTaps; pTapDelay points to an array of nonzero indices and is also of size numTaps; pState points to a state array of size maxDelay + blockSize, where maxDelay is the largest offset value that is ever used in the pTapDelay array. Some of the processing functions also require temporary working buffers.
Instance Structure
The coefficients and state variables for a filter are stored together in an instance data structure. A separate instance structure must be defined for each filter. Coefficient and offset arrays may be shared among several instances while state variable arrays cannot be shared. There are separate instance structure declarations for each of the 4 supported data types.
Initialization Functions
There is also an associated initialization function for each data type. The initialization function performs the following operations:
  • Sets the values of the internal structure fields.
  • Zeros out the values in the state buffer.
Use of the initialization function is optional. However, if the initialization function is used, then the instance structure cannot be placed into a const data section. To place an instance structure into a const data section, the instance structure must be manually initialized. Set the values in the state buffer to zeros before static initialization. The code below statically initializes each of the 4 different data type filter instance structures
*ne10_fir_sparse_instance_f32_t S = {numTaps, 0, pState, pCoeffs, maxDelay, pTapDelay};
  

Function Documentation

void ne10_fir_sparse_float_c ( ne10_fir_sparse_instance_f32_t S,
ne10_float32_t pSrc,
ne10_float32_t pDst,
ne10_float32_t pScratchIn,
ne10_uint32_t  blockSize 
)

Specific implementation of ne10_fir_sparse_float using plain C.

Definition at line 1386 of file NE10_fir.c.

void ne10_fir_sparse_float_neon ( ne10_fir_sparse_instance_f32_t S,
ne10_float32_t pSrc,
ne10_float32_t pDst,
ne10_float32_t pScratch,
ne10_uint32_t  blockSize 
)

Specific implementation of ne10_fir_sparse_float using NEON SIMD capabilities.

ne10_result_t ne10_fir_sparse_init_float ( ne10_fir_sparse_instance_f32_t S,
ne10_uint16_t  numTaps,
ne10_float32_t pCoeffs,
ne10_float32_t pState,
ne10_int32_t pTapDelay,
ne10_uint16_t  maxDelay,
ne10_uint32_t  blockSize 
)

Initialization function for the floating-point sparse FIR filter.

Parameters
[in,out]*Spoints to an instance of the floating-point sparse FIR structure.
[in]numTapsnumber of nonzero coefficients in the filter.
[in]*pCoeffspoints to the array of filter coefficients.
[in]*pStatepoints to the state buffer.
[in]*pTapDelaypoints to the array of offset times.
[in]maxDelaymaximum offset time supported.
[in]blockSizenumber of samples that will be processed per block.

Description:

pCoeffs holds the filter coefficients and has length numTaps. pState holds the filter's state variables and must be of length maxDelay + blockSize, where maxDelay is the maximum number of delay line values. blockSize is the number of samples processed by the arm_fir_sparse_f32() function.

Definition at line 260 of file NE10_fir_init.c.

Variable Documentation

void(* ne10_fir_sparse_float) (ne10_fir_sparse_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_float32_t *pScratchIn, ne10_uint32_t blockSize)

Processing function for the floating-point sparse FIR filter.

Parameters
[in]*Spoints to an instance of the floating-point sparse FIR structure.
[in]*pSrcpoints to the block of input data.
[out]*pDstpoints to the block of output data
[in]*pScratchInpoints to a temporary buffer of size blockSize.
[in]blockSizenumber of input samples to process per call.

Points to ne10_fir_sparse_float_c or ne10_fir_sparse_float_neon.

Definition at line 186 of file NE10_init_dsp.c.