Back to C-ASPT Contents Page
asptRlslatticewef32f
API Summary
API to create and delete an asptRlslatticewef32f filter
API to filter and update an asptRlslatticewef32f filter
API to retrieve the properties of an asptRlslatticewef32f filter
- DT32S rlslatticewef32fGetCoef(asptRlslatticewef32f *rlsl, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S rlslatticewef32fGetForwardParcors(asptRlslatticewef32f *rlsl, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S rlslatticewef32fGetBackwardParcors(asptRlslatticewef32f *rlsl, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S rlslatticewef32fGetDelayLine(asptRlslatticewef32f *rlsl, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- rlslatticewef32fGetCoefPtr( asptRlslatticewef32f
*rlsl )
- rlslatticewef32fGetForwardParcorPtr( asptRlslatticewef32f
*rlsl )
- rlslatticewef32fGetBackwardParcorPtr( asptRlslatticewef32f
*rlsl )
- rlslatticewef32fGetDelayLinePtr( asptRlslatticewef32f
*rlsl )
- rlslatticewef32fGetFilterLength( asptRlslatticewef32f
*rlsl )
- rlslatticewef32fGetForgetFactor( asptRlslatticewef32f
*rlsl )
- rlslatticewef32fGetLastErrorSample( asptRlslatticewef32f
*rlsl )
API to set the properties of an asptRlslatticewef32f filter
Description
Implements the Recursive Least Squares latticewef joint process estimator
using the a priori estimation errors with error feedback.
Copyright
Copyright (c) DSP ALGORITHMS 2003; all rights reserved.
<< Back to top
rlslatticewef32fInit
DT32S rlslatticewef32fInit(asptRlslatticewef32f *rlsl, DT32S L, DT32F mu)
Initializes an asptRlslatticewef32f filter and allocates its necessary
storage buffers
- Returns :
-
Error code. On failure, the filterLength member of the filter is
set to zero.
- Input Parameters :
- rlsl : pointer to asptRlslatticewef32f filter to be initializes
- L : number of linear combiner coefficients
- mu : forgetting factor
- Output Parameters :
- rlsl is initialized using the given input arguments.
- Error Conditions
- ASPT_NO_ERR : Initialization is successful
- ASPT_NULL_PTR_ERR : rlsl is a NULL pointer
- ASPT_RANGE_ERR : L is not a valid input value
- ASPT_NO_MEM_ERR : could not allocate memory
<< Back to top
rlslatticewef32fInitStatic
DT32S rlslatticewef32fInitStatic(asptRlslatticewef32f *rlsl, DT32S L, DT32F mu, DT32F *pCof, DT32F *pDat)
Initializes an asptRlslatticewef32f filter to use pre-allocated memory
blocks
- Returns :
-
Error code. On failure, the filterLength member of the filter is
set to zero.
- Input Parameters :
- rlsl : pointer to asptRlslatticewef32f filter to be initialized
- L : number of linear combiner coefficients
- mu : forgetting factor
- pCof : pointer to a pre-allocated memory in program memory
of at least [3*len] DT32F locations to be used for the
filter/PARCOR coefficients.
- pDat : pointer to a pre-allocated memory in data memory of at least
[4*len] DT32F locations to be used for data storage.
- Output Parameters :
- rlsl is initialized using the given input arguments.
- Error Conditions
- ASPT_NO_ERR : Initialization is successful
- ASPT_NULL_PTR_ERR : rlsl/pCof/pDat is a NULL pointer
- ASPT_RANGE_ERR : len is not a valid input value
<< Back to top
rlslatticewef32fFilterUpdate
DT32F rlslatticewef32fFilterUpdate(asptRlslatticewef32f *rlsl, DT32F x, DT32F d)
Calculates the filter output and updates the PARCOR and linear
combiner coefficients of an asptRlslatticewef32f filter.
- Returns :
- Input Parameters :
- rlsl : pointer to asptRlslatticewef32f filter.
- x : input sample.
- d : desired sample.
- Remarks :
-
The error sample is stored internally and can be retrieved by calling
rlslatticewef32fGetLastErrorSample().
<< Back to top
rlslatticewef32fFilterOnly
DT32F rlslatticewef32fFilterOnly(asptRlslatticewef32f *rlsl, DT32F x)
Calculates the filter output but does not updates the PARCOR nor
the linear combiner coefficients. It updates the internal buffers.
- Returns :
- Input Parameters :
- rlsl : pointer to asptRlslatticewef32f filter.
- x : input sample.
<< Back to top
rlslatticewef32fFree
void rlslatticewef32fFree(asptRlslatticewef32f *rlsl)
Frees the allocated memory for this asptRlslatticewef32f filter.
- Returns :
- Input Parameters :
- rlsl : pointer to the asptRlslatticewef32f filter
- Remarks :
-
Use this function only for asptRlslatticewef32f filters created using rlslatticewef32fInit().
Do not use with filters created with rlslatticewef32fInitStatic().
<< Back to top
rlslatticewef32fReset
DT32S rlslatticewef32fReset(asptRlslatticewef32f *rlsl)
Resets all internal filter states to pre-defined initial state.
- Returns :
- Input Parameters :
- rlsl : pointer to asptRlslatticewef32f filter to be reset
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
rlslatticewef32fGetCoef
DT32S rlslatticewef32fGetCoef(asptRlslatticewef32f *rlsl, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Copies N internal linear combiner coefficients starting from
coef[ind] to dstBuf.
- Returns :
-
On success returns the number of coefficients copied, otherwise the
error code (negative DT32S).
- Input Parameters :
- rlsl : pointer to asptRlslatticewef32f filter.
- dstBuf : pointer to the destination buffer.
- ind : index to the first coefficient to be copied.
- N : number of coefficients to be copied.
- flip : if 1, will flip the coefficients order
- Error Conditions
- ASPT_NULL_PTR_ERR : dstBuf/rlsl is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
rlslatticewef32fGetForwardParcors
DT32S rlslatticewef32fGetForwardParcors(asptRlslatticewef32f *rlsl, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Copies N internal forward PARKOR coefficients starting from
coef[ind] to dstBuf.
- Returns :
-
On success returns the number of coefficients copied, otherwise the
error code (negative DT32S).
- Input Parameters :
- rlsl : pointer to asptRlslatticewef32f filter.
- dstBuf : pointer to the destination buffer.
- ind : index to the first coefficient to be copied.
- N : number of coefficients to be copied.
- flip : if 1, will flip the coefficients order
- Error Conditions
- ASPT_NULL_PTR_ERR : dstBuf/rlsl is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
rlslatticewef32fGetBackwardParcors
DT32S rlslatticewef32fGetBackwardParcors(asptRlslatticewef32f *rlsl, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Copies N internal backward PARKOR coefficients starting from
coef[ind] to dstBuf.
- Returns :
-
On success returns the number of coefficients copied, otherwise the
error code (negative DT32S).
- Input Parameters :
- rlsl : pointer to asptRlslatticewef32f filter.
- dstBuf : pointer to the destination buffer.
- ind : index to the first coefficient to be copied.
- N : number of coefficients to be copied.
- flip : if 1, will flip the coefficients order
- Error Conditions
- ASPT_NULL_PTR_ERR : dstBuf/rlsl is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
rlslatticewef32fGetDelayLine
DT32S rlslatticewef32fGetDelayLine(asptRlslatticewef32f *rlsl, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Copies the N internal backward prediction error samples starting
from delayLine[ind] sample to the given array.
- Returns :
-
On success returns the number of samples copied, otherwise the
error code (negative DT32S).
- Input Parameters :
- rlsl : pointer to asptRlslatticewef32f filter.
- dstBuf : pointer to the destination buffer.
- ind : index to the first sample to be copied.
- N : number of samples to be copied.
- flip : if 1, will flip the samples order.
- Error Conditions
- ASPT_NULL_PTR_ERR : newCoef/rlsl is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
rlslatticewef32fSetDelayLine
DT32S rlslatticewef32fSetDelayLine(asptRlslatticewef32f *rlsl, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Initializes N internal backward prediction error samples starting from
delayLine[ind] to the contents of newBuf.
- Returns :
-
On success returns the number of samples copied, otherwise the
error code (negative DT32S).
- Input Parameters :
- rlsl : pointer to asptRlslatticewef32f filter to be set.
- newBuf : pointer to the new PARCOR vector.
- ind : index to the first coefficient to be set.
- N : number of coefficients to be set.
- flip : if 1, will flip the coefficients order.
- Error Conditions
- ASPT_NULL_PTR_ERR : newBuf/rlsl is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
rlslatticewef32fResize
DT32S rlslatticewef32fResize(asptRlslatticewef32f *rlsl, DT32S newLength)
Resizes an asptRlslatticewef32f filter keeping as much of the
filter state as possible.
- Returns :
- Input Parameters :
- rlsl : pointer to asptRlslatticewef32f filter to be resized.
- newLen : required new filter length.
- Error Conditions
- ASPT_NO_ERR : Resizing is successful
- ASPT_NULL_PTR_ERR : NULL pointer error
- ASPT_RANGE_ERR : newLength is not a valid input value
- ASPT_NO_MEM_ERR : Could not allocate the necessary filter storage
- Remarks :
-
Use this function only with dynamically allocated asptRlslatticewef32f
filters.