Back to C-ASPT Contents Page
asptBiquad32f
API Summary
API to create and delete an asptBiquad32f filters
API to filter through an asptBiquad32f filters
API to retrieve the properties of an asptBiquad32f objects
- DT32S biquad32fGetCoef(asptBiquad32f *biquad32f, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S biquad32fGetFeedForwardCoef(asptBiquad32f *biquad32f, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S biquad32fGetFeedBackCoef(asptBiquad32f *biquad32f, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S biquad32fGetDelayLine(asptBiquad32f *biquad32f, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- biquad32fGetCoefPtr( asptBiquad32f
*biquad32f )
- biquad32fGetFeedForwardCoefPtr( asptBiquad32f
*biquad32f )
- biquad32fGetFeedBackCoefPtr( asptBiquad32f
*biquad32f )
- biquad32fGetDelayLinePtr( asptBiquad32f
*biquad32f )
API to set the properties of an asptBiquad32f filter
- DT32S biquad32fResetDelayLine(asptBiquad32f *biquad32f)
- DT32S biquad32fSetCoef(asptBiquad32f *biquad32f, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S biquad32fSetFeedForwardCoef(asptBiquad32f *biquad32f, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S biquad32fSetFeedBackCoef(asptBiquad32f *biquad32f, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
- DT32S biquad32fSetDelayLine(asptBiquad32f *biquad32f, DT32F *newBuf, DT32S ind, DT32S N, DT32S flip)
Description
Implements the direct form 2 BIQUAD filter section using circular buffering. The filter supports sample per sample as well as block processing.
Copyright
Copyright (c) DSP ALGORITHMS 2003; all rights reserved.
<< Back to top
biquad32fInit
DT32S biquad32fInit (asptBiquad32f *biquad, DT32F *pCof)
Initializes an asptBiquad32f filter.- Returns :
- Input Parameters :
- biquad : pointer to asptBiquad32f filter to be initialized
- pCof : pointer to the array of 5 coefficients stored in the
following order [a_0 a_1 a_2 b_1 b_2]
- Output Parameters :
- biquad is initialized using the given coefficients
- Error Conditions
- ASPT_NO_ERR : Initialization success
- ASPT_NULL_PTR_ERR : pCof is a NULL pointer
<< Back to top
biquad32fBlockFilter
DT32S biquad32fBlockFilter(asptBiquad32f *biquad, DT32F *inp, DT32F *out, DT32S BlockLength)
Calculates the filter output; block processing. - Returns :
- Input Parameters :
- biquad : pointer to asptBiquad32f filter
- inp : array of input samples.
- Output Parameters :
- out : array of output samples
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : inp/out is a NULL pointer
<< Back to top
biquad32fResetDelayLine
DT32S biquad32fResetDelayLine(asptBiquad32f *biquad32f)
Resets the internal delay lines to zero. - Returns :
- Input Parameters :
- biquad : pointer to the asptBiquad32f filter to be reset.
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
biquad32fGetCoef
DT32S biquad32fGetCoef(asptBiquad32f *biquad32f, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Copies N filter coefficients starting from coef[ind] to dstBuf. - Returns :
-
on success returns the number of coefficients copied, otherwise an error code
- Input Parameters :
- biquad : pointer to asptBiquad32f 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
- Output Parameters :
- Error Conditions
- ASPT_NULL_PTR_ERR : dstBuf/biquad is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
biquad32fGetFeedForwardCoef
DT32S biquad32fGetFeedForwardCoef(asptBiquad32f *biquad32f, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Copies N feedforward filter coefficients starting from coef[ind] to dstBuf. - Returns :
-
on success returns the number of coefficients copied, otherwise an error code
- Input Parameters :
- biquad : pointer to asptBiquad32f 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
- Output Parameters :
- Error Conditions
- ASPT_NULL_PTR_ERR : dstBuf/biquad is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
biquad32fGetFeedBackCoef
DT32S biquad32fGetFeedBackCoef(asptBiquad32f *biquad32f, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Copies N feedback filter coefficients starting from coef[ind] to dstBuf. - Returns :
-
on success returns the number of coefficients copied, otherwise an error code
- Input Parameters :
- biquad : pointer to asptBiquad32f 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
- Output Parameters :
- Error Conditions
- ASPT_NULL_PTR_ERR : dstBuf/biquad is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
biquad32fSetCoef
DT32S biquad32fSetCoef(asptBiquad32f *biquad32f, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Initializes N filter coefficients starting from coef[ind] to the contents of newCoef.- Returns :
-
on success returns the number of coefficients initialized, otherwise an error code
- Input Parameters :
- biquad : pointer to asptBiquad32f 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
- Output Parameters :
- Error Conditions
- ASPT_NULL_PTR_ERR : newCoef/biquad is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
biquad32fSetFeedForwardCoef
DT32S biquad32fSetFeedForwardCoef(asptBiquad32f *biquad32f, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Initializes N feedforward filter coefficients starting from coef[ind] to the contents of newCoef.- Returns :
-
on success returns the number of coefficients initialized, otherwise an error code
- Input Parameters :
- biquad : pointer to asptBiquad32f 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
- Output Parameters :
- Error Conditions
- ASPT_NULL_PTR_ERR : newCoef/biquad is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
biquad32fSetFeedBackCoef
DT32S biquad32fSetFeedBackCoef(asptBiquad32f *biquad32f, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Initializes N feedback filter coefficients starting from coef[ind] to the contents of newCoef.- Returns :
-
on success returns the number of coefficients initialized, otherwise an error code
- Input Parameters :
- biquad : pointer to asptBiquad32f 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
- Output Parameters :
- Error Conditions
- ASPT_NULL_PTR_ERR : newCoef/biquad is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
biquad32fGetDelayLine
DT32S biquad32fGetDelayLine(asptBiquad32f *biquad32f, DT32F *buf, DT32S ind, DT32S N, DT32S flip)
Copies N internal delay line samples starting from delayLine[ind] to dstBuf. - Returns :
-
on success returns the number of samples copied, otherwise an error code
- Input Parameters :
- biquad : pointer to sptBiquad32f filter.
- dstBuf : 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/biquad 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.
<< Back to top
biquad32fSetDelayLine
DT32S biquad32fSetDelayLine(asptBiquad32f *biquad32f, DT32F *newBuf, DT32S ind, DT32S N, DT32S flip)
Initializes N internal delay line samples starting from delayLine[ind] to the contents of the given array. - Returns :
-
on success returns the number of samples initialized, otherwise an error code
- Input Parameters :
- biquad : pointer to asptBiquad32f filter.
- newBuf : new data 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 :
- biquad->delayLine is updated
- Error Conditions
- ASPT_NULL_PTR_ERR : newBuf/biquad 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.