Back to C-ASPT Contents Page
asptRtmcfxlms32f
API Summary
API to create and delete an asptRtmcfxlms32f filters
- DT32S rtmcfxlms32fInit (asptRtmcfxlms32f *mcfxlms, DT32S Nref, DT32S Nact, DT32S Nsen, DT32S chL, DT32F mu, DT32F *sPathEst, DT32S seL)
- DT32S rtmcfxlms32fInitStatic(asptRtmcfxlms32f *mcfxlms, DT32S Nref, DT32S Nact, DT32S Nsen, DT32S chL, DT32F mu, DT32F *sPathEst, DT32S seL, DT32F *pCof, DT32F *pDat)
- void rtmcfxlms32fFree(asptRtmcfxlms32f *mcfxlms)
API to filter through and update an asptRtmcfxlms32f filters
API to retrieve the properties of an asptRtmcfxlms32f filter
- DT32S rtmcfxlms32fGetCoef(asptRtmcfxlms32f *mcfxlms, DT32F *buf, DT32S ref, DT32S act, DT32S ind, DT32S N, DT32S flip)
- DT32S rtmcfxlms32fGetDelayLine(asptRtmcfxlms32f *mcfxlms, DT32F *buf, DT32S ref, DT32S ind, DT32S N, DT32S flip)
- rtmcfxlms32fGetCoefPtr( asptRtmcfxlms32f
*mcfxlms )
- rtmcfxlms32fGetEstSecPathPtr( asptRtmcfxlms32f
*mcfxlms )
- rtmcfxlms32fGetFilterLength( asptRtmcfxlms32f
*mcfxlms )
- rtmcfxlms32fGetEstSecPathLength( asptRtmcfxlms32f
*mcfxlms )
- rtmcfxlms32fGetStepSize( asptRtmcfxlms32f
*mcfxlms )
- rtmcfxlms32fGetNrefs( asptRtmcfxlms32f
*mcfxlms )
- rtmcfxlms32fGetNacts( asptRtmcfxlms32f
*mcfxlms )
- rtmcfxlms32fGetNsens( asptRtmcfxlms32f
*mcfxlms )
API to set the properties of an asptRtmcfxlms32f filter
- DT32S rtmcfxlms32fReset(asptRtmcfxlms32f *mcfxlms)
- DT32S rtmcfxlms32fResetDelayLine(asptRtmcfxlms32f *mcfxlms)
- DT32S rtmcfxlms32fResize(asptRtmcfxlms32f *mcfxlms, DT32S Nref, DT32S Nact, DT32S Nsen, DT32S newLength)
- DT32S rtmcfxlms32fSetCoef(asptRtmcfxlms32f *mcfxlms, DT32F *newCoef, DT32S ref, DT32S act, DT32S ind, DT32S N, DT32S flip)
- DT32S rtmcfxlms32fSetDelayLine(asptRtmcfxlms32f *mcfxlms, DT32F *newCoef, DT32S ref, DT32S ind, DT32S N, DT32S flip)
- rtmcfxlms32fSetStepSize( asptRtmcfxlms32f
*mcfxlms, newStep )
- rtmcfxlms32fSetEstSecPathPtr( asptRtmcfxlms32f
*mcfxlms, newPtr )
- rtmcfxlms32fSetEstSecPathLength( asptRtmcfxlms32f
*mcfxlms, newLength )
Description
Implements the RTMCFXLMS algorithm. This version is intended for real-time applications development. The filter calculates the signals used to drive the secondary sources and is fed with the reference signals and sensors signals. The filtering through the physical matrix of secondary transfer functions occurs externally.
Copyright
Copyright (c) DSP ALGORITHMS 2003; all rights reserved.
<< Back to top
rtmcfxlms32fInit
DT32S rtmcfxlms32fInit (asptRtmcfxlms32f *mcfxlms, DT32S Nref, DT32S Nact, DT32S Nsen, DT32S chL, DT32F mu, DT32F *sPathEst, DT32S seL)
Initializes an asptRtmcfxlms32f filter and allocates its necessary storage buffers. - Returns :
-
Error code. On failure, the filterLength member of the filter is set to zero.
- Input Parameters :
- mcfxlms : asptRtmcfxlms32f filter to be initialized
- Nref : number of input reference signals
- Nact : number of secondary actuators
- Nsen : number of error sensors
- L : number of filter coefficients for each channel
- mu : step size.
- sPathEst : pointer to the estimated secondary path FIR response
- seL : length of the estimated secondary path response sPathEst
- Error Conditions
- ASPT_NO_ERR : Initialization is successful
- ASPT_NULL_PTR_ERR : sPathEst is a NULL pointer
- ASPT_RANGE_ERR : Nref/Nact/Nsen/L/seL is not a valid input value
- ASPT_NO_MEM_ERR : could not allocate memory
<< Back to top
rtmcfxlms32fInitStatic
DT32S rtmcfxlms32fInitStatic(asptRtmcfxlms32f *mcfxlms, DT32S Nref, DT32S Nact, DT32S Nsen, DT32S chL, DT32F mu, DT32F *sPathEst, DT32S seL, DT32F *pCof, DT32F *pDat)
Initializes an asptRtmcfxlms32f filter to use pre-allocated memory. - Returns :
-
Error code. On failure, the filterLength member of the filter is set to zero.
- Input Parameters :
- Nref : number of input reference signals
- Nact : number of secondary actuators
- Nsen : number of error sensors
- L : number of filter coefficients
- mu : step size.
- 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 block to be used for the
adaptive filter coefficients. At least L*Nref*Nact memory locations must be available starting at this memory address.
- pDat : pointer to a pre-allocated memory block to be used for data
storage. At least [(L+seL)*Nref+(Nact*sL)+(seL*Nsen)+Nact] memory locations must be available starting at this address.
- Error Conditions
- ASPT_NO_ERR : Initialization is successful
- ASPT_NULL_PTR_ERR : sPathEst/pCof/pDat is a NULL pointer
- ASPT_RANGE_ERR : Nref/Nact/Nsen/L/seL is not a valid input value
- ASPT_NO_MEM_ERR : could not allocate memory
<< Back to top
rtmcfxlms32fFilterUpdate
DT32S rtmcfxlms32fFilterUpdate(asptRtmcfxlms32f *mcfxlms, DT32F ref[], DT32F sen[], DT32F act[])
Calculates the filter output and updates the coefficients vector according to the RTMCFXLMS algorithm. - Returns :
- Input Parameters :
- mcfxlms : pointer to the asptRtmcfxlms32f filter
- ref : array of new reference samples at each input
- sens : array of sensor samples
- Output Parameters :
- act : array of secondary source samples.
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
rtmcfxlms32fFilterOnly
DT32S rtmcfxlms32fFilterOnly (asptRtmcfxlms32f *mcfxlms, DT32F ref[], DT32F act[])
Calculates the filter output and updates the internal delay lines but does not updates the coefficients. - Returns :
-
0 on success, otherwise a negative int.
- Input Parameters :
- mcfxlms : pointer to the asptRtmcfxlms32f filter
- ref : array of new reference samples at each input
- Output Parameters :
- act : array of secondary source samples.
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
rtmcfxlms32fFree
void rtmcfxlms32fFree(asptRtmcfxlms32f *mcfxlms)
Frees the allocated memory for this asptRtmcfxlms32f filter. - Returns :
- Input Parameters :
- mcfxlms : pointer to the asptRtmcfxlms32f filter
- Remarks :
-
Use this function only with asptRtmcfxlms32f filters created with mcfxlms32fInit(). Do not use with filters created using rtmcfxlms32fInitStatic().
<< Back to top
rtmcfxlms32fReset
DT32S rtmcfxlms32fReset(asptRtmcfxlms32f *mcfxlms)
Resets all filter coefficients to zero.- Returns :
- Input Parameters :
- mcfxlms : pointer to an asptRtmcfxlms32f filter to be reset
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
rtmcfxlms32fResetDelayLine
DT32S rtmcfxlms32fResetDelayLine(asptRtmcfxlms32f *mcfxlms)
Resets all internal delay lines to zero. - Returns :
- Input Parameters :
- mcfxlms : pointer to an asptRtmcfxlms32f filter to be reset.
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
rtmcfxlms32fGetCoef
DT32S rtmcfxlms32fGetCoef(asptRtmcfxlms32f *mcfxlms, DT32F *buf, DT32S ref, DT32S act, DT32S ind, DT32S N, DT32S flip)
Copies the N internal filter coefficients of the transfer function between ref and act starting from coef[ind] to dstBuf. - Returns :
-
On success returns the number of coefficients copied, otherwise the error code (negative int).
- Input Parameters :
- mcfxlms : pointer to an asptRtmcfxlms32f filter.
- dstBuf : destination buffer.
- ind : index to the first coefficient to be copied
- ref,act : specify the transfer function 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/mcfxlms->coef is a NULL pointer
- ASPT_RANGE_ERR : ref/act/ind/N is not a valid input value
<< Back to top
rtmcfxlms32fSetCoef
DT32S rtmcfxlms32fSetCoef(asptRtmcfxlms32f *mcfxlms, DT32F *newCoef, DT32S ref, DT32S act, DT32S ind, DT32S N, DT32S flip)
Initializes N coefficients of the transfer function between reference ref and actuator act, starting from coef[ind] to the contents of newCoef. - Returns :
-
On success returns the number of coefficients initialized, otherwise the error code (negative int).
- Input Parameters :
- mcfxlms : pointer to an asptRtmcfxlms32f filter to be set.
- newCoef : new coefficients vector.
- ref, act : specify the filter to be set.
- 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/mcfxlms->coef is a NULL pointer
- ASPT_RANGE_ERR : ref/act/ind/N is not a valid input value
<< Back to top
rtmcfxlms32fGetDelayLine
DT32S rtmcfxlms32fGetDelayLine(asptRtmcfxlms32f *mcfxlms, DT32F *buf, DT32S ref, DT32S ind, DT32S N, DT32S flip)
Copies N internal delay line samples starting from delayLine[ind] of reference ref to dstBuf. - Returns :
-
On success returns the number of samples copied, otherwise the error code (negative int).
- Input Parameters :
- mcfxlms : pointer to an asptRtmcfxlms32f filter.
- dstBuf : destination buffer.
- ref : specify the reference signal delay line to be copied
- 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/mcfxlms->delayLine is a NULL pointer
- ASPT_RANGE_ERR : ref/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
rtmcfxlms32fSetDelayLine
DT32S rtmcfxlms32fSetDelayLine(asptRtmcfxlms32f *mcfxlms, DT32F *newCoef, DT32S ref, DT32S ind, DT32S N, DT32S flip)
Initializes the N internal delay line samples for reference ref, starting from delayLine[ind] to the contents of newBuf. - Returns :
-
On success returns the number of samples initialized, otherwise the error code (negative int).
- Input Parameters :
- mcfxlms : pointer to an asptRtmcfxlms32f filter.
- newBuf : new data buffer.
- ref : specifies the reference signal delay line to be set.
- ind : index to the first sample to be initialized.
- N : number of samples to be initialized.
- flip : if not 0, will flip the samples order.
- Output Parameters :
- mcfxlms->delayLine is updated
- Error Conditions
- ASPT_NULL_PTR_ERR : newBuf/mcfxlms->delayLine is a NULL pointer
- ASPT_RANGE_ERR : ref/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
rtmcfxlms32fResize
DT32S rtmcfxlms32fResize(asptRtmcfxlms32f *mcfxlms, DT32S Nref, DT32S Nact, DT32S Nsen, DT32S newLength)
Resizes an asptRtmcfxlms32f filter keeping as much of the filter state as possible. - Returns :
- Input Parameters :
- mcfxlms : pointer to the asptRtmcfxlms32f filter to be resized.
- Nref : Number of reference signals
- Nact : Number of secondary actuators
- Nsen : Number of error sensors
- newLen : required new filter length in each channel
- Error Conditions
- ASPT_NO_ERR : Resizing is success
- ASPT_NULL_PTR_ERR : NULL pointer error
- ASPT_RANGE_ERR : Nref/Nact/Nsen/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 asptRtmcfxlms32f filters.