#define BLOCK_SZ 512
#define FIRL 16
#define CHANNELS 2
typedef struct
{
int real;
int imag;
}complex;
/*
weight vector with two weights
*/
typedef struct
{
complex w1;
complex w2;
}beamvec;
/*
data type for data that needs to be filtered by a fir_r8 function
*/
typedef struct
{
short data[(BLOCK_SZ/2)+FIRL-1];
short *pstart;
short *pdata;
short *pend;
}firinputbl;
/*
the state of a fir filter
*/
typedef struct
{
short firstate[FIRL-1];
}fir16;
/*
function prototypes
*/
void initfirinputbl(firinputbl *firinputblobj);
void initfir(fir16 *firobj);
void firconfig(fir16 *firobj, firinputbl *inputblobj);
void firready(fir16 *firobj, firinputbl *inputblobj);
void mix2channel(short *inputstream, short *ch1I, short *ch1Q, short *ch2I, short *ch2Q);
void beamform(short *Iout, short *Qout, short *I1, short *Q1, short *I2, short *Q2,
beamvec *wobj, const int length);
complex cxmult(const complex var1, const complex var2);
complex cxadd(const complex var1, const complex var2);
complex cxinprodcj(complex *var1, complex *var2, const int length);
complex cxinprod(complex *var1, complex *var2, const int length);
complex cxconj(const complex var1);
int cxreal(const complex var1);
int cximag(const complex var1);
void beamform2(complex *ch1, complex *ch2, complex* out, complex *w, int length);