Back to C-ASPT Contents Page
asptEqerr32f
API Summary
API to create and delete an asptEqerr32f filters
- DT32S eqerr32fInit (asptEqerr32f *eqerr, DT32S nZ, DT32S nP, DT32F ffmu, DT32F fbmu)
- DT32S eqerr32fInitStatic(asptEqerr32f *eqerr, DT32S nZ, DT32S nP, DT32F ffmu, DT32F fbmu, DT32F *pCof, DT32F *pDat)
- void eqerr32fFree(asptEqerr32f *eqerr)
API to filter through and update an asptEqerr32f filters
API to retrieve the properties of an asptEqerr32f objects
- DT32S eqerr32fGetFeedForwardCoef(asptEqerr32f *eqerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S eqerr32fGetFeedBackCoef(asptEqerr32f *eqerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S eqerr32fGetDelayLine(asptEqerr32f *eqerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- eqerr32fGetCoefPtr( asptEqerr32f
*eqerr )
- eqerr32fGetDelayLinePtr( asptEqerr32f
*eqerr )
- eqerr32fGetFilterLength( asptEqerr32f
*eqerr )
- eqerr32fGetFeedForwardLength( asptEqerr32f
*eqerr )
- eqerr32fGetFeedBackLength( asptEqerr32f
*eqerr )
- eqerr32fGetLastErrorSample( asptEqerr32f
*eqerr )
- eqerr32fGetFeedForwardStepSize( asptEqerr32f
*eqerr )
- eqerr32fGetFeedBackStepSize( asptEqerr32f
*eqerr )
API to set the properties of an asptEqerr32f filter
- DT32S eqerr32fReset(asptEqerr32f *eqerr)
- DT32S eqerr32fResetDelayLine(asptEqerr32f *eqerr)
- DT32S eqerr32fResize(asptEqerr32f *eqerr, DT32S newN, DT32S newM)
- DT32S eqerr32fSetFeedForwardCoef(asptEqerr32f *eqerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S eqerr32fSetFeedBackCoef(asptEqerr32f *eqerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S eqerr32fSetDelayLine(asptEqerr32f *eqerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- eqerr32fSetFeedForwardStepSize( asptEqerr32f
*eqerr, newSS )
- eqerr32fSetFeedBackStepSize( asptEqerr32f
*eqerr, newSS )
Description
Implements the Equation Error IIR adaptive algorithm using circular buffering.
Copyright
Copyright (c) DSP ALGORITHMS 2003; all rights reserved.
<< Back to top
eqerr32fInit
DT32S eqerr32fInit (asptEqerr32f *eqerr, DT32S nZ, DT32S nP, DT32F ffmu, DT32F fbmu)
Initializes an asptEqerr32f filter and dynamically allocates its necessary storage buffers.- Returns :
-
Error code. On failure, the filterLength member of the asptEqerr32f filter is set to zero.
- Input Parameters :
- eqerr : pointer to asptEqerr32f filter to be initialized
- nZ : number of feed forward coefficients
- nP : number of feedback coefficients
- ffmu : feed forward step size
- fbmu : feedback step size
- Output Parameters :
- eqerr is initialized using the given input parameters
- Error Conditions
- ASPT_NO_ERR : Initialization success
- ASPT_RANGE_ERR : nZ/nP is not a valid filter length
- ASPT_NO_MEM_ERR : Could not allocate the necessary filter storage
<< Back to top
eqerr32fInitStatic
DT32S eqerr32fInitStatic(asptEqerr32f *eqerr, DT32S nZ, DT32S nP, DT32F ffmu, DT32F fbmu, DT32F *pCof, DT32F *pDat)
Initializes an asptEqerr32f filter to use pre-allocated memory blocks.- Returns :
-
Error code. On failure, the filterLength member of the asptEqerr32f filter is set to zero.
- Input Parameters :
- eqerr : pointer to asptEqerr32f filter to be initialized
- nZ : number of feed forward coefficients
- nP : number of feedback coefficients
- ffmu : feed forward step size
- fbmu : feedback step size
- pDat : pointer to a pre-allocated memory block to be used
- for the filter coefficients. At least nP : nZ memory
locations must be available starting at this address
- pDat : pointer to a pre-allocated memory block to be used
for data storage. At least nZ+2*nP memory locations must be available starting at this memory address
- Output Parameters :
- eqerr is initialized using the given input parameters
- Error Conditions
- ASPT_NO_ERR : Initialization success
- ASPT_NULL_PTR_ERR : pCof/pDat is a NULL pointer
- ASPT_RANGE_ERR : nZ/nP is not a valid filter length
<< Back to top
eqerr32fReset
DT32S eqerr32fReset(asptEqerr32f *eqerr)
Resets all the filter coefficients to zero. - Returns :
- Input Parameters :
- eqerr : pointer to asptEqerr32f filter to be reset.
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
eqerr32fFree
void eqerr32fFree(asptEqerr32f *eqerr)
Frees the allocated memory for this asptEqerr32f filter. - Returns :
- Input Parameters :
- eqerr : pointer to the asptEqerr32f filter to be de-allocated
- Remarks :
-
Use this function only with filters created with eqerr32fInit(). Do not use with asptEqerr32f filters created using eqerr32fInitStatic().
<< Back to top
eqerr32fResetDelayLine
DT32S eqerr32fResetDelayLine(asptEqerr32f *eqerr)
Resets the internal delay lines to zero. - Returns :
- Input Parameters :
- eqerr : pointer to the asptEqerr32f filter to be reset.
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
eqerr32fGetFeedForwardCoef
DT32S eqerr32fGetFeedForwardCoef(asptEqerr32f *eqerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Copies N feed forward filter coefficients starting from coef[ind] to dstBuf. - Returns :
-
on success returns the number of coefficients copied, otherwise an error code
- Input Parameters :
- eqerr : pointer to asptEqerr32f filter.
- dstBuf : destination buffer
- ind : index to the first coefficient to be copied.
- N : number of coefficients to be copied.
- flip : if not 0, will flip the coefficients order
- Output Parameters :
- Error Conditions
- ASPT_NULL_PTR_ERR : dstBuf/eqerr->feed forward is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
eqerr32fGetFeedBackCoef
DT32S eqerr32fGetFeedBackCoef(asptEqerr32f *eqerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Copies N feedback filter coefficients starting from coef[ind] to dstBuf. - Returns :
-
on success returns the number of coefficients copied, otherwise an error code
- Input Parameters :
- eqerr : pointer to asptEqerr32f filter.
- dstBuf : destination buffer
- ind : index to the first coefficient to be copied.
- N : number of coefficients to be copied.
- flip : if not 0, will flip the coefficients order
- Output Parameters :
- Error Conditions
- ASPT_NULL_PTR_ERR : dstBuf/eqerr->feedback is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
eqerr32fSetFeedForwardCoef
DT32S eqerr32fSetFeedForwardCoef(asptEqerr32f *eqerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Initializes N feed forward filter coefficients starting from coef[ind] to the contents of newCoef.- Returns :
-
on success returns the number of coefficients initialized, otherwise an error code
- Input Parameters :
- eqerr : pointer to the asptEqerr32f filter to be set.
- newCoef : new coefficients vector.
- ind : index to the first coefficient to be set.
- N : number of coefficients to be set.
- flip : if not 0, will copy the coefficients in reverse order
- Output Parameters :
- Error Conditions
- ASPT_NULL_PTR_ERR : newCoef/eqerr->feed forward is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
eqerr32fSetFeedBackCoef
DT32S eqerr32fSetFeedBackCoef(asptEqerr32f *eqerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Initializes N feedback filter coefficients starting from coef[ind] to the contents of newCoef.- Returns :
-
on success returns the number of coefficients initialized, otherwise an error code
- Input Parameters :
- eqerr : pointer to the asptEqerr32f filter to be set.
- newCoef : new coefficients vector.
- ind : index to the first coefficient to be set.
- N : number of coefficients to be set.
- flip : if not 0, will copy the coefficients in reverse order
- Output Parameters :
- Error Conditions
- ASPT_NULL_PTR_ERR : newCoef/eqerr->feedback is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
eqerr32fGetDelayLine
DT32S eqerr32fGetDelayLine(asptEqerr32f *eqerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Copies N internal delay line samples starting from delayLine[ind] to dstBuf. - Returns :
-
on success returns the number of samples copied, otherwise an error code
- Input Parameters :
- eqerr : pointer to asptEqerr32f filter.
- dstBuf : destination buffer.
- ind : index to the first sample to be copied.
- N : number of samples to be copied.
- flip : if not 0, will flip the samples order.
- Output Parameters :
- Error Conditions
- ASPT_NULL_PTR_ERR : dstBuf/eqerr->delayLine is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
- Remarks :
-
Samples are stored in dstBuf with newest sample at index 0, and oldest at index N-1, when flip == 0.
<< Back to top
eqerr32fSetDelayLine
DT32S eqerr32fSetDelayLine(asptEqerr32f *eqerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Initializes N internal delay line samples starting from delayLine[ind] to the contents of the given array. - Returns :
-
on success returns the number of samples initialized, otherwise an error code
- Input Parameters :
- eqerr : pointer to asptEqerr32f filter.
- newBuf : new data buffer.
- ind : index to the first sample to be copied.
- N : number of samples to be copied.
- flip : if not 0, will flip the samples order
- Output Parameters :
- eqerr->delayLine is updated
- Error Conditions
- ASPT_NULL_PTR_ERR : newBuf/eqerr->delayLine is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
- Remarks :
-
Samples assumed to be stored in newBuf with newest sample at index 0, and oldest at index N-1, when flip == 0.
<< Back to top
eqerr32fResize
DT32S eqerr32fResize(asptEqerr32f *eqerr, DT32S newN, DT32S newM)
Resizes an asptEqerr32f filter keeping as much of the filter state as possible. - Returns :
- Input Parameters :
- eqerr : pointer to the asptEqerr32f filter to be resized.
- newZ : new number of feed forward filter length
- newP : new number of feedback filter length
- Error Conditions
- ASPT_NO_ERR : Resizing is success
- ASPT_NULL_PTR_ERR : NULL pointer error
- ASPT_RANGE_ERR : newLength is not a valid filter length
- ASPT_NO_MEM_ERR : Could not allocate the necessary filter storage
- Remarks :
-
Use this function only with dynamically allocated asptEqerr32f filters.