Back to C-ASPT Contents Page
asptLmslattice32f
API Summary
API to create and delete an asptLmslattice32f filter
API to filter and update an asptLmslattice32f filter
API to retrieve the properties of an asptLmslattice32f filter
- DT32S lmslattice32fGetCoef(asptLmslattice32f *lmsl, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S lmslattice32fGetParcor(asptLmslattice32f *lmsl, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S lmslattice32fGetDelayLine(asptLmslattice32f *lmsl, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- lmslattice32fGetCoefPtr( asptLmslattice32f
*lmsl )
- lmslattice32fGetParcorPtr( asptLmslattice32f
*lmsl )
- lmslattice32fGetDelayLinePtr( asptLmslattice32f
*lmsl )
- lmslattice32fGetFilterLength( asptLmslattice32f
*lmsl )
- lmslattice32fGetLcStepSize( asptLmslattice32f
*lmsl )
- lmslattice32fGetPcStepSize( asptLmslattice32f
*lmsl )
- lmslattice32fGetLastErrorSample( asptLmslattice32f
*lmsl )
- lmslattice32fGetParcorUpdateFlag( asptLmslattice32f
*lmsl )
API to set the properties of an asptLmslattice32f filter
- DT32S lmslattice32fReset(asptLmslattice32f *lmsl)
- DT32S lmslattice32fResize(asptLmslattice32f *lmsl, DT32S newLength)
- DT32S lmslattice32fSetCoef(asptLmslattice32f *lmsl, DT32F *newCoef, DT32S ind, DT32S N, DT32S flip)
- DT32S lmslattice32fSetParcor(asptLmslattice32f *lmsl, DT32F *newCoef, DT32S ind, DT32S N, DT32S flip)
- DT32S lmslattice32fSetDelayLine(asptLmslattice32f *lmsl, DT32F *newCoef, DT32S ind, DT32S N, DT32S flip)
- lmslattice32fSetLcStepSize( asptLmslattice32f
*lmsl, newStep )
- lmslattice32fSetPcStepSize( asptLmslattice32f
*lmsl, newStep )
- lmslattice32fSetParcorUpdateFlag( asptLmslattice32f
*lmsl, newFlag )
Description
Implements the LMS LATTICE Joint Process Estimator adaptive algorithm.
Copyright
Copyright (c) DSP ALGORITHMS 2003; all rights reserved.
<< Back to top
lmslattice32fInit
DT32S lmslattice32fInit(asptLmslattice32f *lmsl, DT32S L, DT32F mu_p, DT32F mu_c)
Initializes an asptLmslattice32f filter and allocates its necessary storage buffers - Returns :
-
Error code. On failure, the filterLength member of the filter is set to zero.
- Input Parameters :
- lmsl : pointer to asptLmslattice32f filter to be initializes
- len : number of filter coefficients
- mu_p : PARCOR step size.
- mu_c : linear combiner step size
- Output Parameters :
- lmsl is initialized using the given input arguments.
- Error Conditions
- ASPT_NO_ERR : Initialization is successful
- ASPT_NULL_PTR_ERR : lmsl is a NULL pointer
- ASPT_RANGE_ERR : len is not a valid input value
- ASPT_NO_MEM_ERR : could not allocate memory
<< Back to top
lmslattice32fInitStatic
DT32S lmslattice32fInitStatic(asptLmslattice32f *lmsl,DT32S L, DT32F mu_p, DT32F mu_c, DT32F *pCof, DT32F *pDat)
Initializes an asptLmslattice32f filter to use pre-allocated memory blocks - Returns :
-
Error code. On failure, the filterLength member of the filter is set to zero.
- Input Parameters :
- lmsl : pointer to asptLmslattice32f filter to be initializes
- len : number of filter coefficients
- mu_p : PARCOR step size.
- mu_c : linear combiner step size
- pCof : pointer to a pre-allocated memory in program memory
of at least [2*len] DT32F locations to be used for the filter/PARCOR coefficients.
- pDat : pointer to a pre-allocated memory in data memory of at least
[3*len] DT32F locations to be used for data storage.
- Output Parameters :
- lmsl is initialized using the given input arguments.
- Error Conditions
- ASPT_NO_ERR : Initialization is successful
- ASPT_NULL_PTR_ERR : lmsl/pCof/pDat is a NULL pointer
- ASPT_RANGE_ERR : len is not a valid input value
<< Back to top
lmslattice32fFilterUpdate
DT32F lmslattice32fFilterUpdate(asptLmslattice32f *lmsl, DT32F x, DT32F d)
Calculates the filter output and updates the PARCOR and linear combiner coefficients of an asptLmslattice32f filter. - Returns :
- Input Parameters :
- lmsl : pointer to the asptLmslattice32f filter.
- x : input sample.
- d : desired sample.
- Remarks :
-
The error sample is stored internally and can be retrieved by calling lmslattice32fGetLastErrorSample().
<< Back to top
lmslattice32fFilterOnly
DT32F lmslattice32fFilterOnly(asptLmslattice32f *lmsl, 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 :
- lmsl : pointer to the asptLmslattice32f filter.
- x : input sample.
<< Back to top
lmslattice32fFree
void lmslattice32fFree(asptLmslattice32f *lmsl)
Frees the allocated memory for this asptLmslattice32f filter. - Returns :
- Input Parameters :
- lmsl : pointer to the asptLmslattice32f filter
- Remarks :
-
Use this function only for asptLmslattice32f filters created using lmslattice32fInit(). Do not use with filters created with lmsLattice32fInitStatic().
<< Back to top
lmslattice32fReset
DT32S lmslattice32fReset(asptLmslattice32f *lmsl)
Resets all PARCOR and linear combiner coefficients to zero.- Returns :
- Input Parameters :
- lmsl : pointer to an asptLmslattice32f filter to be reset
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
lmslattice32fGetCoef
DT32S lmslattice32fGetCoef(asptLmslattice32f *lmsl, 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 int).
- Input Parameters :
- lmsl : pointer to an asptLmslattice32f 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/lmsl is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
lmslattice32fSetCoef
DT32S lmslattice32fSetCoef(asptLmslattice32f *lmsl, DT32F *newCoef, DT32S ind, DT32S N, DT32S flip)
Initializes N internal linear combiner filter coefficients starting from coef[ind] to the contents of newCoef. - Returns :
-
On success returns the number of coefficients copied, otherwise the error code (negative int).
- Input Parameters :
- lmsl : pointer to an asptLmslattice32f filter to be set.
- newCoef : pointer to the new coefficients 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 : newCoef/lmsl is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
lmslattice32fGetParcor
DT32S lmslattice32fGetParcor(asptLmslattice32f *lmsl, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Copies N internal PARCOR coefficients starting from coef[ind] to dstBuf. - Returns :
-
On success returns the number of coefficients copied, otherwise the error code (negative int).
- Input Parameters :
- lmsl : pointer to an asptLmslattice32f 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/lmsl is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
lmslattice32fSetCoef
DT32S lmslattice32fSetCoef(asptLmslattice32f *lmsl, DT32F *newCoef, DT32S ind, DT32S N, DT32S flip)
Initializes N internal PARCOR filter coefficients starting from coef[ind] to the contents of newCoef. - Returns :
-
On success returns the number of coefficients copied, otherwise the error code (negative int).
- Input Parameters :
- lmsl : pointer to an asptLmslattice32f filter to be set.
- newCoef : 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 : newCoef/lmsl is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
lmslattice32fGetDelayLine
DT32S lmslattice32fGetDelayLine(asptLmslattice32f *lmsl, 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 int).
- Input Parameters :
- lmsl : pointer to an asptLmslattice32f 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/lmsl is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
lmslattice32fSetDelayLine
DT32S lmslattice32fSetDelayLine(asptLmslattice32f *lmsl, DT32F *newCoef, 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 int).
- Input Parameters :
- lmsl : pointer to an asptLmslattice32f 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/lmsl is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
lmslattice32fResize
DT32S lmslattice32fResize(asptLmslattice32f *lmsl, DT32S newLength)
Resizes an asptLmslattice32f filter keeping as much of the filter state as possible. - Returns :
- Input Parameters :
- lmsl : pointer to the asptLmslattice32f 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 asptLmslattice32f filters.