aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-16 19:19:24 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-16 19:19:24 +0100
commit7ec996a38135119b99324d72c3e4939f07d04c1c (patch)
tree6fa003908ea91215a5fe2a9cf2a949dd0b129537 /src
parentruntime configurable partity settings + you have to opt in for redundancy freq:s, the sound if harsher with it (diff)
downloadfodtmf-7ec996a38135119b99324d72c3e4939f07d04c1c.tar.gz
fodtmf-7ec996a38135119b99324d72c3e4939f07d04c1c.tar.bz2
fodtmf-7ec996a38135119b99324d72c3e4939f07d04c1c.tar.xz
you can select redundant freq multiple
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r--src/send.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/send.c b/src/send.c
index 02672bb..02a2ca1 100644
--- a/src/send.c
+++ b/src/send.c
@@ -80,6 +80,11 @@ static int use_extra_parity = 0;
static int use_redundant_freq = 0;
/**
+ * Frequencies multiple for the redundant frequencies.
+ */
+static double redundant_freq_mul = 0;
+
+/**
* Data buffer used for error correcting code support.
*/
static int* data;
@@ -148,12 +153,14 @@ static void init_buffers(void)
if (use_redundant_freq)
for (i = 0; i < N; i++)
- buffer[i] = (GENERATE_TONE(low * 1) + GENERATE_TONE(high * 1) +
- GENERATE_TONE(low * 4) + GENERATE_TONE(high * 4)) *
+ buffer[i] = (GENERATE_TONE(low) +
+ GENERATE_TONE(high) +
+ GENERATE_TONE(low * redundant_freq_mul) +
+ GENERATE_TONE(high * redundant_freq_mul)) *
(SMAX / 4) - SMIN;
else
for (i = 0; i < N; i++)
- buffer[i] = (GENERATE_TONE(low * 1) + GENERATE_TONE(high * 1)) *
+ buffer[i] = (GENERATE_TONE(low) + GENERATE_TONE(high)) *
(SMAX / 2) - SMIN;
}
}
@@ -390,10 +397,10 @@ int main(int argc, char* argv[])
argv0 = argc ? argv[0] : "";
for (;;)
{
- r = getopt (argc, argv, "fpr:");
+ r = getopt (argc, argv, "f:pr:");
if (r == -1)
break;
- else if (r == 'f') use_redundant_freq = 1;
+ else if (r == 'f') use_redundant_freq = 1, redundant_freq_mul = atof(optarg);
else if (r == 'p') use_extra_parity = 1;
else if (r == 'r') parity = atoi(optarg);
else if (r != '?')