% 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
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);
% Simulation Parameters --------------------------------------
-frames = 200;
+frames = 100;
EbNo_dB = 6.3;
Foff_hz = -100;
modulation = 'dqpsk';
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;
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 = [];
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);
{
int i,c;
COMP two = {2.0, 0.0};
- COMP pilot;
float mag;
for(i=0; i<M; i++) {
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++) {