/** ALOE headers */ #include #include #include #include "typetools.h" #include "itf_types.h" #include "inputs.h" #include "outputs.h" #include "stats.h" #include "annalyser.h" float xi[MAX_FOURIER_SAMPLES],xq[MAX_FOURIER_SAMPLES]; int freq_idx=0; int delay_cnt; int transmitter; int do_send() { if (transmitter) { return freqi_samples; } else { return 0; } } float getFreqIdx(int idx) { return (max_freq-min_freq)/fourier_samples*(float)(idx+1)/(float)(sampling_freq); } int generate_output(int len) { generate_tone(output_data,getFreqIdx(freq_idx),len); return 1; } int process_input(int len) { float freq,dc_i,dc_q; freq = getFreqIdx(freq_idx); /* base band and dc-filter the received samples, removing transitory */ complex_base_band(&input_data[transitory],fourier_samples,freq,0,xi,xq); dc_i=dc_level(xi,fourier_samples); dc_q=dc_level(xq,fourier_samples); /*Compute gain */ gain[freq_idx]=get_gain(dc_i,dc_q); /*Compute phase */ phase[freq_idx]=get_phase(dc_i,dc_q); return 1; } /** Run function. * @return 1 if ok, 0 if error */ int RunCustom() { if (!transmitter) { if (delay_cntMAX_FOURIER_SAMPLES) { Log("Error with parameter fourier_samples. (%d>%d)\n",fourier_samples,MAX_FOURIER_SAMPLES); return 0; } delay_cnt=0; freq_idx=0; return 1; } void ConfigInterfaces(){}