Back to C-ASPT Contents Page
asptOsbfdf32f
API Summary
API to create and delete asptOsbfdf32f filters
- DT32S osbfdf32fInit(asptOsbfdf32f *osbfdf,DT32S M,DT32S L,DT32S *ip,DT32F *w)
- DT32S osbfdf32fInitStatic(asptOsbfdf32f *osbfdf,DT32S M,DT32S L,DT32F *pCof,DT32F *pDat,DT32S *ip,DT32F *w)
- void osbfdf32fFree(asptOsbfdf32f *osbfdf)
API to filter through asptOsbfdf32f filters
API to retrieve the properties of asptOsbfdf32f filters
API to set the properties of asptOsbfdf32f filters
Description
Implements the Overlap-Save Block Frequency Domain Filter (OSBFDF).
Copyright
Copyright (c) DSP ALGORITHMS 2003; all rights reserved.
<< Back to top
osbfdf32fInit
DT32S osbfdf32fInit(asptOsbfdf32f *osbfdf,DT32S M,DT32S L,DT32S *ip,DT32F *w)
Initializes an asptOsbfdf32f filter and allocates its necessary storage buffers - Returns :
-
Error code. On failure, the filterLength member of the filter is set to zero.
- Input Parameters :
- osbfdf : pointer to the asptOsbfdf32f to be initialized
- M : number of time domain filter coefficients
- L : block length (number of new samples each block)
- ip : fft bit reversal table
- w : fft twiddle factor table.
- Output Parameters :
- osbfdf 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 : L/M is not a valid input value
- ASPT_NO_MEM_ERR : could not allocate memory
<< Back to top
osbfdf32fInitStatic
DT32S osbfdf32fInitStatic(asptOsbfdf32f *osbfdf,DT32S M,DT32S L,DT32F *pCof,DT32F *pDat,DT32S *ip,DT32F *w)
Initializes an asptOsbfdf32f filter to use pre-allocated memory blocks - Returns :
-
Error code. On failure, the filterLength member of the filter is set to zero.
- Input Parameters :
- osbfdf : pointer to the asptOsbfdf32f to be initialized
- M : number of time domain filter coefficients
- L : block length (number of new samples each block)
- pCof : pointer to a pre-allocated memory in program memory
of at least [fftLength] DT32F locations to be used for the filter coefficients.
- pDat : pointer to a pre-allocated memory in data memory of at least
[C1 + 2*fftLength + 2*(fftLength/2+1)] DT32F locations to be used for data storage.
- ip : fft bit reversal table
- w : fft twiddle factor table.
- Output Parameters :
- osbfdf 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 : L/M is not a valid input value
- ASPT_NO_MEM_ERR : could not allocate memory
- Remarks :
-
fftLength = 2^(nextpow2(L+M-1)). C1 = fftLength - blockLength.
<< Back to top
osbfdf32fFilter
DT32S osbfdf32fFilter(asptOsbfdf32f *osbfdf, DT32F *inp, DT32F *out)
Filters the block of input samples inp[] through the asptOsbfdf32f filter resulting in the block of output samples out[].- Returns :
- Input Parameters :
- osbfdf : asptOsbfdf32f filter to be processed
- inp : pointer to the new block of input samples
- Output Parameters :
- out : pointer to an array to store the filter output samples
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
osbfdf32fFree
void osbfdf32fFree(asptOsbfdf32f *osbfdf)
Frees the allocated memory for this asptOsbfdf32f filter. - Returns :
- Input Parameters :
- osbfdf : pointer to the asptOsbfdf32f filter
- Remarks :
-
Use this function only with filters created with osbfdf32fInit(). Do not use with asptOsbfdf32f filters created using osbfdf32fInitStatic().
<< Back to top
osbfdf32fResetDelayLine
DT32S osbfdf32fResetDelayLine(asptOsbfdf32f *osbfdf)
Resets the internal delay line to zeros.- Returns :
- Input Parameters :
- osbfdf : pointer to an asptosbfdf32f filter to be reset.
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
osbfdf32fGetCoef
DT32S osbfdf32fGetCoef(asptOsbfdf32f *osbfdf, DT32F *dstBuf, DT32S ind, DT32S N, DT32S flip)
Copies N internal filter coefficients starting from coef[ind] to dstBuf. - Returns :
-
On success returns the number of coefficients copied, otherwise the error code (negative int).
- Input Parameters :
- osbfdf : pointer to asptOsbfdf32f 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.
- Error Conditions
- ASPT_NULL_PTR_ERR : dstBuf/osbfdf->wFreq is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
osbfdf32fSetCoef
DT32S osbfdf32fSetCoef(asptOsbfdf32f *osbfdf, DT32F *newCoef, DT32S ind, DT32S N, DT32S flip)
Initializes N internal (time domain) filter coefficients starting from coef[ind] to the contents of newCoef. - Returns :
-
On success returns the number of coefficients copied, otherwise the error code (negative int).
- Input Parameters :
- osbfdf : pointer to asptOsbfdf32f 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.
- Error Conditions
- ASPT_NULL_PTR_ERR : newCoef/osbfdf->wFreq is a NULL pointer
- ASPT_RANGE_ERR : ind/N is not a valid input value
<< Back to top
osbfdf32fResize
DT32S osbfdf32fResize(asptOsbfdf32f *osbfdf, DT32S newLen, DT32S newBlock)
Resizes an asptOsbfdf32f filter keeping as much of the filter state as possible. - Returns :
- Input Parameters :
- osbfdf : pointer to asptOsbfdf32f filter to be resized.
- newLen : required new filter length
- newBlock : new block length
- Error Conditions
- ASPT_NO_ERR : Resizing is successful
- ASPT_NULL_PTR_ERR : NULL pointer error
- ASPT_RANGE_ERR : 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 asptOsbfdf32f filters.