part way through changes to make fdmdv_mod use less stack, tfdmdv works
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 13 Aug 2014 09:27:09 +0000 (09:27 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 13 Aug 2014 09:27:09 +0000 (09:27 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1796 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/octave/fdmdv.m
codec2-dev/octave/fdmdv_mod.m
codec2-dev/octave/fdmdv_ut.m
codec2-dev/octave/tfdmdv.m
codec2-dev/src/fdmdv.c

index bbe01cf7962ae024508e4b0a4aaf3fd44eec6118..0f650eec7f5b527486bc6ced4a78fa7ce766ec6e 100644 (file)
@@ -209,30 +209,12 @@ function tx_fdm = fdm_upconvert(tx_filt)
 
   % Nc/2 tones below zero
   
-  for c=1:Nc/2
-      for i=1:M
-        phase_tx(c) = phase_tx(c) * freq(c);
-       tx_fdm(i) = tx_fdm(i) + tx_filt(c,i)*phase_tx(c);
-      end
-  end
-  
-  % Nc/2 tones above zero
-
-  for c=Nc/2+1:Nc
+  for c=1:Nc+1
       for i=1:M
         phase_tx(c) = phase_tx(c) * freq(c);
        tx_fdm(i) = tx_fdm(i) + tx_filt(c,i)*phase_tx(c);
       end
   end
-
-  % add centre pilot tone 
-
-  c = Nc+1;
-  for i=1:M
-    phase_tx(c) = phase_tx(c) * freq(c);
-    pilot(i) = 2*tx_filt(c,i)*phase_tx(c);
-    tx_fdm(i) = tx_fdm(i) + pilot(i);  
-  end
  
   % shift up to carrier freq
 
index eed85a2bfa5ff1467cd377f194714756918f9571..8d132264a49b2d40d73541e7bb13f5d6bdeb202f 100644 (file)
@@ -15,7 +15,7 @@ function tx_fdm = fdmdv_mod(rawfilename, nbits)
   frames = floor(nbits/(Nc*Nb))
   tx_fdm = [];
   gain = 1000; % Scale up to 16 bit shorts
-  prev_tx_symbols = ones(Nc+1,1);
+  prev_tx_symbols = ones(Nc+1,1); prev_tx_symbols(Nc+1) = 2;
 
   for i=1:frames
     tx_bits = get_test_bits(Nc*Nb);
index 4bd8c0182a17c1a9e018712feafcf837849ba23f..0df37aed6a02b1c17581100efc42744b13502d3e 100644 (file)
@@ -12,7 +12,7 @@ fdmdv;               % load modem code
  
 % Simulation Parameters --------------------------------------
 
-frames = 200;
+frames = 100;
 EbNo_dB = 6.3;
 Foff_hz = -100;
 modulation = 'dqpsk';
@@ -30,7 +30,7 @@ noise_pwr = 0;
 rx_fdm_log = [];
 rx_baseband_log = [];
 rx_bits_offset = zeros(Nc*Nb*2);
-prev_tx_symbols = ones(Nc+1,1);
+prev_tx_symbols = ones(Nc+1,1); prev_tx_symbols(Nc+1) = 2;
 prev_rx_symbols = ones(Nc+1,1);
 ferr = 0;
 foff = 0;
index 1bdac80490a9c051b3790eb3f5a4276e43249b4b..ac7186a829155a396b877cb049abc2ec1a5d4bb8 100644 (file)
@@ -19,7 +19,7 @@ global passes;
 global fails;
 passes = fails = 0;
 frames = 35;
-prev_tx_symbols = ones(Nc+1,1);
+prev_tx_symbols = ones(Nc+1,1); prev_tx_symbols(Nc+1) = 2;
 prev_rx_symbols = ones(Nc+1,1);
 foff_phase_rect = 1;
 channel = [];
index 2841f74d27a6cbe05692fe05aafc62391588e4c2..c6ea6990c9464a4612fd6ff3648ddb1d8d8e56d4 100644 (file)
@@ -181,7 +181,8 @@ struct FDMDV * fdmdv_create(int Nc)
            f->rx_filter_mem_timing[c][k].imag = 0.0;
        }
     }
-    
+    f->prev_tx_symbols[Nc].real = 2.0;
+
     fdmdv_set_fsep(f, FSEP);
     f->freq[Nc].real = cosf(2.0*PI*0.0/FS);
     f->freq[Nc].imag = sinf(2.0*PI*0.0/FS);
@@ -468,7 +469,6 @@ void fdm_upconvert(COMP tx_fdm[], int Nc, COMP tx_baseband[NC+1][M], COMP phase_
 {
     int   i,c;
     COMP  two = {2.0, 0.0};
-    COMP  pilot;
     float mag;
 
     for(i=0; i<M; i++) {
@@ -476,31 +476,12 @@ void fdm_upconvert(COMP tx_fdm[], int Nc, COMP tx_baseband[NC+1][M], COMP phase_
        tx_fdm[i].imag = 0.0;
     }
 
-    /* Nc/2 tones below centre freq */
-  
-    for (c=0; c<Nc/2; c++) 
-       for (i=0; i<M; i++) {
-           phase_tx[c] = cmult(phase_tx[c], freq[c]);
-           tx_fdm[i] = cadd(tx_fdm[i], cmult(tx_baseband[c][i], phase_tx[c]));
-       }
-
-    /* Nc/2 tones above centre freq */
-
-    for (c=Nc/2; c<Nc; c++) 
+    for (c=0; c<=Nc; c++) 
        for (i=0; i<M; i++) {
            phase_tx[c] = cmult(phase_tx[c], freq[c]);
            tx_fdm[i] = cadd(tx_fdm[i], cmult(tx_baseband[c][i], phase_tx[c]));
        }
 
-    /* add centre pilot tone  */
-
-    c = Nc;
-    for (i=0; i<M; i++) {
-       phase_tx[c] = cmult(phase_tx[c],  freq[c]);
-       pilot = cmult(cmult(two, tx_baseband[c][i]), phase_tx[c]);
-       tx_fdm[i] = cadd(tx_fdm[i], pilot);
-    }
-
     /* shift whole thing up to carrier freq */
 
     for (i=0; i<M; i++) {