Subversion Repositories svnkaklik

Rev

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

Rev 261 Rev 262
Line 302... Line 302...
302
   if( !spectrum_file[0]) return;     // Spectrum file not wanted.
302
   if( !spectrum_file[0]) return;     // Spectrum file not wanted.
303
 
303
 
304
   if( (f=fopen( spectrum_file, "w+")) == NULL)
304
   if( (f=fopen( spectrum_file, "w+")) == NULL)
305
      bailout( "cannot open spectrum file %s, %s", strerror( errno));
305
      bailout( "cannot open spectrum file %s, %s", strerror( errno));
306
 
306
 
307
   if( mode == 1)
307
   if( mode == 1){
-
 
308
      fprintf( f, "Frequency PowerL \n");
308
      for( i=0; i<BINS; i++) fprintf( f, "%.5e %.5e\n", 
309
      for( i=0; i<BINS; i++) fprintf( f, "%.5e %.5e\n", 
309
             (i+0.5) * DF, left.signal_avg[i]/spec_max);
310
             (i+0.5) * DF, left.signal_avg[i]/spec_max);}
310
   else
311
   else{
-
 
312
      fprintf( f, "Frequncy PowerL PowerR \n");
311
      for( i=0; i<BINS; i++) fprintf( f, "%.5e %.5e %.5e\n", 
313
      for( i=0; i<BINS; i++) fprintf( f, "%.5e %.5e %.5e\n", 
312
             (i+0.5) * DF, left.signal_avg[i]/spec_max,
314
             (i+0.5) * DF, left.signal_avg[i]/spec_max,
313
                          right.signal_avg[i]/spec_max);
315
                          right.signal_avg[i]/spec_max);}
314
   fclose( f);
316
   fclose( f);
315
 
317
 
316
   for( i=0; i<BINS; i++) left.signal_avg[i] = 0;
318
   for( i=0; i<BINS; i++) left.signal_avg[i] = 0;
317
   if( mode == 2) for( i=0; i<BINS; i++) right.signal_avg[i] = 0;
319
   if( mode == 2) for( i=0; i<BINS; i++) right.signal_avg[i] = 0;
318
}
320
}