aboutsummaryrefslogtreecommitdiff
path: root/octave/ofdm_time_sync.m
blob: 6c146272c8c61a8ec821363610265149af76f158 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
% ofdm_time_sync.m
% David Rowe June 2019
%
% Tests ofdm modem sync time, using real, off air files

function ofdm_time_sync(filename, Ntrials=10)

  time_to_sync = []; passes = fails = 0;
  for toffset=0:Ntrials-1
    atime = ofdm_ldpc_rx(filename, mode="700D", interleave_frames = 1, "", start_secs=toffset, len_secs=5);
    if atime != -1
      passes++;
      time_to_sync = [time_to_sync atime];
    else
       fails++;
    end
  end
  printf("pass: %d fails: %d mean: %3.2f var %3.2f\n", passes, fails, mean(time_to_sync), var(time_to_sync));
  figure(1); clf; plot(time_to_sync);
endfunction