moved memory updates inside 8 to 48 kHz sample rate functions to make calling code...
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 29 Oct 2012 02:34:12 +0000 (02:34 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 29 Oct 2012 02:34:12 +0000 (02:34 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@882 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/src/fdmdv.c
codec2-dev/unittest/t48_8.c

index 1ded60f1481c7c040350de012ca37bb0717a0c81..26c2a7f7cd7cf2c694bd3c292b17578731f56c2e 100644 (file)
@@ -1093,7 +1093,7 @@ void CODEC2_WIN32SUPPORT fdmdv_put_test_bits(struct FDMDV *f, int *sync,
   makes mistakes when used continuously.  So we use it until we have
   acquired the BPSK pilot, then switch to a more robust "fine"
   tracking algorithm.  If we lose sync we switch back to coarse mode
-  for fast-requisition of large frequency offsets.
+  for fast re-acquisition of large frequency offsets.
 
 \*---------------------------------------------------------------------------*/
 
@@ -1337,6 +1337,12 @@ void CODEC2_WIN32SUPPORT fdmdv_8_to_48(float out48k[], float in8k[], int n)
            
        }
     }  
+
+    /* update filter memory */
+
+    for(i=-(FDMDV_OS_TAPS/FDMDV_OS); i<0; i++)
+       in8k[i] = in8k[i + n];
+
 }
 
 /*---------------------------------------------------------------------------*\
@@ -1365,6 +1371,11 @@ void CODEC2_WIN32SUPPORT fdmdv_48_to_8(float out8k[], float in48k[], int n)
        for(j=0; j<FDMDV_OS_TAPS; j++)
            out8k[i] += fdmdv_os_filter[j]*in48k[i*FDMDV_OS-j];
     }
+
+    /* update filter memory */
+
+    for(i=-FDMDV_OS_TAPS; i<0; i++)
+       in48k[i] = in48k[i + n*FDMDV_OS];
 }
 
 /*---------------------------------------------------------------------------*\
index 3ff72777feac27823293accbb0ff00f918fde650..04c79b564da6df6374357325ba5ada7f8a98271a 100644 (file)
@@ -69,11 +69,13 @@ int main() {
            in8k[MEM8+i] = 16000.0*cos(TWO_PI*t*freq/FS);
 #endif
 
-       /* upsample and update filter memory */
+       /* upsample  */
 
        fdmdv_8_to_48(out48k, &in8k[MEM8], N8);
+       /*
        for(i=0; i<MEM8; i++)
            in8k[i] = in8k[i+N8];
+       */
 
        /* save 48k to disk for plotting and check out */
 
@@ -87,11 +89,13 @@ int main() {
        for(i=0; i<N48; i++,t1++)
            in48k[i+FDMDV_OS_TAPS] = out48k[i] + 16000.0*cos(TWO_PI*t1*1E4/FS);
 
-       /* downsample and update filter memory */
+       /* downsample */
 
        fdmdv_48_to_8(out8k, &in48k[FDMDV_OS_TAPS], N8);
+       /*
        for(i=0; i<FDMDV_OS_TAPS; i++)
            in48k[i] = in48k[i+N48];
+       */
 
        /* save 8k to disk for plotting and check out */