#include #include "annalyser.h" int generate_tone(float *samples, float freq, int len) { int i; for (i=0; i=0)?x[i]:-x[i]; if (y>max) { max=y; } } return max; } void complex_base_band(float *x, int length, float freq, float phase, float *yi, float *yq) { int i; for (i=0; i=0) ph=PI/2.0; else ph=-PI/2.0; } else if (dc_q==0) { if (dc_i>=0) ph=0.0; else ph=-PI; } else { ph=atanf(dc_q/dc_i); if (dc_i<0) { if (dc_q<0) ph-=PI; else ph+=PI; } } return(ph); } #ifdef IMPULSE void canal_impuls(int *delta, int *impulse) { int i; int mostra, result; for (i=0; i=IMPULSE_POSITION)&&(i<=IMPULSE_POSITION+LENGTH_IMPULSE)) mostra=32000; else mostra=0; delta[i]=mostra; result=codec_io(mostra); impulse[i]=result; } } #endif