0 AWGN 10 1.00 0.98
0 HF 10 1.00 0.65
- -> Suggests we will sync up in 2-3 frames which is pretty cool.
+ -> Suggests we will sync up in 2-3 frames which is pretty cool. Would be good
+ to have freq est about as reliable as timing est.....
#}
function acquisition_histograms(fine_en = 0, foff)
#{
TODO:
- [ ] single frame based sync state machine
+ [X] single frame based sync state machine
+ that doesn't depend on payload data
[ ] make robust to fading
+ what are win conditions?
prx += states.nin;
[rx_bits states aphase_est_pilot_log arx_np arx_amp] = ofdm_demod(states, rxbuf_in);
+
+ errors = xor(tx_bits, rx_bits);
+ Nerrs = sum(errors);
+ aber = Nerrs/Nbitsperframe;
+
frame_count++;
- printf("f: %d state: %s frame_count: %d\n", f, state, frame_count);
+ printf("f: %d state: %s Nerrs: %d aber: %3.2f\n", f, state, Nerrs, aber);
% If looking for sync: check raw BER on frame just received
% against all possible positions in the interleaver frame.
% If looking for sync: check raw BER on frame just received
% against all possible positions in the interleaver frame.
- errors = xor(tx_bits, rx_bits);
- Nerrs = sum(errors);
- if Nerrs/Nbitsperframe < 0.1
+ if aber < 0.1
next_state = 'synced';
% make sure we get an interleave frame with correct freq offset
% note this introduces a lot of delay, a better idea would be to
% measure uncoded bit errors on modem frame
- errors = xor(tx_bits, rx_bits);
- Nerrs = sum(errors);
- if Nerrs/Nbitsperframe < 0.2
+ if aber < 0.2
Terrs += Nerrs;
Nerrs_log = [Nerrs_log Nerrs];
Tbits += Nbitsperframe;
for f=1:Nframes
tx = [tx ofdm_mod(states, tx_bits)];
end
-
+
Nsam = length(tx);
% channel simulation
dopplerSpreadHz = 1; path_delay_ms = 1;
path_delay_samples = path_delay_ms*Fs/1000;
- printf("Doppler Spread: %3.2f Hz Path Delay: %3.2f ms %d samples\n", dopplerSpreadHz, path_delay_ms, path_delay_samples);
+ printf("Doppler Spread: %3.2f Hz Path Delay: %3.2f ms %d samples\n",
+ dopplerSpreadHz, path_delay_ms, path_delay_samples);
% generate same fading pattern for every run