/** ALOE headers */ #include #include #include #include "rcos.h" #include "inputs.h" #include "outputs.h" #include "stats.h" #define MAX_TAPS 128 #define FIRST_PEAK int barker13_rev[13]={1,-1,1,-1,1,1,-1,-1,1,1,1,1,1}; float filter[MAX_TAPS]; int filter_i[MAX_TAPS]; int mem[MAX_SEQ_LEN]; int seq_len; int input_i[INPUT_MAX_DATA]; int long_in_block=0; int long_out_block=0; int max_; int process_input(int len) { int i; int corr,corr_; int max,maxpos; int started; long_in_block=typeNsamplesArray(datatype,len); type2int(input_data,input_i,long_in_block,datatype); /* copy previous buffer */ if (long_out_blockstart_len || !start_len) { corr_=convii(sequence,mem,seq_len,(input_i[i]>0)?1:-1); corr=abs(corr_); if (imax && corr>det_threshold) { max=corr; max_=corr_; maxpos=i; } if (maxpos>-1 && corrmax) { max=corr; max_=corr_; maxpos=i; start_sample=maxpos-offset; } #endif } } if (start_sample<0) start_sample=0; long_out_block=frame_size; if (long_out_block+start_sample>long_in_block) { long_out_block = long_in_block-start_sample; } if (max_<0) { for (i=start_sample;i