189,7 → 189,7 |
unsigned int maxval = (1 << (snd_pcm_format_width(format) - 1)) - 1; |
|
static const float f0 = 1000; |
static const float fmax = 10000; |
static const float fmax = 7000; |
static const float Tw = 0.002; |
static float k; |
|
413,11 → 413,13 |
j+=2; |
} |
|
// linear_windowed_chirp(L_signal,1000000, 1000); |
|
printf("\nData transmitted... \ncorrelating...\n"); |
for(n=0; n < (SIGNAL_SAMPLES - chirp_size);n++){ |
l=0; |
r=0; |
for(m=CHIRP_OFFSET;m < 500;m++) |
for(m=CHIRP_OFFSET;m < chirp_size;m++) |
{ |
l += chirp[m]*L_signal[m+n]; // correlate with left channel |
r += chirp[m]*R_signal[m+n]; // correlate with right channel |
426,7 → 428,7 |
correlationr[n]=r; |
} |
|
/* printf("\nSearching echos...\n"); |
printf("\nSearching echos...\n"); |
r=0; |
l=0; |
for(n=0; n < (SIGNAL_SAMPLES - chirp_size);n++){ //najde nejvetsi korelace |
438,11 → 440,11 |
delay[2] = n; |
r = correlationr[n]; |
} |
}*/ |
} |
|
out=fopen("./output.txt","w"); |
j=0; |
for(i=0;i<=60000;i++){ |
for(i=0;i<=100000;i++){ |
fprintf(out,"%6d %6d %6d %6d %9ld %9ld\n",i,chirp[i],L_signal[i],R_signal[i],correlationl[i], correlationr[i]); |
j+=2; |
} |