Home > classes > @specwin > plot.m

plot

PURPOSE ^

PLOT plots a specwin object.

SYNOPSIS ^

function varargout = plot(varargin)

DESCRIPTION ^

 PLOT plots a specwin object.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: PLOT plots a specwin object.

 CALL:            plot(specwin)
              h = plot(specwin)

 M-FILE INFO: Get information about this methods by calling
              >> specwin.getInfo('plot')

              Get information about a specified set-plist by calling:
              >> specwin.getInfo('plot', 'set')

 VERSION:     $Id: plot.m,v 1.9 2008/09/04 15:29:31 ingo Exp $

 HISTORY:     06-02-2007 M Hewitson
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % PLOT plots a specwin object.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: PLOT plots a specwin object.
0005 %
0006 % CALL:            plot(specwin)
0007 %              h = plot(specwin)
0008 %
0009 % M-FILE INFO: Get information about this methods by calling
0010 %              >> specwin.getInfo('plot')
0011 %
0012 %              Get information about a specified set-plist by calling:
0013 %              >> specwin.getInfo('plot', 'set')
0014 %
0015 % VERSION:     $Id: plot.m,v 1.9 2008/09/04 15:29:31 ingo Exp $
0016 %
0017 % HISTORY:     06-02-2007 M Hewitson
0018 %                 Creation
0019 %
0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0021 
0022 function varargout = plot(varargin)
0023 
0024   %%% Check if this is a call for parameters
0025   if utils.helper.isinfocall(varargin{:})
0026     varargout{1} = getInfo(varargin{3});
0027     return
0028   end
0029 
0030   % Get specwin objects
0031   ws = utils.helper.collect_objects(varargin(:), 'specwin');
0032 
0033   hl = [];
0034 
0035   hold on
0036   grid on;
0037 
0038   colors = getappdata(0,'ltpda_default_plot_colors');
0039 
0040   titleStr  = '';
0041   legendStr = '';
0042 
0043   for i=1:numel(ws)
0044     w   = ws(i);
0045     hl  = [hl plot(w.win)];
0046     col = colors{mod(i-1,length(colors))+1};
0047     set(hl(end), 'Color', col);
0048     xlabel('sample');
0049     ylabel('amplitude');
0050     titleStr = [titleStr, utils.prog.label(w.type), ', '];
0051     lstr = [sprintf('alpha = %g\n', w.alpha)...
0052       sprintf('psll = %g\n', w.psll)...
0053       sprintf('rov = %g\n', w.rov)...
0054       sprintf('nenbw = %g\n', w.nenbw)...
0055       sprintf('w3db = %g\n', w.w3db)...
0056       sprintf('flatness = %g\n', w.flatness)];
0057     legendStr = [legendStr cellstr(lstr)];
0058   end
0059 
0060   legend(legendStr);
0061   titleStr = titleStr(1:end-2);
0062   title(sprintf('Window: %s', titleStr));
0063 
0064   if nargout > 0
0065     varargout{1} = hl;
0066   end
0067 
0068   hold off
0069 end
0070 
0071 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0072 %                               Local Functions                               %
0073 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0074 
0075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0076 %
0077 % FUNCTION:    getInfo
0078 %
0079 % DESCRIPTION: Get Info Object
0080 %
0081 % HISTORY:     11-07-07 M Hewitson
0082 %                Creation.
0083 %
0084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0085 
0086 function ii = getInfo(varargin)
0087   if nargin == 1 && strcmpi(varargin{1}, 'None')
0088     sets = {};
0089     pl   = [];
0090   else
0091     sets = {'Default'};
0092     pl   = getDefaultPlist;
0093   end
0094   % Build info object
0095   ii = minfo(mfilename, 'specwin', '', utils.const.categories.output, '$Id: plot.m,v 1.9 2008/09/04 15:29:31 ingo Exp $', sets, pl);
0096 end
0097 
0098 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0099 %
0100 % FUNCTION:    getDefaultPlist
0101 %
0102 % DESCRIPTION: Get Default Plist
0103 %
0104 % HISTORY:     11-07-07 M Hewitson
0105 %                Creation.
0106 %
0107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0108 
0109 function plo = getDefaultPlist()
0110   plo = plist();
0111 end
0112

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003