clean up help
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 14 Feb 2017 01:39:09 +0000 (01:39 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 14 Feb 2017 01:39:09 +0000 (01:39 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@3033 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/unittest/tdec.c
codec2-dev/unittest/tlininterp.c

index 9addcfe977230637e700e8f9d02a6988d4754473..bd1a7bf7431c52d87401a3614c172615c2e7c3eb 100644 (file)
@@ -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");
 }
 
index 8a34387b444a054506343a02b8d01d0148bb328d..be9ebd7b9cc54db5302645c61958764f99966537 100644 (file)
@@ -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<channels; i++)
             left[i] = right[i];