+
+ // Compute the standard deviation (to check for uneven speeds).
+ double sum2 = 0.0;
+ for (int i = SYNC_PULSE_START; i < SYNC_PULSE_END; ++i) {
+ double cycles = pulses[i].len * calibration_factor * C64_FREQUENCY;
+ sum2 += (cycles - SYNC_PULSE_LENGTH) * (cycles - SYNC_PULSE_LENGTH);
+ }
+ double stddev = sqrt(sum2 / (SYNC_PULSE_END - SYNC_PULSE_START - 1));
+ fprintf(stderr, "Sync pulse length standard deviation: %.2f cycles\n",
+ stddev);