added scaling to samples if out of sync, thanks Alex
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 20 Dec 2014 00:04:47 +0000 (00:04 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 20 Dec 2014 00:04:47 +0000 (00:04 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1978 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/src/freedv_api.c

index 70258b2497dfad91026407d4cdb477c0c8af6355..921d2f0dc41a5bb6a1ec0e4ab5fbf15d1be7c220 100644 (file)
@@ -291,7 +291,8 @@ int freedv_rx(struct freedv *f, short speech_out[], short demod_in[]) {
 float rxdata[FDMDV_MAX_SAMPLES_PER_FRAME];
 int i;
 
-    for(i=0; i<f->nin; i++)  rxdata[i] = (float)demod_in[i]/FDMDV_SCALE;
+    for(i=0; i<f->nin; i++)
+        rxdata[i] = (float)demod_in[i]/FDMDV_SCALE;
 
     return freedv_floatrx(f, speech_out, rxdata);
     
@@ -404,7 +405,7 @@ int freedv_floatrx(struct freedv *f, short speech_out[], float demod_in[]) {
         /* if not in sync pass through analog samples */
         /* this lets us "hear" whats going on, e.g. during tuning */
         for(i=0; i<nin_prev; i++)
-            speech_out[i] = demod_in[i];
+            speech_out[i] = FDMDV_SCALE*demod_in[i];
         nout = nin_prev;
     }