if verbose > 2
printf("% 4.3f ", phi_(r,c))
end
- % rx_symb(r,c) *= exp(-j*phi_(r,c));
+ rx_symb(r,c) *= exp(-j*phi_(r,c));
end
if verbose > 2
cohpsk;
autotest;
-n = 160;
-frames = 35;
+n = 2000;
+rames = 35;
framesize = 160;
+foff = 1;
load ../build_linux/unittest/tcohpsk_out.txt
sim_in = symbol_rate_init(sim_in);
rand('state',1);
-tx_bits = round(rand(1,framesize));
+tx_bits_coh = round(rand(1,framesize*10));
+ptx_bits_coh = 1;
+
tx_bits_log = [];
tx_symb_log = [];
rx_amp_log = [];
rx_phi_log = [];
rx_symb_log = [];
rx_bits_log = [];
+
+phase = 1;
+freq = exp(j*2*pi*foff/sim_in.Rs);
+
+ch_symb = zeros(sim_in.Nsymbrowpilot, sim_in.Nc);
+
for i=1:frames
- tx_bits_log = [tx_bits_log tx_bits];
+ tx_bits = tx_bits_coh(ptx_bits_coh:ptx_bits_coh+framesize-1);
+ ptx_bits_coh += framesize;
+ if ptx_bits_coh > length(tx_bits_coh)
+ ptx_bits_coh = 1;
+ end
+
+ tx_bits_log = [tx_bits_log tx_bits];
+
[tx_symb tx_bits prev_tx_sym] = bits_to_qpsk_symbols(sim_in, tx_bits, [], []);
- tx_symb_log = [tx_symb_log; tx_symb];
- [rx_symb rx_bits rx_symb_linear amp_linear amp_ phi_ EsNo_ prev_sym_rx sim_in] = qpsk_symbols_to_bits(sim_in, tx_symb, []);
- rx_symb_log = [rx_symb_log; rx_symb];
- rx_amp_log = [rx_amp_log; amp_];
- rx_phi_log = [rx_phi_log; phi_];
- rx_bits_log = [rx_bits_log; rx_bits];
+ tx_symb_log = [tx_symb_log; tx_symb];
+
+ for r=1:sim_in.Nsymbrowpilot
+ phase = phase*freq;
+ ch_symb(r,:) = tx_symb(r,:)*phase;
+ end
+ phase = phase/abs(phase);
+
+ [rx_symb rx_bits rx_symb_linear amp_linear amp_ phi_ EsNo_ prev_sym_rx sim_in] = qpsk_symbols_to_bits(sim_in, ch_symb,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_data_r;
+ COMP phase, freq;
+ int *ptest_bits_coh, *ptest_bits_coh_end;
coh = cohpsk_create();
assert(coh != NULL);
log_r = log_data_r= 0;
+ ptest_bits_coh = (int*)test_bits_coh;
+ ptest_bits_coh_end = (int*)test_bits_coh + sizeof(test_bits_coh)/sizeof(int);
memcpy(tx_bits, test_bits_coh, sizeof(int)*COHPSK_BITS_PER_FRAME);
+ phase.real = 1.0; phase.imag = 0.0;
+ freq.real = cos(2.0*M_PI*FOFF/RS); freq.imag = sin(2.0*M_PI*FOFF/RS);
+
for(f=0; f<FRAMES; f++) {
/* --------------------------------------------------------*\
Modem
\*---------------------------------------------------------*/
+ memcpy(tx_bits, ptest_bits_coh, sizeof(int)*COHPSK_BITS_PER_FRAME);
+ ptest_bits_coh += COHPSK_BITS_PER_FRAME;
+ if (ptest_bits_coh >= ptest_bits_coh_end)
+ ptest_bits_coh = (int*)test_bits_coh;
bits_to_qpsk_symbols(tx_symb, (int*)tx_bits, COHPSK_BITS_PER_FRAME);
- qpsk_symbols_to_bits(coh, rx_bits, tx_symb);
+
+ for(r=0; r<NSYMROWPILOT; r++) {
+ phase = cmult(phase,freq);
+ for(c=0; c<PILOTS_NC; c++)
+ ch_symb[r][c] = cmult(tx_symb[r][c], phase);
+ }
+ phase = fcmult(1.0/cabsolute(phase), phase);
+
+ qpsk_symbols_to_bits(coh, rx_bits, ch_symb);
/* --------------------------------------------------------*\
Log each vector