Subversion Repositories svnkaklik

Rev

Rev 650 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 650 Rev 651
Line 352... Line 352...
352
        L_signal[i]=signal[j];
352
        L_signal[i]=signal[j];
353
        R_signal[i]=signal[j+1];
353
        R_signal[i]=signal[j+1];
354
        j+=2;
354
        j+=2;
355
    }
355
    }
356
 
356
 
357
    printf("\nData transmitted \ncorrelating\n");
357
    printf("\nChirp transmitted \ncorrelating\n");
358
    for (n=0; n < (period_size - chirp_size - 1); n++)
358
    for (n=0; n < (period_size - chirp_size - 1); n++)
359
    {
359
    {
360
        l=0;
360
        l=0;
361
        r=0;
361
        r=0;
362
        for ( m = 0; m < chirp_size;m++)
362
        for ( m = 0; m < chirp_size;m++)
Line 374... Line 374...
374
	{
374
	{
375
		a=k*i;
375
		a=k*i;
376
		for(j=0;j < period_size; j++)
376
		for(j=0;j < period_size; j++)
377
		{
377
		{
378
			b=k*j;
378
			b=k*j;
-
 
379
			if( (b+a) >= (Xr-Xl))
-
 
380
			{
379
			echo_map[m]=(-a*a+b*b+Xl*Xl+Xr*Xr)/(2*Xl-2*Xr);
381
				echo_map[m]=a;  ///(-a*a+b*b+Xl*Xl+Xr*Xr)/(2*Xl-2*Xr);
380
			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));
382
				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));
381
			echo_map[m+2]=correlationl[i]*correlationr[j];
383
				echo_map[m+2]=correlationl[i]+correlationr[j];
382
			m+=3;
384
				m+=3;
-
 
385
			}
383
		}
386
		}
384
	}
387
	}
385
    printf("Searching echos\n");
388
    printf("Searching echos\n");
386
    r=0;
389
    r=0;
387
    l=0;
390
    l=0;
Line 417... Line 420...
417
        fprintf(out,"%2.3f %6d %6d %9ld %9ld\n", (float)i*k, L_signal[i], R_signal[i], correlationl[i], correlationr[i]);
420
        fprintf(out,"%2.3f %6d %6d %9ld %9ld\n", (float)i*k, L_signal[i], R_signal[i], correlationl[i], correlationr[i]);
418
    }
421
    }
419
    fclose(out);
422
    fclose(out);
420
 
423
 
421
    j=0;
424
    j=0;
422
    out=fopen("/tmp/plane_cut.txt","w"); // writes plane cut - e.g. density map to file
425
    out=fopen("/tmp/plane_cut.txt","w"); // writes echo_map - e.g. density map to file
423
    for (i=0;i < period_size*period_size/100; i++)
426
    for (i=0;i < period_size*period_size/100; i++)
424
    {
427
    {
425
	fprintf(out,"%3.3f %3.3f %3.3f\n", echo_map[j], echo_map[j+1], echo_map[j+2]);
428
	fprintf(out,"% 4.3f %4.3f %6.3f\n", echo_map[j], echo_map[j+1], echo_map[j+2]);
426
	j+=3;
429
	j+=3;
427
    }
430
    }
428
    fclose(out);
431
    fclose(out);
429
 
432
 
430
    out=fopen("/tmp/chirp.txt","w");
433
    out=fopen("/tmp/chirp.txt","w");