Back to C-ASPT Contents Page
asptRtfdadjlms32f
API Summary
API to create and delete asptRtfdadjlms32f filters
- DT32S rtfdadjlms32fInit(asptRtfdadjlms32f *rtfdadjlms,DT32S M,DT32S L,DT32F mu,DT32S cs,DT32F *sPathEst,DT32S seL,DT32S *ip,DT32F *w)
- DT32S rtfdadjlms32fInitStatic(asptRtfdadjlms32f *rtfdadjlms,DT32S M,DT32S L,DT32F mu,DT32S cs,DT32F *sPathEst,DT32S seL,DT32F *pCof,DT32F *pDat,DT32S *ip,DT32F *w)
- void rtfdadjlms32fFree(asptRtfdadjlms32f *rtfdadjlms)
API to filter and update asptRtfdadjlms32f filters
API to retrieve the properties of asptRtfdadjlms32f filters
API to set the properties of asptRtfdadjlms32f filters
- DT32S rtfdadjlms32fReset(asptRtfdadjlms32f *rtfdadjlms)
- DT32S rtfdadjlms32fResetDelayLine(asptRtfdadjlms32f *rtfdadjlms)
- DT32S rtfdadjlms32fResize(asptRtfdadjlms32f *rtfdadjlms, DT32S newLen, DT32S newBlock)
- DT32S rtfdadjlms32fSetCoef(asptRtfdadjlms32f *rtfdadjlms, DT32F *newCoef, DT32S ind, DT32S N, DT32S flip)
- DT32S rtfdadjlms32fSetEstSecPath(asptRtfdadjlms32f *rtfdadjlms, DT32F *dstBuf, DT32S ind, DT32S N, DT32S flip)
- rtfdadjlms32fSetStepSize( asptRtfdadjlms32f
*rtfdadjlms, newSs )
- rtfdadjlms32fSetConstrain( asptRtfdadjlms32f
*rtfdadjlms, newC )
- rtfdadjlms32fSetEstSecPathLength( asptRtfdadjlms32f
*rtfdadjlms, newL )
Description
Implements the Real-Time Frequency Domain ADJLMS algorithm. This version is intended for real-time application development. The filter calculates the signal used to drive the secondary source and is fed with the reference signal and sensor signal. The filtering through the physical secondary transfer functions occurs externally.
Copyright
Copyright (c) DSP ALGORITHMS 2003; all rights reserved.
<< Back to top
rtfdadjlms32fInit
DT32S rtfdadjlms32fInit(asptRtfdadjlms32f *rtfdadjlms,DT32S M,DT32S L,DT32F mu,DT32S cs,DT32F *sPathEst,DT32S seL,DT32S *ip,DT32F *w)
Initializes an asptRtfdadjlms32f filter and allocates its necessary storage buffers - Returns :
-
Error code. On failure, the filterLength member of the structure is also set to zero.
- Input Parameters :
- M : number of filter coefficients
- L : block length (number of new samples each block)
- mu : step size
- cs : constrained (1) or unconstrained (0) filter.
- sPathEst : pointer to the estimated secondary path FIR response
- seL : length of the estimated secondary path response sPathEst
- ip : fft bit reversal table
- w : fft twiddle factor table
- Output Parameters :
- rtfdadjlms32f is initialized using the given input parameters
- Error Conditions
- ASPT_NO_ERR : Initialization success
- ASPT_NULL_PTR_ERR : ip/w is a NULL pointer
- ASPT_RANGE_ERR : L/m/seL is not a valid input value
- ASPT_NO_MEM_ERR : Could not allocate the necessary filter storage
<< Back to top
rtfdadjlms32fInitStatic
DT32S rtfdadjlms32fInitStatic(asptRtfdadjlms32f *rtfdadjlms,DT32S M,DT32S L,DT32F mu,DT32S cs,DT32F *sPathEst,DT32S seL,DT32F *pCof,DT32F *pDat,DT32S *ip,DT32F *w)
Initializes an asptRtfdadjlms32f filter to use pre-allocated memory blocks. - Returns :
-
Error code. On failure, the filterLength member of the structure is also set to zero.
- Input Parameters :
- M : number of filter coefficients
- L : block length (number of new samples each block)
- mu : step size
- cs : constrained (1) or unconstrained (0) filter.
- sPathEst : pointer to the estimated secondary path FIR response
- seL : length of the estimated secondary path response sPathEst
- pCof : pointer to a pre-allocated memory in program memory
of at least [2*fftLength] DT32F locations to be used for the filter coefficients and estimated sec. source coefficients.
- pDat : pointer to a pre-allocated memory in data memory of at least
[C1 + 3*fftLength + 2*(fftLength/2+1)] DT32F locations to be used for data storage.
- ip : fft bit reversal table
- w : fft twiddle factor table
- Output Parameters :
- rtfdadjlms is initialized using the given input parameters
- Error Conditions
- ASPT_NO_ERR : Initialization success
- ASPT_NULL_PTR_ERR : ip/w/pCof/pDat is a NULL pointer
- ASPT_RANGE_ERR : L/m/seL is not a valid input value
- ASPT_NO_MEM_ERR : Could not allocate the necessary filter storage
- Remarks :
-
fftLength = 2^(nextpow2(L+M-1)). C1 = fftLength - blockLength.
<< Back to top
rtfdadjlms32fFilterUpdate
DT32S rtfdadjlms32fFilterUpdate(asptRtfdadjlms32f *rtfdadjlms, DT32F *ref, DT32F *sens, DT32F *out)
Calculates the filter output and updates the coefficients vector according to the FDADJLMS algorithm. - Returns :
- Input Parameters :
- rtfdadjlms : pointer to the asptRtfdadjlms32f filter
- ref : new block of the reference samples
- sen : last measured block of sensor samples
Output Parameters
- act : array to store the block of actuator samples
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
rtfdadjlms32fFilterOnly
DT32S rtfdadjlms32fFilterOnly(asptRtfdadjlms32f *rtfdadjlms, DT32F *ref, DT32F *out)
Calculates the filter output but does not updates the coefficients. It also updates the input power and internal data buffers. - Returns :
- Input Parameters :
- rtfdadjlms : pointer to the asptRtfdadjlms32f filter
- ref : pointer to the input block of samples
Output Parameters
- act : pointer to store the filter output samples
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
rtfdadjlms32fFree
void rtfdadjlms32fFree(asptRtfdadjlms32f *rtfdadjlms)
Frees the allocated memory for this asptRtfadjlms32f filter. - Returns :
- Input Parameters :
- rtfdadjlms : pointer to the asptRtfdadjlms32f filter
- Remarks :
-
Use this function only with filters created with rtfdadjlms32fInit(). Do not use with asptRtfdadjlms32f filters created using rtfdadjlms32fInitStatic().
<< Back to top
rtfdadjlms32fReset
DT32S rtfdadjlms32fReset(asptRtfdadjlms32f *rtfdadjlms)
Resets all filter coefficients to zero.- Returns :
- Input Parameters :
- rtfdadjlms : pointer to an asptRtfdadjlms32f filter to be reset.
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
rtfdadjlms32fResetDelayLine
DT32S rtfdadjlms32fResetDelayLine(asptRtfdadjlms32f *rtfdadjlms)
Resets the internal delay line to zeros.- Returns :
- Input Parameters :
- rtfdadjlms : pointer to an asptRtfdadjlms32f filter to be reset.
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
rtfdadjlms32fGetCoef
DT32S rtfdadjlms32fGetCoef(asptRtfdadjlms32f *rtfdadjlms, DT32F *dstBuf, DT32S ind, DT32S N, DT32S flip)
Copies N internal filter coefficients starting from coef[ind] to dstBuf. - Returns :
-
On success returns the number of coefficients copied, otherwise the error code (negative int).
- Input Parameters :
- rtfdadjlms : pointer to an asptRtfdadjlms32f 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.
- Error Conditions
- ASPT_NULL_PTR_ERR : dstBuf/rtfdadjlms->wFreq is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
rtfdadjlms32fSetCoef
DT32S rtfdadjlms32fSetCoef(asptRtfdadjlms32f *rtfdadjlms, DT32F *newCoef, DT32S ind, DT32S N, DT32S flip)
Initializes N internal (time domain) 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 :
- rtfdadjlms : pointer to an asptRtfdadjlms32f 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.
- Error Conditions
- ASPT_NULL_PTR_ERR : newCoef/rtfdadjlms->wFreq is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
rtfdadjlms32fGetEstSecPath
DT32S rtfdadjlms32fGetEstSecPath(asptRtfdadjlms32f *rtfdadjlms, DT32F *dstBuf, DT32S ind, DT32S N, DT32S flip)
Copies N internal (time domain) coefficients from the estimated secondary path filter starting from coef[ind] to dstBuf. - Returns :
-
On success returns the number of coefficients copied, otherwise the error code (negative int).
- Input Parameters :
- rtfdadjlms : pointer to an asptRtfdadjlms32f 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.
- Error Conditions
- ASPT_NULL_PTR_ERR : dstBuf/rtfdadjlms->secPathEst is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
rtfdadjlms32fSetEstSecPath
DT32S rtfdadjlms32fSetEstSecPath(asptRtfdadjlms32f *rtfdadjlms, DT32F *dstBuf, DT32S ind, DT32S N, DT32S flip)
Initializes N internal (time domain) coefficients from the estimated secondary path filter 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 :
- rtfdadjlms : pointer to an asptRtfdadjlms32f filter.
- newCoef : destination buffer.
- ind : index to the first coefficient to be initialized.
- N : number of coefficients to be initialized.
- flip : if not 0, will flip the coefficients order.
- Error Conditions
- ASPT_NULL_PTR_ERR : newCoef/rtfdadjlms->secPathEst is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
rtfdadjlms32fResize
DT32S rtfdadjlms32fResize(asptRtfdadjlms32f *rtfdadjlms, DT32S newLen, DT32S newBlock)
Resizes an asptRtfdadjlms32f filter keeping as much of the filter state as possible. - Returns :
- Input Parameters :
- rtfdadjlms : pointer to the asptRtfdadjlms32f filter to be resized.
- newLen : required new filter length
- newBlock : new block length
- Error Conditions
- ASPT_NO_ERR : Resizing is success
- ASPT_NULL_PTR_ERR : NULL pointer error
- ASPT_RANGE_ERR : newLength/newBlock 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 asptRtfdadjlms32f filters.