Back to C-ASPT Contents Page
asptSoiir132f
API Summary
API to create and delete an asptSoiir132f filters
API to filter through and update an asptSoiir132f filters
API to retrieve the properties of an asptSoiir132f objects
- DT32S soiir132fGetDelayLine (asptSoiir132f *soiir, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- soiir132fGetCfCoef( asptSoiir132f
*soiir )
- soiir132fGetBwCoef( asptSoiir132f
*soiir )
- soiir132fGetDelayLinePtr( asptSoiir132f
*soiir )
- soiir132fGetLastErrorSample( asptSoiir132f
*soiir )
- soiir132fGetCfStepSize( asptSoiir132f
*soiir )
- soiir132fGetBwStepSize( asptSoiir132f
*soiir )
- soiir132fGetCfMin( asptSoiir132f
*soiir )
- soiir132fGetBwMin( asptSoiir132f
*soiir )
- soiir132fGetCfMax( asptSoiir132f
*soiir )
- soiir132fGetBwMax( asptSoiir132f
*soiir )
API to set the properties of an asptSoiir132f filter
- DT32S soiir132fReset(asptSoiir132f *soiir)
- DT32S soiir132fResetDelayLine(asptSoiir132f *soiir)
- DT32S soiir132fSetDelayLine(asptSoiir132f *soiir, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- soiir132fSetCfCoef( asptSoiir132f
*soiir, ncf )
- soiir132fSetBwCoef( asptSoiir132f
*soiir, nbw )
- soiir132fSetCfStepSize( asptSoiir132f
*soiir, ss )
- soiir132fSetBwStepSize( asptSoiir132f
*soiir, ss )
- soiir132fSetCfMin( asptSoiir132f
*soiir, cfmin )
- soiir132fSetBwMin( asptSoiir132f
*soiir, bwmin )
- soiir132fSetCfMax( asptSoiir132f
*soiir, cfmax )
- soiir132fSetBwMax( asptSoiir132f
*soiir, bwmax )
Description
Implements the Second Order IIR type-1 adaptive algorithm.
Copyright
Copyright (c) DSP ALGORITHMS 2003; all rights reserved.
<< Back to top
soiir132fInit
DT32S soiir132fInit(asptSoiir132f *soiir, DT32F cf, DT32F bw, DT32F cfss, DT32F cfbw)
Initializes an asptSoiir132f filter. No memory allocation is needed.- Returns :
- Input Parameters :
- soiir : pointer to asptSoiir132f filter to be initialized
- cf : initial value of center frequency coefficient [-1 1]
- bw : initial value of bandwidth coef [0 1]
- cfss : center frequency step size
- bwss : bandwidth step size
- Remarks :
-
bwMax = 0.9f; bwMin = 0.1f; cfMax = 0.99f; cfMin = -0.99f; all delay lines are reset to zeros use the soiir132fSetxxx to change the default values if necessary.
- Error Conditions
- ASPT_NO_ERR : Initialization is successful
- ASPT_RANGE_ERR : cf/bw is not a valid input value
<< Back to top
soiir132fFilterUpdate
DT32F soiir132fFilterUpdate(asptSoiir132f *soiir, DT32F x)
Calculates the filter output and updates the cf and bw coefficients according to the soiir1 algorithm. - Returns :
- Input Parameters :
- soiir : pointer to the asptSoiir132f filter
- inp : new input sample
- Remarks :
-
The last error sample is stored internally and can be retrieved by calling soiir132fGetLastErrorSample().
<< Back to top
soiir132fFilterOnly
DT32F soiir132fFilterOnly (asptSoiir132f *soiir, DT32F x)
Calculates the filter output but does not update the coefficients. It also updates the internal delay lines. - Returns :
- Input Parameters :
- soiir : pointer to the asptSoiir132f filter
- inp : input sample vector
- Remarks :
-
The last error sample is stored internally and can be retrieved by calling soiir132fGetLastErrorSample().
<< Back to top
soiir132fReset
DT32S soiir132fReset(asptSoiir132f *soiir)
Resets all filter coefficients to zero- Returns :
- Input Parameters :
- soiir : pointer to an asptSoiir132f filter to be reset.
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
soiir132fResetDelayLine
DT32S soiir132fResetDelayLine(asptSoiir132f *soiir)
Resets all internal delay lines to zero.- Returns :
- Input Parameters :
- soiir : pointer to an asptSoiir132f filter to be reset
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
soiir132fSetDelayLine
DT32S soiir132fSetDelayLine(asptSoiir132f *soiir, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Initializes the N; 0<= N <=2 internal delay line samples starting from delayLine[ind] sample. to the contents of the given array. ind = 0 is the newest input sample. - Returns :
-
On success returns the number of samples initialized, otherwise an error code (negative int).
- Input Parameters :
- soiir : pointer to an asptSoiir132f filter to be set.
- newBuf : pointer to the new samples vector.
- ind : index to the first sample to be set.
- N : number of samples to be set
- flip : if not 0, will flip the samples order.
- Error Conditions
- ASPT_NULL_PTR_ERR : newBuf/soiir is a NULL pointer
- ASPT_RANGE_ERR : 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
soiir132fGetDelayLine
DT32S soiir132fGetDelayLine (asptSoiir132f *soiir, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Copies the N; 0 <= N <=2 internal delay line samples starting from delayLine[ind] to the given buffer; ind = 0 is the newest input sample. - Returns :
-
On success returns the number of samples copied, otherwise the error code (negative int).
- Input Parameters :
- soiir : pointer to an asptSoiir132f filter to be set
- dstBuf : pointer to the destination buffer
- 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/soiir is a NULL pointer
- ASPT_RANGE_ERR : 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.