From: drowe67 Date: Tue, 14 Feb 2017 01:39:09 +0000 (+0000) Subject: clean up help X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=bac40beb15f4002c64da98b2ab0afb29dc4ad378;p=freetel-svn-tracking.git clean up help git-svn-id: https://svn.code.sf.net/p/freetel/code@3033 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/unittest/tdec.c b/codec2-dev/unittest/tdec.c index 9addcfe9..bd1a7bf7 100644 --- a/codec2-dev/unittest/tdec.c +++ b/codec2-dev/unittest/tdec.c @@ -25,7 +25,7 @@ void display_help(void) { fprintf(stderr, "\nusage: tdec inputRawFile OutputRawFile DecimationRatio [-c]\n"); fprintf(stderr, "\nUse - for stdin/stdout\n\n"); fprintf(stderr, "-c complex signed 16 bit input and output\n"); - fprintf(stderr, "-d complex signed 8 bit input, complex signed 16 bit output\n\n"); + fprintf(stderr, "-d complex signed 8 bit input, complex signed 16 bit output\n"); fprintf(stderr, "-f -Fs/4 freq shift\n\n"); } diff --git a/codec2-dev/unittest/tlininterp.c b/codec2-dev/unittest/tlininterp.c index 8a34387b..be9ebd7b 100644 --- a/codec2-dev/unittest/tlininterp.c +++ b/codec2-dev/unittest/tlininterp.c @@ -26,8 +26,7 @@ void display_help(void) { fprintf(stderr, "\nusage: tlininterp inputRawFile OutputRawFile OverSampleRatio [-c]\n"); fprintf(stderr, "\nUse - for stdin/stdout\n\n"); fprintf(stderr, "-c complex signed 16 bit input and output\n"); - fprintf(stderr, "-d complex signed 16 bit input, complex signed 8 bit output\n\n"); - fprintf(stderr, "-d complex signed 16 bit input, complex signed 8 bit output\n\n"); + fprintf(stderr, "-d complex signed 16 bit input, complex signed 8 bit output\n"); fprintf(stderr, "-f +Fs/4 freq shift\n\n"); } @@ -56,7 +55,11 @@ int main(int argc, char *argv[]) { assert(fout != NULL); oversample = atof(argv[3]); - + if (oversample <= 1) { + display_help(); + exit(1); + } + int channels = 1; int freq_shift = 0; lo_i[0] = -1; lo_i[1] = 0; @@ -90,7 +93,7 @@ int main(int argc, char *argv[]) { /* update local osc recursion */ lo_i[2] = -lo_i[0]; lo_q[2] = -lo_q[0]; - + /* complex mixer to up-shift complex samples */ int a = out[2*j]; @@ -126,7 +129,7 @@ int main(int argc, char *argv[]) { t += 1.0/oversample; } - + t -= 1.0; for (i=0; i