Back to C-ASPT Contents Page
asptOuterr32f
API Summary
API to create and delete an asptOuterr32f filters
- DT32S outerr32fInit (asptOuterr32f *outerr, DT32S nZ, DT32S nP, DT32F ffmu, DT32F fbmu)
- DT32S outerr32fInitStatic(asptOuterr32f *outerr, DT32S nZ, DT32S nP, DT32F ffmu, DT32F fbmu, DT32F *pCof, DT32F *pDat)
- void outerr32fFree(asptOuterr32f *outerr)
API to filter through and update an asptOuterr32f filters
API to retrieve the properties of an asptOuterr32f objects
- DT32S outerr32fGetFeedForwardCoef(asptOuterr32f *outerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S outerr32fGetFeedBackCoef(asptOuterr32f *outerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S outerr32fGetDelayLine(asptOuterr32f *outerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- outerr32fGetCoefPtr( asptOuterr32f
*outerr )
- outerr32fGetDelayLinePtr( asptOuterr32f
*outerr )
- outerr32fGetFilterLength( asptOuterr32f
*outerr )
- outerr32fGetFeedForwardLength( asptOuterr32f
*outerr )
- outerr32fGetFeedBackLength( asptOuterr32f
*outerr )
- outerr32fGetLastErrorSample( asptOuterr32f
*outerr )
- outerr32fGetFeedForwardStepSize( asptOuterr32f
*outerr )
- outerr32fGetFeedBackStepSize( asptOuterr32f
*outerr )
API to set the properties of an asptOuterr32f filter
- DT32S outerr32fReset(asptOuterr32f *outerr)
- DT32S outerr32fResetDelayLine(asptOuterr32f *outerr)
- DT32S outerr32fResize(asptOuterr32f *outerr, DT32S newN, DT32S newM)
- DT32S outerr32fSetFeedForwardCoef(asptOuterr32f *outerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S outerr32fSetFeedBackCoef(asptOuterr32f *outerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S outerr32fSetDelayLine(asptOuterr32f *outerr, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- outerr32fSetFeedForwardStepSize( asptOuterr32f
*outerr, newSS )
- outerr32fSetFeedBackStepSize( asptOuterr32f
*outerr, newSS )
Description
Implements the Output Error adaptive algorithm using circular buffering.
Copyright
Copyright (c) DSP ALGORITHMS 2003; all rights reserved.
<< Back to top
outerr32fInit
DT32S outerr32fInit (asptOuterr32f *outerr, DT32S nZ, DT32S nP, DT32F ffmu, DT32F fbmu)
Initializes an asptOuterr32f filter and dynamically allocates its necessary storage buffers.- Returns :
-
Error code. On failure, the filterLength member of the asptOuterr32f filter is set to zero.
- Input Parameters :
- outerr : pointer to asptOuterr32f 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 :
- outerr 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
outerr32fInitStatic
DT32S outerr32fInitStatic(asptOuterr32f *outerr, DT32S nZ, DT32S nP, DT32F ffmu, DT32F fbmu, DT32F *pCof, DT32F *pDat)
Initializes an asptOuterr32f filter to use pre-allocated memory blocks.- Returns :
-
Error code. On failure, the filterLength member of the asptOuterr32f filter is set to zero.
- Input Parameters :
- outerr : pointer to asptOuterr32f 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 :
- outerr 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
outerr32fReset
DT32S outerr32fReset(asptOuterr32f *outerr)
Resets all the filter coefficients to zero. - Returns :
- Input Parameters :
- outerr : pointer to asptOuterr32f filter to be reset.
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
outerr32fFree
void outerr32fFree(asptOuterr32f *outerr)
Frees the allocated memory for this asptOuterr32f filter. - Returns :
- Input Parameters :
- outerr : pointer to the asptOuterr32f filter to be de-allocated
- Remarks :
-
Use this function only with filters created with outerr32fInit(). Do not use with asptOuterr32f filters created using outerr32fInitStatic().
<< Back to top
outerr32fResetDelayLine
DT32S outerr32fResetDelayLine(asptOuterr32f *outerr)
Resets the internal delay lines to zero. - Returns :
- Input Parameters :
- outerr : pointer to asptOuterr32f filter to be reset.
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
outerr32fGetFeedForwardCoef
DT32S outerr32fGetFeedForwardCoef(asptOuterr32f *outerr, 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 :
- outerr : pointer to asptOuterr32f 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/outerr->feedforward is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
outerr32fGetFeedBackCoef
DT32S outerr32fGetFeedBackCoef(asptOuterr32f *outerr, 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 :
- outerr : pointer to asptOuterr32f 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/outerr->feedback is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
outerr32fSetFeedForwardCoef
DT32S outerr32fSetFeedForwardCoef(asptOuterr32f *outerr, 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 :
- outerr : pointer to asptOuterr32f 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/outerr->feedforward is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
outerr32fSetFeedBackCoef
DT32S outerr32fSetFeedBackCoef(asptOuterr32f *outerr, 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 :
- outerr : pointer to an asptOuterr32f 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/outerr->feedback is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
outerr32fGetDelayLine
DT32S outerr32fGetDelayLine(asptOuterr32f *outerr, 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 :
- outerr : pointer to the asptOuterr32f 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/outerr->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
outerr32fSetDelayLine
DT32S outerr32fSetDelayLine(asptOuterr32f *outerr, 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 :
- outerr : pointer to an asptOuterr32f 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 :
- outerr->delayLine is updated
- Error Conditions
- ASPT_NULL_PTR_ERR : newBuf/outerr->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
outerr32fResize
DT32S outerr32fResize(asptOuterr32f *outerr, DT32S newN, DT32S newM)
Resizes an asptOuterr32f filter keeping as much of the filter state as possible. - Returns :
- Input Parameters :
- outerr : pointer to the asptOuterr32f 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 asptOuterr32f filters.