354,7 → 354,7 |
j+=2; |
} |
|
printf("\nData transmitted \ncorrelating\n"); |
printf("\nChirp transmitted \ncorrelating\n"); |
for (n=0; n < (period_size - chirp_size - 1); n++) |
{ |
l=0; |
376,10 → 376,13 |
for(j=0;j < period_size; j++) |
{ |
b=k*j; |
echo_map[m]=(-a*a+b*b+Xl*Xl+Xr*Xr)/(2*Xl-2*Xr); |
echo_map[m+1]=sqrt((a-b-Xl-Xr)*(a+b+Xl+Xr)*(a-b-Xl+Xr)*(a-b-Xl+Xr)*(a+b-Xl+Xr))/(-2*(Xl-Xr)); |
echo_map[m+2]=correlationl[i]*correlationr[j]; |
m+=3; |
if( (b+a) >= (Xr-Xl)) |
{ |
echo_map[m]=a; ///(-a*a+b*b+Xl*Xl+Xr*Xr)/(2*Xl-2*Xr); |
echo_map[m+1]=sqrt((a-b-Xl-Xr)*(a+b+Xl+Xr)*(a-b-Xl+Xr)*(a-b-Xl+Xr)*(a+b-Xl+Xr))/(-2*(Xl-Xr)*(Xl-Xr)); |
echo_map[m+2]=correlationl[i]+correlationr[j]; |
m+=3; |
} |
} |
} |
printf("Searching echos\n"); |
419,10 → 422,10 |
fclose(out); |
|
j=0; |
out=fopen("/tmp/plane_cut.txt","w"); // writes plane cut - e.g. density map to file |
out=fopen("/tmp/plane_cut.txt","w"); // writes echo_map - e.g. density map to file |
for (i=0;i < period_size*period_size/100; i++) |
{ |
fprintf(out,"%3.3f %3.3f %3.3f\n", echo_map[j], echo_map[j+1], echo_map[j+2]); |
fprintf(out,"% 4.3f %4.3f %6.3f\n", echo_map[j], echo_map[j+1], echo_map[j+2]); |
j+=3; |
} |
fclose(out); |