complex wire buffer format

2 posts / 0 new
Last post
Darrel
Offline
Last seen: 1 month 4 days ago
Joined: 11/29/2016 - 5:49pm
complex wire buffer format

What is the format for a complex wire buffer?  I am assuming it would packed real then complex.  Is this correct?

So an example for accessing the complex data would be:  

awe_modaxisSBInstance *S = (awe_modaxisSBInstance *)pInstance;
WireInstance **pWires = ClassModule_GetWires(S);

cplx *src = (cplx *)pWires[0];
cplx *sbL = src+0;
cplx *sbR = src+1;
cplx *dst = (cplx *)pWires[1];
cplx *subBandVcaL = dst+0;
cplx *subBandVcaR = dst+1;
TaxisSB *A = (TaxisSB *)S->aStruct;

axisSB
(
        A, 
        sbL, 
        sbR, 
        subBandVcaL, 
        subBandVcaR
);

 

cplx is defined as:

 

typedef struct {
    float r;
    float i;
}cplx; 

Axel Nilsson
Offline
Last seen: 2 hours 4 min ago
Joined: 12/19/2016 - 2:02pm

Hi Darrel,

 

Yes, you are correct that complex data is packed [real,imaginary,real,imaginary,...] in the buffers. Though you should be accessing the 'buffer' element of the pWires structure, as below:

cplx *src = (cplx *)pWires[0]->buffer;

 

And of course your implementation assumes stereo input, but I'm sure you have some enforcement that guarantees that so it shouldn't be a problem. 

 

 

-Axel