From: drowe67 Date: Wed, 11 Apr 2018 23:04:27 +0000 (+0000) Subject: octave script to plot modem states from ofdm_demod c program X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=f38fbb3f78a4d79411e9221a8f2b12e5a9f538dc;p=freetel-svn-tracking.git octave script to plot modem states from ofdm_demod c program git-svn-id: https://svn.code.sf.net/p/freetel/code@3464 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/octave/ofdm_demod_c.m b/codec2-dev/octave/ofdm_demod_c.m new file mode 100644 index 00000000..22f17698 --- /dev/null +++ b/codec2-dev/octave/ofdm_demod_c.m @@ -0,0 +1,44 @@ +% 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) + ofdm_lib; + more off; + + % init modem + + Ts = 0.018; Tcp = 0.002; Rs = 1/Ts; bps = 2; Nc = 17; Ns = 8; + states = ofdm_init(bps, Rs, Tcp, Ns, Nc); + 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