From: drowe67 Date: Fri, 27 Jun 2014 07:07:35 +0000 (+0000) Subject: linear interpolator resampling, seems to work, ber same as previous, more memory... X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=97f9fb6675c6dfb33f2c9b4d5b314b4093c661f1;p=freetel-svn-tracking.git linear interpolator resampling, seems to work, ber same as previous, more memory hungry rate M interpolator git-svn-id: https://svn.code.sf.net/p/freetel/code@1714 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/octave/fdmdv.m b/codec2-dev/octave/fdmdv.m index d10f2898..d63b73de 100644 --- a/codec2-dev/octave/fdmdv.m +++ b/codec2-dev/octave/fdmdv.m @@ -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 diff --git a/codec2-dev/octave/fdmdv_ut.m b/codec2-dev/octave/fdmdv_ut.m index ec8cab7b..30d13422 100644 --- a/codec2-dev/octave/fdmdv_ut.m +++ b/codec2-dev/octave/fdmdv_ut.m @@ -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;