linear interpolator resampling, seems to work, ber same as previous, more memory...
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 27 Jun 2014 07:07:35 +0000 (07:07 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 27 Jun 2014 07:07:35 +0000 (07:07 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1714 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/octave/fdmdv.m
codec2-dev/octave/fdmdv_ut.m

index d10f2898727514c999a70e989b4c5042709bc730..d63b73de8db4fb654c31ce761e8d390762954fbc 100644 (file)
@@ -433,6 +433,32 @@ function [rx_symbols rx_timing env] = rx_est_timing(rx_filt, rx_baseband, nin)
 
   x = env * exp(-j*2*pi*(0:m-1)/P)';
   
+linear_interp = 1;
+
+if linear_interp
+
+  rx_timing = angle(x)*P/(2*pi) + P/4;
+  if (rx_timing > P)
+     rx_timing -= P;
+  end
+  if (rx_timing < -P)
+     rx_timing += P;
+  end
+
+  % rx_filter_mem_timing contains Nt*P samples (Nt symbols at rate P),
+  % where Nt is odd.  Lets use linear interpolation to resample in the
+  % centre of the timing estimation window
+
+  rx_timing += floor(Nt/2)*P;
+  low_sample = floor(rx_timing);
+  fract = rx_timing - low_sample;
+  high_sample = ceil(rx_timing);
+  % printf("rx_timing: %f low_sample: %f high_sample: %f fract: %f\n", rx_timing, low_sample, high_sample, fract);
+
+  rx_symbols = rx_filter_mem_timing(:,low_sample)*(1-fract) + rx_filter_mem_timing(:,high_sample)*fract;
+
+else
+
   % map phase to estimated optimum timing instant at rate M
   % the M/4 part was adjusted by experiment, I know not why....
 
@@ -456,6 +482,7 @@ function [rx_symbols rx_timing env] = rx_est_timing(rx_filt, rx_baseband, nin)
 
   s = round(rx_timing) + M;
   rx_symbols = rx_baseband_mem_timing(:,s+1:s+Nfilter) * gt_alpha5_root';
+end
 
 endfunction
 
index ec8cab7b56008139ba89ac9e626353cc68c23722..30d1342246e5c8e3b113b88992fb1885fd160ec3 100644 (file)
@@ -13,13 +13,14 @@ fdmdv;               % load modem code
 % Simulation Parameters --------------------------------------
 
 frames = 100;
-EbNo_dB = 7.3;
+EbNo_dB = 51.3;
 Foff_hz = 0;
 modulation = 'dqpsk';
 hpa_clip = 150;
 
 % ------------------------------------------------------------
 
+more off;
 tx_filt = zeros(Nc,M);
 rx_symbols_log = [];
 rx_phase_log = 0;