Back to C-ASPT Contents Page
asptRtmcfdadjlms32f
API Summary
API to create and delete asptRtmcfdadjlms32f filters
- DT32S rtmcfdadjlms32fInit (asptRtmcfdadjlms32f *rtmcadjlms,DT32S Nref,DT32S Nact,DT32S Nsen,DT32S M,DT32S L,DT32F mu,DT32S cs,DT32F *sPathEst,DT32S seL,DT32S *ip,DT32F *w)
- DT32S rtmcfdadjlms32fInitStatic(asptRtmcfdadjlms32f *rtmcadjlms,DT32S Nref,DT32S Nact,DT32S Nsen,DT32S M,DT32S L,DT32F mu,DT32S cs,DT32F *sPathEst,DT32S seL,DT32F *pCof,DT32F *pDat,DT32S *ip,DT32F *w)
- void rtmcfdadjlms32fFree(asptRtmcfdadjlms32f *rtmcadjlms)
API to filter and update asptRtmcfdadjlms32f filters
API to retrieve the properties of asptRtmcfdadjlms32f filters
- DT32S rtmcfdadjlms32fGetCoef(asptRtmcfdadjlms32f *rtmcadjlms,DT32F *dstBuf,DT32S ref,DT32S act,DT32S ind,DT32S N,DT32S flip)
- DT32S rtmcfdadjlms32fGetEstSecPath(asptRtmcfdadjlms32f *rtmcadjlms,DT32F *dstBuf,DT32S act,DT32S sen,DT32S ind,DT32S N,DT32S flip)
- rtmcfdadjlms32fGetCoefPtr( asptRtmcfdadjlms32f
*rtmcadjlms )
- rtmcfdadjlms32fGetEstSecPathPtr( asptRtmcfdadjlms32f
*rtmcadjlms )
- rtmcfdadjlms32fGetFilterLength( asptRtmcfdadjlms32f
*rtmcadjlms )
- rtmcfdadjlms32fGetBlockLength( asptRtmcfdadjlms32f
*rtmcadjlms )
- rtmcfdadjlms32fGetEstSecPathLength( asptRtmcfdadjlms32f
*rtmcadjlms )
- rtmcfdadjlms32fGetFftLength( asptRtmcfdadjlms32f
*rtmcadjlms )
- rtmcfdadjlms32fGetStepSize( asptRtmcfdadjlms32f
*rtmcadjlms )
- rtmcfdadjlms32fGetConstrain( asptRtmcfdadjlms32f
*rtmcadjlms )
- rtmcfdadjlms32fGetNrefs( asptRtmcfdadjlms32f
*rtmcadjlms )
- rtmcfdadjlms32fGetNacts( asptRtmcfdadjlms32f
*rtmcadjlms )
- rtmcfdadjlms32fGetNsens( asptRtmcfdadjlms32f
*rtmcadjlms )
API to set the properties of asptRtmcfdadjlms32f filters
- DT32S rtmcfdadjlms32fReset(asptRtmcfdadjlms32f *rtmcadjlms)
- DT32S rtmcfdadjlms32fResetDelayLine(asptRtmcfdadjlms32f *rtmcadjlms)
- DT32S rtmcfdadjlms32fResize(asptRtmcfdadjlms32f *rtmcadjlms,DT32S Nref,DT32S Nact,DT32S Nsen,DT32S newLen,DT32S newBlock)
- DT32S rtmcfdadjlms32fSetCoef(asptRtmcfdadjlms32f *rtmcadjlms,DT32F *newCoef,DT32S ref,DT32S act,DT32S ind,DT32S N,DT32S flip)
- DT32S rtmcfdadjlms32fSetEstSecPath(asptRtmcfdadjlms32f *rtmcadjlms,DT32F *dstBuf,DT32S act,DT32S sen,DT32S ind,DT32S N,DT32S flip)
- rtmcfdadjlms32fSetStepSize( asptRtmcfdadjlms32f
*rtmcadjlms, newSs )
- rtmcfdadjlms32fSetConstrain( asptRtmcfdadjlms32f
*rtmcadjlms, newC )
- rtmcfdadjlms32fSetEstSecPathLength( asptRtmcfdadjlms32f
*rtmcadjlms, newL )
Description
Implements the Real-Time Multi-Channel Frequency Domain 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
rtmcfdadjlms32fInit
DT32S rtmcfdadjlms32fInit (asptRtmcfdadjlms32f *rtmcadjlms,DT32S Nref,DT32S Nact,DT32S Nsen,DT32S M,DT32S L,DT32F mu,DT32S cs,DT32F *sPathEst,DT32S seL,DT32S *ip,DT32F *w)
Initializes an asptRtmcfdadjlms32f filter and allocates its necessary storage buffers - Returns :
-
Error code. On failure, the filterLength member of the filter is set to zero.
- Input Parameters :
- rtmcfdadjlms : pointer to the asptRtmcfdadjlms32f filter to be initialized
- Nref : number of input reference signals
- Nact : number of secondary actuators
- Nsen : number of error sensors
- M : number of time domain 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 :
- rtmcfdadjlms is initialized using the given input arguments.
- Error Conditions
- ASPT_NO_ERR : Initialization is successful
- ASPT_NULL_PTR_ERR : ip/w is a NULL pointer
- ASPT_RANGE_ERR : Nref/Nact/Nsen/L/M/seL is not a valid input value
- ASPT_NO_MEM_ERR : could not allocate memory
<< Back to top
rtmcfdadjlms32fInitStatic
DT32S rtmcfdadjlms32fInitStatic(asptRtmcfdadjlms32f *rtmcadjlms,DT32S Nref,DT32S Nact,DT32S Nsen,DT32S M,DT32S L,DT32F mu,DT32S cs,DT32F *sPathEst,DT32S seL,DT32F *pCof,DT32F *pDat,DT32S *ip,DT32F *w)
Initializes an asptRtmcfdadjlms32f filter to use pre-allocated memory blocks - Returns :
-
Error code. On failure, the filterLength member of the structure is set to zero.
- Input Parameters :
- rtmcfdadjlms : pointer to the asptRtmcfdadjlms32f to be initialized
- Nref : number of input reference signals
- Nact : number of secondary actuators
- Nsen : number of error sensors
- M : number of time domain 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 [fftLength*Nact*(Nsen + Nref)] DT32F locations to be used for the filter coefficients and sec. source coefficients.
- pDat : pointer to a pre-allocated memory in data memory of at
least [Nref*C1 + (2*Nref+Nact+1)*fftLength + Nref*BO2P1] DT32F locations to be used for data storage.
- ip : fft bit reversal table
- w : fft twiddle factor table.
- Output Parameters :
- rtmcfdadjlms is initialized using the given input arguments.
- Error Conditions
- ASPT_NO_ERR : Initialization is successful
- ASPT_NULL_PTR_ERR : ip/w/pCof/pDat is a NULL pointer
- ASPT_RANGE_ERR : Nref/Nact/Nsen/L/M/seL is not a valid input value
- ASPT_NO_MEM_ERR : could not allocate memory
- Remarks :
-
fftLength = 2^(nextpow2(max(M,seL)+L+-1)). C1 = fftLength - blockLength. BO2P1 = fftLength/2 + 1
<< Back to top
rtmcfdadjlms32fFilterUpdate
DT32S rtmcfdadjlms32fFilterUpdate(asptRtmcfdadjlms32f *rtmcadjlms, DT32F *ref, DT32F *sen, DT32F *act)
Calculates the filter output and updates the coefficients vector according to the MCFDADJLMS algorithm. - Returns :
- Input Parameters :
- rtmcfdadjlms : pointer to the asptRtmcfdadjlms32f filter
- ref : array of new reference samples at each input
- sen : array of samples measured at the sensors
- Output Parameters :
- act : array to store the actuators' signals [Nact * blockLength]
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
rtmcfdadjlms32fFilterOnly
DT32S rtmcfdadjlms32fFilterOnly(asptRtmcfdadjlms32f *rtmcadjlms, DT32F *ref, DT32F *act)
Calculates the filter output but does not update the coefficients vector. It also updates the internal buffers and power estimate. - Returns :
- Input Parameters :
- rtmcfdadjlms : pointer to the asptRtmcfdadjlms32f filter
- ref : new reference block of samples.
- Output Parameters :
- act : array to store the actuators' signals [Nact * blockLength]
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
rtmcfdadjlms32fFree
void rtmcfdadjlms32fFree(asptRtmcfdadjlms32f *rtmcadjlms)
Frees the allocated memory for this asptRtmcfdadjlms32f filter. - Returns :
- Input Parameters :
- rtmcfdadjlms : pointer to the asptRtmcfdadjlms32f filter
- Remarks :
-
Use this function only with filters created with rtmcfdadjlms32fInit(). Do not use with asptRtmcfdadjlms32f filters created using rtmcfdadjlms32fInitStatic().
<< Back to top
rtmcfdadjlms32fReset
DT32S rtmcfdadjlms32fReset(asptRtmcfdadjlms32f *rtmcadjlms)
Resets all filter coefficients to zero.- Returns :
- Input Parameters :
- rtmcfdadjlms : pointer to an asptRtmcfdadjlms32f filter to be reset.
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
rtmcfdadjlms32fResetDelayLine
DT32S rtmcfdadjlms32fResetDelayLine(asptRtmcfdadjlms32f *rtmcadjlms)
Resets the internal delay line to zeros.- Returns :
- Input Parameters :
- rtmcfdadjlms : pointer to an asptRtmcfdadjlms32f filter to be reset.
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
rtmcfdadjlms32fGetCoef
DT32S rtmcfdadjlms32fGetCoef(asptRtmcfdadjlms32f *rtmcadjlms,DT32F *dstBuf,DT32S ref,DT32S act,DT32S ind,DT32S N,DT32S flip)
Copies 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 :
- rtmcfdadjlms : pointer to an asptRtmcfdadjlms32f 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.
- Error Conditions
- ASPT_NULL_PTR_ERR : dstBuf/rtmcfdadjlms->wFreq is a NULL pointer
- ASPT_RANGE_ERR : ref/act/ind/N is not a valid input value
<< Back to top
rtmcfdadjlms32fSetCoef
DT32S rtmcfdadjlms32fSetCoef(asptRtmcfdadjlms32f *rtmcadjlms,DT32F *newCoef,DT32S ref,DT32S act,DT32S ind,DT32S N,DT32S flip)
Initializes N coefficients of the (time domain) controller filter 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 an error code (negative int).
- Input Parameters :
- rtmcfdadjlms : pointer to an asptRtmcfdadjlms32f 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.
- Error Conditions
- ASPT_NULL_PTR_ERR : newCoef/rtmcfdadjlms->wFreq is a NULL pointer
- ASPT_RANGE_ERR : ref/act/ind/N is not a valid input value
<< Back to top
rtmcfdadjlms32fGetEstSecPath
DT32S rtmcfdadjlms32fGetEstSecPath(asptRtmcfdadjlms32f *rtmcadjlms,DT32F *dstBuf,DT32S act,DT32S sen,DT32S ind,DT32S N,DT32S flip)
Copies N internal (time domain) coefficients from the estimated secondary path filter between actuator act and sensor sen, starting from secPathEst[ind] to dstBuf. - Returns :
-
On success returns the number of coefficients copied, otherwise the error code (negative int).
- Input Parameters :
- rtmcfdadjlms : pointer to an asptRtmcfdadjlms32f filter.
- dstBuf : destination buffer.
- act, ref : specify the filter to be copied.
- 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/rtmcfdadjlms->secPathEst is a NULL pointer
- ASPT_RANGE_ERR : act/sen/ind/N is not a valid input value
<< Back to top
rtmcfdadjlms32fSetEstSecPath
DT32S rtmcfdadjlms32fSetEstSecPath(asptRtmcfdadjlms32f *rtmcadjlms,DT32F *dstBuf,DT32S act,DT32S sen,DT32S ind,DT32S N,DT32S flip)
Initializes N internal (time domain) coefficients from the estimated secondary path filter between actuator act and sensor sen, starting from secPathEst[ind] to the contents of newCoef. - Returns :
-
On success returns the number of coefficients copied, otherwise the error code (negative int).
- Input Parameters :
- rtmcfdadjlms : pointer to an asptRtmcfdadjlms32f filter.
- newCoef : destination buffer.
- act, ref : specify the filter to be copied.
- 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/rtmcfdadjlms->secPathEst is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
rtmcfdadjlms32fResize
DT32S rtmcfdadjlms32fResize(asptRtmcfdadjlms32f *rtmcadjlms,DT32S Nref,DT32S Nact,DT32S Nsen,DT32S newLen,DT32S newBlock)
Resizes an asptRtmcfdadjlms32f filter keeping as much of the filter state as possible. - Returns :
- Input Parameters :
- rtmcfdadjlms : pointer to the asptRtmcfdadjlms32f filter to be resized
- Nref : Number of reference signals
- Nact : Number of secondary actuators
- Nsen : Number of error sensors
- 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 : Nref/Nact/Nsen/newLength/newBlock 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 asptRtmcfdadjlms32f filters.