aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-16 00:20:13 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-16 00:20:13 +0100
commit6be0a4f305307a25109dd32d741fca6b5af925e5 (patch)
tree057ae128c8a94f604e8a1291e36a5fd965fc8472 /src
parentdraft (diff)
downloadfodtmf-6be0a4f305307a25109dd32d741fca6b5af925e5.tar.gz
fodtmf-6be0a4f305307a25109dd32d741fca6b5af925e5.tar.bz2
fodtmf-6be0a4f305307a25109dd32d741fca6b5af925e5.tar.xz
add redundancy freq
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to 'src')
-rw-r--r--src/send.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/send.c b/src/send.c
index d457bbb..27dec1d 100644
--- a/src/send.c
+++ b/src/send.c
@@ -49,7 +49,7 @@ void get_freq(int nibble, int* low, int* high)
int send_tones(int low, int high)
{
#define GENERATE_TONE(tone) \
- sin(2 * M_PI * ((double)i / (SAMPLE_RATE / tone)))
+ sin(2 * M_PI * ((double)i / (SAMPLE_RATE / (tone))))
static UTYPE buffer[SAMPLE_RATE / 1000 * DURATION];
snd_pcm_sframes_t frames;
@@ -57,7 +57,9 @@ int send_tones(int low, int high)
size_t i;
for (i = 0; i < N(buffer); i++)
- buffer[i] = (GENERATE_TONE(low) + GENERATE_TONE(high)) * (SMAX / 2) - SMIN;
+ buffer[i] = (GENERATE_TONE(low * 1) + GENERATE_TONE(high * 1) +
+ GENERATE_TONE(low * 4) + GENERATE_TONE(high * 4)) *
+ (SMAX / 4) - SMIN;
r = frames = snd_pcm_writei(sound_handle, buffer, N(buffer));
if (frames < 0)