tofdm passing again, after sourceforge issues
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 12 Apr 2018 06:51:24 +0000 (06:51 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 12 Apr 2018 06:51:24 +0000 (06:51 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@3467 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/octave/tofdm.m
codec2-dev/unittest/tofdm.c

index 0e02baf09cf9c9ed18db8f9d6cd0ffedbd3ae5da..85e4d44cd044f1763e0dc62b58865b5175ed4861 100644 (file)
@@ -17,13 +17,14 @@ autotest;
 % Run Octave version 
 % ---------------------------------------------------------------------
 
-Ts = 0.018; Tcp = 0.002; Rs = 1/Ts; bps = 2; Nc = 16; Ns = 8;
+Ts = 0.018; Tcp = 0.002; Rs = 1/Ts; bps = 2; Nc = 17; Ns = 8;
 states = ofdm_init(bps, Rs, Tcp, Ns, Nc);
 states.verbose = 0;
 ofdm_load_const;
 
 rand('seed',1);
 tx_bits = round(rand(1,Nbitsperframe));
+tx_bits(1:states.uw_len) = 0;
 
 % Run tx loop
 
@@ -63,6 +64,7 @@ if states.timing_en == 0
   states.sample_point = Ncp;
 end
 
+
 for f=1:Nframes
 
   % insert samples at end of buffer, set to zero if no samples
@@ -79,7 +81,7 @@ for f=1:Nframes
   prx += lnew;
 
   [rx_bits states aphase_est_pilot_log arx_np arx_amp] = ofdm_demod(states, rxbuf_in);
-
+  
   % log some states for comparison to C
 
   rxbuf_in_log = [rxbuf_in_log rxbuf_in];
@@ -152,14 +154,15 @@ stem_sig_and_error(fg++, 111, rx_bits_log_c, rx_bits_log - rx_bits_log_c, 'rx bi
 
 % Run through checklist -----------------------------
 
-check_no_abs(W, W_c, 'W');
+check(W, W_c, 'W');
+check(states.rate_fs_pilot_samples, pilot_samples_c, 'pilot_samples');
 check(tx_bits_log, tx_bits_log_c, 'tx_bits');
 check(tx_log, tx_log_c, 'tx');
 check(rx_log, rx_log_c, 'rx');
 check(rxbuf_in_log, rxbuf_in_log_c, 'rxbuf in');
 check(rxbuf_log, rxbuf_log_c, 'rxbuf');
-check(rx_sym_log, rx_sym_log_c, 'rx_sym', tol=5E-3);
-check(phase_est_pilot_log, phase_est_pilot_log_c, 'phase_est_pilot', tol=2E-3, its_an_angle=1);
+check(rx_sym_log, rx_sym_log_c, 'rx_sym', tol=10E-3);
+check(phase_est_pilot_log, phase_est_pilot_log_c, 'phase_est_pilot', tol=1E-2, its_an_angle=1);
 check(rx_amp_log, rx_amp_log_c, 'rx_amp');
 check(timing_est_log, timing_est_log_c, 'timing_est');
 check(timing_valid_log, timing_valid_log_c, 'timing_valid');
index def862f454acfe8bcd76cf346fa2e3e1f862fa91..18f440f45c093628bb7ffec9c8dc8ccb22660a56 100644 (file)
@@ -41,7 +41,7 @@
 #include "test_bits_ofdm.h"
 #include "comp_prim.h"
 
-#define NFRAMES 3
+#define NFRAMES 30
 #define SAMPLE_CLOCK_OFFSET_PPM 100
 #define FOFF_HZ 0.5f