Back to C-ASPT Contents Page
asptMcmixr32f
API Summary
API to create and delete an asptMcmixr filters
API to filter through an asptMcmixr filters
API to retrieve the properties of an asptMcmixr filter
- mcmixr32fGetInputs( asptMcmixr32f
*mcmixr )
- mcmixr32fGetOutputs( asptMcmixr32f
*mcmixr )
- mcmixr32fGetCoefPtr( asptMcmixr32f
*mcmixr )
- mcmixr32fGetFilterLength( asptMcmixr32f
*mcmixr )
- DT32S mcmixr32fGetCoef(asptMcmixr32f *mcmixr,DT32F *dstBuf,DT32S in,DT32S out,DT32S ind,DT32S N,DT32S flip)
- DT32S mcmixr32fGetDelayLine(asptMcmixr32f *mcmixr,DT32F *dstBuf,DT32S in,DT32S ind,DT32S N,DT32S flip)
API to set the properties of an asptMcmixr filter
- DT32S mcmixr32fResize(asptMcmixr32f *mcmixr,DT32S ins,DT32S outs,DT32S chL)
- DT32S mcmixr32fResetDelayLine(asptMcmixr32f *mcmixr)
- DT32S mcmixr32fSetCoef(asptMcmixr32f *mcmixr,DT32F *newCoef,DT32S in,DT32S out,DT32S ind,DT32S N,DT32S flip)
- DT32S mcmixr32fSetDelayLine(asptMcmixr32f *mcmixr,DT32F *newBuf,DT32S in,DT32S ind,DT32S N,DT32S flip)
- mcmixr32fSetCoefPtr( asptMcmixr32f
*mcmixr,ptr )
Description
Implements the Multi-Channel Mixer algorithm. asptMcmixr32f filters are used to calculate the response of a multi-channel input signals when passed through a multi-channel filter transfer function.
Copyright
Copyright (c) DSP ALGORITHMS 2003; all rights reserved.
<< Back to top
mcmixr32fInit
DT32S mcmixr32fInit(asptMcmixr32f *mcmixr,DT32S ins,DT32S outs,DT32S chL,DT32F *pCof)
Initializes an asptMcmixr32f filter and allocates its necessary storage buffers. - Returns :
-
Error code. On failure, the filterLength member of the filter is set to zero.
- Input Parameters :
- mcmixr : asptMcmixr32f filter to be initialized
- ins : number of system inputs
- outs : number of system outputs
- chL : number of taps of each channel
- pCof : pointer to the vector of system coefficients.
- This vector must be stored as follows :
H(in0,out0) H(in1,out0)..H(inN,out0)..H(in1,out0)..H(inM,outM). where H(inX,outY) is the transfer function between input X and output Y, each of those transfer functions must have chL coefficients. If any of the transfer functions is shorter than chL, pad with zeros
- Error Conditions
- ASPT_NO_ERR : Initialization is successful
- ASPT_NULL_PTR_ERR : pCof is a NULL pointer
- ASPT_RANGE_ERR : ins/outs/chL is not a valid input value
- ASPT_NO_MEM_ERR : could not allocate memory
<< Back to top
mcmixr32fInitStatic
DT32S mcmixr32fInitStatic(asptMcmixr32f *mcmixr,DT32S ins,DT32S outs,DT32S chL,DT32F *pCof,DT32F *pDat)
Initializes an asptMcmixr32f filter to use pre-allocated memory. - Returns :
-
Error code. On failure, the filterLength member of the filter is set to zero.
- Input Parameters :
- mcmixr : asptMcmixr32f filter to be initialized
- ins : number of system inputs
- outs : number of system outputs
- chL : number of taps of each channel
- pCof : pointer to the vector of system coefficients.
- This vector must be stored as follows :
H(in0,out0) H(in1,out0)..H(inN,out0)..H(in1,out0)..H(inM,outM). where H(inX,outY) is the transfer function between input X and output Y, each of those transfer functions must have chL coefficients. If any of the transfer functions is shorter than chL, pad with zeros.
- pDat : pointer to a pre-allocated data memory of at least (chL * ins)
memory locations
- Error Conditions
- ASPT_NO_ERR : Initialization is successful
- ASPT_NULL_PTR_ERR : pCof/pDat is a NULL pointer
- ASPT_RANGE_ERR : ins/outs/chL is not a valid input value
<< Back to top
mcmixr32fFilter
DT32F mcmixr32fFilter(asptMcmixr32f *mcmixr,const DT32F in[],DT32F out[])
Calculates the multi-channel system output. - Returns :
- Input Parameters :
- mcmixr : pointer to the asptMcmixr32f filter.
- in : an array of input samples [in0, in1, ..., inN]
- Output Parameters :
- out : an array of output samples [out0, out1, ..., outM]
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
mcmixr32fBlockFilter
DT32F mcmixr32fBlockFilter(asptMcmixr32f *mcmixr,const DT32F in[],DT32F out[],DT32S N)
Calculates the multi-channel system output for a block of input samples - Returns :
- Input Parameters :
- mcmixr : pointer to the asptMcmixr32f filter.
- in : an array of input samples [in0[], in1[], ..., inN[]]
- N : number of samples per block
- Output Parameters :
- out : an array of output samples [out0[], out1[], ..., outM[]]
- Error Conditions
- ASPT_NO_ERR : success
- ASPT_NULL_PTR_ERR : NULL pointer error
<< Back to top
mcmixr32fFree
void mcmixr32fFree(asptMcmixr32f *mcmixr)
Frees the allocated memory for this asptMcmixr32f filter. - Returns :
- Input Parameters :
- mcmixr : pointer to the mcmixr filter
- Remarks :
-
mcmixrInit(), but never use it with filters created with lmsLatticeInitStatic().
<< Back to top
mcmixr32fGetCoef
DT32S mcmixr32fGetCoef(asptMcmixr32f *mcmixr,DT32F *dstBuf,DT32S in,DT32S out,DT32S ind,DT32S N,DT32S flip)
Copies N filter coefficients starting from coef[ind] of the transfer function between input in and output out to dstBuf. - Returns :
-
On success returns the number of coefficients copied, otherwise the error code (negative int).
- Input Parameters :
- mcmixr : pointer to an asptMcmixr32f filter
- dstBuf : pointer to the destination buffer, length filterLength.
- in : system input index [0, 1, ..., N]
- out : system output index [0, 1, ..., M]
- ind : index of first coefficient to copy
- N : number of coefficients to be copied
- flip : if not zero, will flip the coefficients order
- Output Parameters :
- Error Conditions
- ASPT_NULL_PTR_ERR : dstBuf/mcmixr->coef is a NULL pointer
- ASPT_RANGE_ERR : in/out/ind/N is not a valid input value
<< Back to top
mcmixr32fSetCoef
DT32S mcmixr32fSetCoef(asptMcmixr32f *mcmixr,DT32F *newCoef,DT32S in,DT32S out,DT32S ind,DT32S N,DT32S flip)
Initializes N coefficients of the transfer function between input in and output out 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 :
- mcmixr : pointer to an asptMcmixr32f filter to be set
- newCoef : pointer to the new coefficients vector
- in : system input index [0, 1, ..., N]
- out : system output index [0, 1, ..., M]
- ind : index of first coefficient to be initialized
- N : number of coefficients to be initialized
- flip : if not 0, will flip the coefficients order
- Output Parameters :
- Error Conditions
- ASPT_NULL_PTR_ERR : newCoef/mcmixr->coef is a NULL pointer
- ASPT_RANGE_ERR : in/out/ind/N is not a valid input value
<< Back to top
mcmixr32fGetDelayLine
DT32S mcmixr32fGetDelayLine(asptMcmixr32f *mcmixr,DT32F *dstBuf,DT32S in,DT32S ind,DT32S N,DT32S flip)
Copies N internal delay line samples starting from delayLine[ind] for system input in to the dstBuf. - Returns :
-
On success returns the number of samples copied, otherwise the error code (negative int).
- Input Parameters :
- mcmixr : pointer to an asptMcmixr32f filter
- dstBuf : destination buffer
- in : system input index [0, 1, ..., N]
- 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/mcmixr->delayLine is a NULL pointer
- ASPT_RANGE_ERR : in/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
mcmixr32fSetDelayLine
DT32S mcmixr32fSetDelayLine(asptMcmixr32f *mcmixr,DT32F *newBuf,DT32S in,DT32S ind,DT32S N,DT32S flip)
Initializes N internal delay line samples starting from delayLine[ind] for system input in to the contents of newBuf. - Returns :
-
On success returns the number of samples initialized, otherwise the error code (negative int).
- Input Parameters :
- mcmixr : pointer to an asptMcmixr32f filter to be initialized
- newBuf : buffer containing the new samples
- in : system input index [0, 1, ..., N]
- ind : index to the first sample to be initialized
- N : number of samples to be initialized
- flip : if not 0, will flip the samples order
- Output Parameters :
- mcmixr->delayLine is updated
- Error Conditions
- ASPT_NULL_PTR_ERR : newBuf/mcmixr->delayLine is a NULL pointer
- ASPT_RANGE_ERR : in/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
mcmixr32fResize
DT32S mcmixr32fResize(asptMcmixr32f *mcmixr,DT32S ins,DT32S outs,DT32S chL)
Resizes an asptMcmixr32f filter keeping as much of its state as possible. - Returns :
- Input Parameters :
- mcmixr : pointer to the asptMcmixr32f filter to be resized
- ins : number of system inputs
- outs : number of system outputs
- chL : number of taps of each channel
- Error Conditions
- ASPT_NO_ERR : Resizing is success
- ASPT_NULL_PTR_ERR : NULL pointer error
- ASPT_RANGE_ERR : ins/outs/chL 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 asptMcmixr32f filters.
<< Back to top
mcmixr32fResetDelayLine
DT32S mcmixr32fResetDelayLine(asptMcmixr32f *mcmixr)
Resets all internal filter states to zero. - Returns :
- Input Parameters :
- mcmixr : pointer to an asptMcmixr32f filter to be reset
- Error Conditions
- ASPT_NO_ERR : Resetting is success
- ASPT_NULL_PTR_ERR : mcmixr->delayLine is a NULL pointer