/** ALOE headers */ #include #include #include #include "typetools.h" #include "itf_types.h" #include "inputs.h" #include "outputs.h" #include "stats.h" #include "gen_symbolsync.h" #include "fdacoefs.h" int mem[BL]; int memsq[128]; int square[128]; int offset=2; float offset_f=2.0; int n=0,p=0; /** The basic signal processing function has one input and one output. * The third parameter indicates the number of received samples. * The function must return the number of samples to send. */ int process(int *input, int *output, int nsamples) { int i,j; long x; j=0; for (i=0;i=0) { if (offset_f-(float) offset>0.5) offset++; } else { if (offset_f-(float) offset<-0.5) { offset--; } } n=((enable?offset:0)-fir_delay); if (n<0) { n=symbol_rate+n; } n%=symbol_rate; p=offset; if (p<0) { p=symbol_rate+p; } p%=symbol_rate; offset_f_vec[j]=offset_f; offset_vec[j]=n; j++; } } /** return the number of samples to send */ return j; } /** This function is called during the initialization process, after * the parameters (in stats.h) have been retrieved. */ int InitCustom() { int i; memset(mem, 0, sizeof(int) * BL); memset(memsq,0,sizeof(int)*128); for (i=0;i<128;i++) { square[i]=1; } return 1; } /** This function is called after the processing function, each time slot. * You can place here other code (e.g. state-update, etc.) */ int RunCustom() { return 1; } /** this function is called when input data is received. By default, * it changes data type to integer, calls the process function, change * the data type to the configured datatype and sends the data through * the first output interface. */ int process_input(int len) { int nsamples_in,nsamples_out; nsamples_in=typeNsamplesArray(datatype,len); type2int(input_data,input_i,nsamples_in,datatype); nsamples_out=process(input_i,output_i,nsamples_in); int2type(output_i,output_data,nsamples_out,datatype); SendItf(0,typeSizeArray(datatype,nsamples_out)); return 1; } void ConfigInterfaces() { }