comparison m-toolbox/classes/@specwin/plot.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % PLOT plots a specwin object.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: PLOT plots a specwin object.
5 %
6 % CALL: plot(specwin)
7 % h = plot(specwin)
8 %
9 % VERSION: $Id: plot.m,v 1.13 2011/02/17 14:24:55 ingo Exp $
10 %
11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12
13 function varargout = plot(varargin)
14
15 % Get specwin objects
16 ws = [varargin{:}];
17
18 hl = [];
19
20 hold on
21 grid on;
22
23 colors = getappdata(0,'ltpda_default_plot_colors');
24
25 titleStr = '';
26 legendStr = '';
27
28 for i=1:numel(ws)
29 w = ws(i);
30 if ~isempty(w.win)
31 win = w.win;
32 else
33 dummy = specwin(w.type, 100);
34 win = dummy.win;
35 end
36 hl = [hl plot(win)];
37 col = colors{mod(i-1,length(colors))+1};
38 set(hl(end), 'Color', col);
39 xlabel('sample');
40 ylabel('amplitude');
41 titleStr = [titleStr, utils.prog.label(w.type), ', '];
42 lstr = [sprintf('alpha = %g\n', w.alpha)...
43 sprintf('psll = %g\n', w.psll)...
44 sprintf('rov = %g\n', w.rov)...
45 sprintf('nenbw = %g\n', w.nenbw)...
46 sprintf('w3db = %g\n', w.w3db)...
47 sprintf('flatness = %g\n', w.flatness)];
48 legendStr = [legendStr cellstr(lstr)];
49 end
50
51 legend(legendStr);
52 titleStr = titleStr(1:end-2);
53 title(sprintf('Window: %s', titleStr));
54
55 if nargout > 0
56 varargout{1} = hl;
57 end
58
59 hold off
60 end
61