Added parameter -d to set buffer size proportional to sample rate
authorHarvie <tomas@mudrunka.cz>
Wed, 1 Aug 2012 03:23:04 +0000 (05:23 +0200)
committerHarvie <tomas@mudrunka.cz>
Wed, 1 Aug 2012 03:23:04 +0000 (05:23 +0200)
c/goertzel/goertzel.c

index a26975023f6858367a813670f89d4f2bfc865388..3dd5885abaab28df219d368f244a6ffcfe01bc4c 100644 (file)
@@ -82,7 +82,7 @@ int main(int argc, char ** argv) {
        int freqs[argc+1]; freqs[0]=-1;
 
        int opt;
-       while ((opt = getopt(argc, argv, "?r:s:f:t:iqna")) != -1) {
+       while ((opt = getopt(argc, argv, "?d:r:s:f:t:iqna")) != -1) {
                switch (opt) {
                        case 'r':
                                samplerate = atoi(optarg);
@@ -90,6 +90,9 @@ int main(int argc, char ** argv) {
                        case 's':
                                samplecount = atoi(optarg);
                                break;
+                       case 'd':
+                               samplecount = samplerate/atoi(optarg);
+                               break;
                        case 'f':
                                addfreq(freqs, atoi(optarg));
                                break;
This page took 0.129764 seconds and 4 git commands to generate.