From 6be0a4f305307a25109dd32d741fca6b5af925e5 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 16 Dec 2015 00:20:13 +0100 Subject: add redundancy freq MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/send.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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) -- cgit v1.2.3-70-g09d2