5
|
1 % Copyright David Rowe 2007
|
|
2 % This program is distributed under the terms of the GNU General Public License
|
|
3 % Version 2
|
|
4
|
|
5 function pl(samplename, start_sam, end_sam, pngname)
|
|
6
|
|
7 ftx=fopen(strcat(samplename, "_tx.raw"),"rb");
|
|
8 tx=fread(ftx,Inf,"short");
|
|
9 frx=fopen(strcat(samplename, "_rx.raw"),"rb");
|
|
10 rx=fread(frx,Inf,"short");
|
|
11 fec=fopen(strcat(samplename, "_ec.raw"),"rb");
|
|
12 ec=fread(fec,Inf,"short");
|
|
13
|
|
14 st = 1;
|
|
15 en = length(tx);
|
|
16 if (nargin >= 2)
|
|
17 st = start_sam;
|
|
18 endif
|
|
19 if (nargin >= 3)
|
|
20 en = end_sam;
|
|
21 endif
|
|
22
|
|
23 figure(1);
|
|
24 clg;
|
|
25 plot(tx(st:en),"r;tx;", rx(st:en),"g;rx;", ec(st:en),"b;ec;");
|
|
26 %axis([1 en-st min(tx) max(tx)]);
|
|
27
|
|
28 if (nargin == 4)
|
|
29
|
|
30 % small image
|
|
31
|
|
32 __gnuplot_set__ terminal png size 420,300
|
|
33 s = sprintf("__gnuplot_set__ output \"%s.png\"", pngname);
|
|
34 eval(s)
|
|
35 replot;
|
|
36
|
|
37 % larger image
|
|
38
|
|
39 __gnuplot_set__ terminal png size 800,600
|
|
40 s = sprintf("__gnuplot_set__ output \"%s_large.png\"", pngname);
|
|
41 eval(s)
|
|
42 replot;
|
|
43
|
|
44 endif
|
|
45
|
|
46 endfunction
|