aboutsummaryrefslogtreecommitdiff
path: root/octave/ofdm_demod_c.m
blob: 531a649e10e0817c56e9672e09d23e3d81992f0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
% ofdm_demod_c.m
% David Rowe April 2018
%
% Plots data from The C OFDM demodulator ofdm_demod, in similar format to
% plots from Octave OFDM demodulator ofdm_rx.m
%
% Useful for of line analysis of a demod run

function ofdm_demod_c(filename, mode="700D")
  ofdm_lib;
  more off;

  % init modem

  config = ofdm_init_mode(mode);
  states = ofdm_init(config);
  ofdm_load_const;
  states.verbose = 0;

  load(filename);
  
  figure(1); clf; 
  plot(rx_np_log_c,'+');
  mx = 2*max(abs(rx_np_log_c));
  axis([-mx mx -mx mx]);
  title('Scatter');

  figure(2); clf;
  plot(phase_est_pilot_log_c(:,2:Nc),'g+', 'markersize', 5); 
  title('Phase Est');
  axis([1 length(phase_est_pilot_log_c) -pi pi]);  

  figure(3); clf;
  stem(timing_est_log_c)
  title('Timing Est');

  figure(4); clf;
  plot(foff_hz_log_c)
  mx = max(abs(foff_hz_log_c))+1;
  axis([1 max(length(foff_hz_log_c),2) -mx mx]);
  title('Fine Freq');
  ylabel('Hz')
endfunction