% Script to plot the apmplitude and pahse of selected complex demodulates. close all cd_data clear fba fbp; demods plot_setup head = sprintf ("filter (NL): %d nconv %d", NL, nconv); xlab = ["time"]; ylab = ["amplitude "]; hold off outfile = [data_out, "/", trend_out, "/", "plot_demods.pdf"]; % temp %nt1 = datlen; %nt6 = startex; %ntf = nt(6) + nf; ntf = startex+ extlen; ppi = 4; xe(1)= xxx(startex); xe(2) = xe(1); % Require fmult to determine % which 3 demods to plot. yscal=1; for K = 1:3 fbindex = 1 + fmult*K; ya2 = max (fba(1 + fmult*K,:)); yp1 = max (fbp(1 + fmult*K,:)); yp2 = min (fbp(1 + fmult*K,:)); subplot (2, 3, K); hold ("on"); grid ("on"); set (gca (), "box", "off") if (K == 1) plot (xxx(1:ntf), fba(fbindex, 1:ntf), "r", "linewidth", rlinew); ylabel (ylab); else plot (xxx(1:ntf), fba(fbindex, 1:ntf), "r", "linewidth", rlinew); endif plot (xe,[0, ya2],"b", "linewidth", blinew, "linestyle","-"); title (sprintf (" Freq: pi/%d", (MT-1)/(fbindex - 1))); xlabel (xlab); subplot (2, 3, K+3); hold ("on"); grid ("on"); set (gca (), "box", "off") if (K == 1) ylabel ("phase"); endif; plot (xxx(1:ntf), fbp(fbindex, 1:ntf), "r", "linewidth", rlinew); plot (xe, [yp1, yp2], "b", "linewidth", blinew, "linestyle", "-"); if (K == 2) title2 = sprintf ("%s: A = ", data_title); for n = 1:max (size (A)) title2 = strcat (title2, sprintf ("%6.2f, ", A(n))); endfor title2 = strcat (title2, " B = "); for n = 1:max (size (B)) title2 = strcat (title2, sprintf ("%6.2f, ", B(n))); endfor title2 = strcat (title2, sprintf (" NL = %3i, nconv = %3i.", NL, nconv)); title (title2); endif; xlabel (xlab); endfor title2 if (exist ("do_plot")) print (outfile, "-color") printf ("Plot file written to: %s\n", outfile); endif;