From: drowe67 Date: Thu, 10 May 2012 03:33:53 +0000 (+0000) Subject: 48 to 8k unit test checks out OK X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=5af1c5fd499aa0b4e367b43cdc8c955ea88bd71b;p=freetel-svn-tracking.git 48 to 8k unit test checks out OK git-svn-id: https://svn.code.sf.net/p/freetel/code@408 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/README_fdmdv.txt b/codec2-dev/README_fdmdv.txt index 301d6ad2..8f121d5a 100644 --- a/codec2-dev/README_fdmdv.txt +++ b/codec2-dev/README_fdmdv.txt @@ -166,6 +166,8 @@ TODO ---- [ ] 48 kHz to and from 8 kHz routines to drive 48 kHz sound card audio +[ ] implement SNR and ppm measurements in fdmdv_get_demod_stats() +[ ] implement fdmdv_get_waterfall_line() [ ] try interfering sine wave + maybe swept + does modem fall over? @@ -182,5 +184,4 @@ TODO + e.g. hang on thru the fades? [ ] PAPR idea + automatically tweak phases to reduce PAPR, e.g. slow variations in freq... -[ ] implement SNR and ppm measurements diff --git a/codec2-dev/src/fdmdv.c b/codec2-dev/src/fdmdv.c index c17ab483..2f7ab3c8 100644 --- a/codec2-dev/src/fdmdv.c +++ b/codec2-dev/src/fdmdv.c @@ -1204,6 +1204,7 @@ void fdmdv_8_to_48(float out48k[], float in8k[], int n) out48k[i*FDMDV_OS+j] = 0.0; for(k=0,l=0; k +#include +#include +#include "fdmdv.h" + +#define N8 160 /* procssing buffer size at 8 kHz */ +#define N48 (N8*FDMDV_OS) +#define MEM8 (FDMDV_OS_TAPS/FDMDV_OS) +#define FRAMES 50 +#define TWO_PI 6.283185307 +#define FS 8000 + +#define SINE + +int main() { + float in8k[MEM8 + N8]; + float out48k[N48]; + short out48k_short[N48]; + FILE *f48; + + float in48k[FDMDV_OS_TAPS + N48]; + float out8k[N48]; + short out8k_short[N8]; + FILE *f8; + + int i,f,t; + float freq = 505.0; + + f48 = fopen("out48.raw", "wb"); + assert(f48 != NULL); + f8 = fopen("out8.raw", "wb"); + assert(f8 != NULL); + + /* clear filter memories */ + + for(i=0; i