From 021632411d14c4f87e16560ed56a5681da55170b Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 19 Jun 2018 21:32:19 +0200 Subject: Fix tone test generation --- src/tone-test-sim/src/test.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/tone-test-sim') diff --git a/src/tone-test-sim/src/test.c b/src/tone-test-sim/src/test.c index 3ba00c4..3bff6d7 100644 --- a/src/tone-test-sim/src/test.c +++ b/src/tone-test-sim/src/test.c @@ -41,15 +41,15 @@ int main(int argc, char **argv) return 1; } - const int freq_start = 1750 - 350; - const int freq_stop = 1750 + 350; + const int freq_start = 1750 - 175; + const int freq_stop = 1750 + 175; - for (int freq = freq_start; freq < freq_stop; freq += 20) { - for (int threshold = 200; threshold < 8000; threshold += 240) { + for (int freq = freq_start; freq < freq_stop; freq += 4) { + for (int threshold = 100000; threshold < 4000000; threshold += 100000) { tone_init(threshold); for (size_t j = 0; j < 200; j++) { - float samplef = cosf(2.0f * FLOAT_PI * freq / AUDIO_IN_RATE); + float samplef = cosf(j * 2.0f * FLOAT_PI * freq / AUDIO_IN_RATE); int16_t sample = samplef * 32767.0f; int r = tone_detect_1750(sample); if (r != -1) { -- cgit v1.2.3