Back to C-ASPT Contents Page
asptRtmcadjlms32f
API Summary
API to create and delete an asptRtmcadjlms32f filters
- DT32S rtmcadjlms32fInit (asptRtmcadjlms32f *rtmcadjlms,DT32S Nref, DT32S Nact, DT32S Nsen, DT32S chL, DT32F mu, DT32F *sPathEst, DT32S seL)
- DT32S rtmcadjlms32fInitStatic(asptRtmcadjlms32f *rtmcadjlms,DT32S Nref, DT32S Nact, DT32S Nsen, DT32S chL, DT32F mu, DT32F *sPathEst, DT32S seL, DT32F *pCof, DT32F *pDat)
- void rtmcadjlms32fFree(asptRtmcadjlms32f *rtmcadjlms)
API to filter through and update an asptRtmcadjlms32f filters
API to retrieve the properties of an asptRtmcadjlms32f filter
- DT32S rtmcadjlms32fGetCoef(asptRtmcadjlms32f *rtmcadjlms, DT32F *buf, DT32S ref, DT32S act, DT32S ind, DT32S N, DT32S flip)
- DT32S rtmcadjlms32fGetDelayLine(asptRtmcadjlms32f *rtmcadjlms, DT32F *buf, DT32S ref, DT32S ind, DT32S N, DT32S flip)
- rtmcadjlms32fGetCoefPtr( asptRtmcadjlms32f
*rtmcadjlms )
- rtmcadjlms32fGetEstSecPathPtr( asptRtmcadjlms32f
*rtmcadjlms )
- rtmcadjlms32fGetFilterLength( asptRtmcadjlms32f
*rtmcadjlms )
- rtmcadjlms32fGetEstSecPathLength( asptRtmcadjlms32f
*rtmcadjlms )
- rtmcadjlms32fGetStepSize( asptRtmcadjlms32f
*rtmcadjlms )
- rtmcadjlms32fGetNrefs( asptRtmcadjlms32f
*rtmcadjlms )
- rtmcadjlms32fGetNacts( asptRtmcadjlms32f
*rtmcadjlms )
- rtmcadjlms32fGetNsens( asptRtmcadjlms32f
*rtmcadjlms )
API to set the properties of an asptRtmcadjlms32f filter
- DT32S rtmcadjlms32fReset(asptRtmcadjlms32f *rtmcadjlms)
- DT32S rtmcadjlms32fResetDelayLine(asptRtmcadjlms32f *rtmcadjlms)
- DT32S rtmcadjlms32fResize(asptRtmcadjlms32f *rtmcadjlms, DT32S Nref, DT32S Nact, DT32S Nsen, DT32S newLength)
- DT32S rtmcadjlms32fSetCoef(asptRtmcadjlms32f *rtmcadjlms, DT32F *newCoef, DT32S ref, DT32S act, DT32S ind, DT32S N, DT32S flip)
- DT32S rtmcadjlms32fSetDelayLine(asptRtmcadjlms32f *rtmcadjlms, DT32F *newCoef, DT32S ref, DT32S ind, DT32S N, DT32S flip)
- rtmcadjlms32fSetStepSize( asptRtmcadjlms32f
*rtmcadjlms, newStep )
- rtmcadjlms32fSetEstSecPathPtr( asptRtmcadjlms32f
*rtmcadjlms, newPtr )
- rtmcadjlms32fSetEstSecPathLength( asptRtmcadjlms32f
*rtmcadjlms, newLength )
Description
Implements the Real-Time Multi-Channel ADJoint LMS 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
rtmcadjlms32fInit
DT32S rtmcadjlms32fInit (asptRtmcadjlms32f *rtmcadjlms,DT32S Nref, DT32S Nact, DT32S Nsen, DT32S chL, DT32F mu, DT32F *sPathEst, DT32S seL)
Initializes an asptRtmcadjlms32f filter and allocates its necessary
storage buffers.
- Returns :
-
Error code. On failure, the filterLength member of the filter is set
to zero.
- Input Parameters :
- rtmcadjlms : pointer to asptRtmcadjlms32f 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
rtmcadjlms32fInitStatic
DT32S rtmcadjlms32fInitStatic(asptRtmcadjlms32f *rtmcadjlms,DT32S Nref, DT32S Nact, DT32S Nsen, DT32S chL, DT32F mu, DT32F *sPathEst, DT32S seL, DT32F *pCof, DT32F *pDat)
Initializes an asptRtmcadjlms32f filter to use pre-allocated memory.
- Returns :
-
Error code. On failure, the filterLength member of the filter is set
to zero.
- Input Parameters :
- rtmcadjlms : pointer to asptRtmcadjlms32f 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
- 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+1)*Nref+(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
rtmcadjlms32fFilterUpdate
DT32S rtmcadjlms32fFilterUpdate(asptRtmcadjlms32f *rtmcadjlms, DT32F ref[], DT32F sen[], DT32F act[])
Calculates the filter output and updates the coefficients vector
according to the MCADJLMS algorithm.
- Returns :
- Input Parameters :
- rtmcadjlms : pointer to the asptRtmcadjlms32f filter
- ref : array of new reference samples at each input
- sen : array of last measured 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
rtmcadjlms32fFilterOnly
DT32S rtmcadjlms32fFilterOnly (asptRtmcadjlms32f *rtmcadjlms, DT32F ref[], DT32F act[])
Calculates the filter output and updates the internal delay lines
but does not updates the coefficients.
- Returns :
- Input Parameters :
- rtmcadjlms : pointer to the asptRtmcadjlms32f filter
- ref : array of new reference samples at each input
- Output Parameters :
- act : array of samples to drive the actuators.
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
rtmcadjlms32fFree
void rtmcadjlms32fFree(asptRtmcadjlms32f *rtmcadjlms)
Frees the allocated memory for this asptRtmcadjlms32f filter.
- Returns :
- Input Parameters :
- rtmcadjlms : pointer to the asptRtmcadjlms32f filter
- Remarks :
-
Do not use with filters created using rtmcadjlms32fInitStatic().
<< Back to top
rtmcadjlms32fReset
DT32S rtmcadjlms32fReset(asptRtmcadjlms32f *rtmcadjlms)
Resets all filter coefficients to zero.
- Returns :
- Input Parameters :
- rtmcadjlms : pointer to an asptRtmcadjlms32f filter to be reset
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
rtmcadjlms32fResetDelayLine
DT32S rtmcadjlms32fResetDelayLine(asptRtmcadjlms32f *rtmcadjlms)
Resets all internal delay lines to zero.
- Returns :
- Input Parameters :
- rtmcadjlms : pointer to an asptRtmcadjlms32f filter to be reset
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
rtmcadjlms32fGetCoef
DT32S rtmcadjlms32fGetCoef(asptRtmcadjlms32f *rtmcadjlms, 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 :
- rtmcadjlms : pointer to an asptRtmcadjlms32f 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/rtmcadjlms->coef is a NULL pointer
- ASPT_RANGE_ERR : ref/act/ind/N is not a valid input value
<< Back to top
rtmcadjlms32fSetCoef
DT32S rtmcadjlms32fSetCoef(asptRtmcadjlms32f *rtmcadjlms, 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 :
- rtmcadjlms : pointer to an asptRtmcadjlms32f 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 :
- rtmcadjlms->coef is updated
- Error Conditions
- ASPT_NULL_PTR_ERR : newCoef/rtmcadjlms->coef is a NULL pointer
- ASPT_RANGE_ERR : ref/act/ind/N is not a valid input value
<< Back to top
rtmcadjlms32fGetDelayLine
DT32S rtmcadjlms32fGetDelayLine(asptRtmcadjlms32f *rtmcadjlms, DT32F *buf, DT32S ref, DT32S ind, DT32S N, DT32S flip)
Copies N internal delay line samples starting from delayLine[ind]
of system input ref to dstBuf.
- Returns :
-
On success returns the number of samples copied, otherwise the
error code (negative int).
- Input Parameters :
- rtmcadjlms : pointer to an asptRtmcadjlms32f 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/rtmcadjlms->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
rtmcadjlms32fSetDelayLine
DT32S rtmcadjlms32fSetDelayLine(asptRtmcadjlms32f *rtmcadjlms, DT32F *newCoef, DT32S ref, DT32S ind, DT32S N, DT32S flip)
Initializes N internal delay line samples for system input 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 :
- rtmcadjlms : pointer to an asptRtmcadjlms32f filter.
- newBuf : new data buffer.
- ref : specifies the reference signal delay line to be set.
- 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 :
- rtmcadjlms->delayLine is updated
- Error Conditions
- ASPT_NULL_PTR_ERR : newBuf/rtmcadjlms->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
rtmcadjlms32fResize
DT32S rtmcadjlms32fResize(asptRtmcadjlms32f *rtmcadjlms, DT32S Nref, DT32S Nact, DT32S Nsen, DT32S newLength)
Resizes an asptRtmcadjlms32f filter keeping as much of the filter
state as possible.
- Returns :
- Input Parameters :
- rtmcadjlms : pointer to the asptRtmcadjlms32f 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 asptRtmcadjlms32f filters.