aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-06-19 21:32:19 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-06-19 21:32:19 +0200
commit021632411d14c4f87e16560ed56a5681da55170b (patch)
tree2030648a35737096b0382a0f5b6e102d6f1b1da8 /src
parentd8df88e8b299fe697ff695f61cd1e85032530a84 (diff)
downloadglutte-o-matic-021632411d14c4f87e16560ed56a5681da55170b.tar.gz
glutte-o-matic-021632411d14c4f87e16560ed56a5681da55170b.tar.bz2
glutte-o-matic-021632411d14c4f87e16560ed56a5681da55170b.zip
Fix tone test generation
Diffstat (limited to 'src')
-rw-r--r--src/tone-test-sim/src/test.c10
1 files changed, 5 insertions, 5 deletions
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) {