comparison FXAnalyse.c @ 267:1de805d2d37a

Reuse beatnote enum also for dedrift reference selection
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Thu, 09 Jul 2015 23:08:22 +0200
parents dfbee05fe464
children ec4462c7f8b7
comparison
equal deleted inserted replaced
266:dfbee05fe464 267:1de805d2d37a
344 struct stat stat_math1, stat_ch2, stat_ch3; 344 struct stat stat_math1, stat_ch2, stat_ch3;
345 struct rollmean rollmean_ch1, rollmean_ch2, rollmean_ch3, rollmean_ch4; 345 struct rollmean rollmean_ch1, rollmean_ch2, rollmean_ch3, rollmean_ch4;
346 346
347 347
348 // dedrift 348 // dedrift
349 enum {
350 DEDRIFT_REFERENCE_MICROWAVE = 0,
351 DEDRIFT_REFERENCE_HG = 1,
352 };
353
354 struct dedrift { 349 struct dedrift {
355 int enabled; // dedrift enabled 350 int enabled; // dedrift enabled
356 int proportional; // enable proportional correction 351 int proportional; // enable proportional correction
357 int reference; // reference frequency 352 int reference; // reference frequency
358 int sign; // sign of the correction 353 int sign; // sign of the correction
372 }; 367 };
373 368
374 struct dedrift dedrift = { 369 struct dedrift dedrift = {
375 .enabled = FALSE, 370 .enabled = FALSE,
376 .proportional = FALSE, 371 .proportional = FALSE,
377 .reference = DEDRIFT_REFERENCE_MICROWAVE, 372 .reference = MICROWAVE,
378 .sign = +1, 373 .sign = +1,
379 .x2 = FALSE, 374 .x2 = FALSE,
380 .keep_freq = TRUE, 375 .keep_freq = TRUE,
381 .keep_slope = TRUE, 376 .keep_slope = TRUE,
382 .f0 = 0.0, 377 .f0 = 0.0,
1536 } 1531 }
1537 1532
1538 // select dedrift reference 1533 // select dedrift reference
1539 double f = 0.0; 1534 double f = 0.0;
1540 switch (dedrift.reference) { 1535 switch (dedrift.reference) {
1541 case DEDRIFT_REFERENCE_MICROWAVE: 1536 case MICROWAVE:
1542 f = Math2; 1537 f = Math2;
1543 break; 1538 break;
1544 case DEDRIFT_REFERENCE_HG: 1539 case HG:
1545 f = Ch2 * 1062.5 / 1542.2; 1540 f = Ch2 * 1062.5 / 1542.2;
1546 break; 1541 break;
1547 } 1542 }
1548 1543
1549 // dedrift 1544 // dedrift