Subversion Repositories svnkaklik

Rev

Rev 564 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 564 Rev 565
Line 173... Line 173...
173
unsigned int linear_windowed_chirp(short *pole)
173
unsigned int linear_windowed_chirp(short *pole)
174
{
174
{
175
    unsigned int maxval = (1 << (snd_pcm_format_width(format) - 1)) - 1;
175
    unsigned int maxval = (1 << (snd_pcm_format_width(format) - 1)) - 1;
176
 
176
 
177
    static const float f0 = 5000;		//starting frequency
177
    static const float f0 = 5000;		//starting frequency
178
    static const float fmax = 7500;		//ending frequency
178
    static const float fmax = 10000;		//ending frequency
179
    static const float Tw = 0.0015;
179
    static const float Tw = 0.0015;
180
    static float k;
180
    static float k;
181
 
181
 
182
    unsigned int n=0;
182
    unsigned int n=0;
183
    double t;
183
    double t;
Line 381... Line 381...
381
 
381
 
382
    printf("Writing output files\n");
382
    printf("Writing output files\n");
383
    out=fopen("/tmp/sonar.txt","w");
383
    out=fopen("/tmp/sonar.txt","w");
384
    for (i=0; i <= (period_size - 1); i++)
384
    for (i=0; i <= (period_size - 1); i++)
385
    {
385
    {
386
        fprintf(out,"%6d %6d %6d %9ld %9ld\n",i,L_signal[i],R_signal[i],correlationl[i], correlationr[i]);
386
        fprintf(out,"%2.3f %6d %6d %9ld %9ld\n",SOUND_SPEED * (float) i / rate,L_signal[i],R_signal[i],correlationl[i], correlationr[i]);
387
    }
387
    }
388
    fclose(out);
388
    fclose(out);
389
 
389
 
390
    out=fopen("/tmp/chirp.txt","w");
390
    out=fopen("/tmp/chirp.txt","w");
391
    for (i=0; i <= (chirp_size - 1); i++)
391
    for (i=0; i <= (chirp_size - 1); i++)