Home > classes > @specwin > specwin.m

specwin

PURPOSE ^

SPECWIN spectral window object class constructor.

SYNOPSIS ^

function w = specwin(varargin)

DESCRIPTION ^

 SPECWIN spectral window object class constructor.
     Create a spectral window from libSpecWin.
 
     Properties:
       name     - name of window object
       alpha    - alpha parameter for various window functions
       psll     - peak sidelobe level
       rov      - recommended overlap
       nenbw    - normalised equivalent noise bandwidth
       w3db     - 3 dB bandwidth in bins
       flatness - window flatness
       ws       - sum of window values
       ws2      - sum of squares of window values
       nfft     - window length
       win      - window samples
 
     Possible constructors:
 
       w = specwin(w)         - copies a specwin object
       w = specwin('name', N) - creates a specwin object of a particular
                                type and length. (see below for supported types.)
       w = specwin('Kaiser', N, psll) - create a specwin Kaiser window
                                        with the prescribed psll.
 
 'name' should be one of the following standard windows:
    Rectangular, Welch, Bartlett, Hanning, Hamming, 
    Nuttall3, Nuttall4, Nuttall3a, Nuttall3b, Nuttall4a
    Nuttall4b, Nuttall4c, BH92, SFT3F, SFT3M, FTNI, SFT4F, SFT5F
    SFT4M, FTHP, HFT70, FTSRS, SFT5M, HFT90D, HFT95, HFT116D
    HFT144D, HFT169D, HFT196D, HFT223D, HFT248D
    
 M Hewitson 30-01-07

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function w = specwin(varargin)
0002 
0003 % SPECWIN spectral window object class constructor.
0004 %     Create a spectral window from libSpecWin.
0005 %
0006 %     Properties:
0007 %       name     - name of window object
0008 %       alpha    - alpha parameter for various window functions
0009 %       psll     - peak sidelobe level
0010 %       rov      - recommended overlap
0011 %       nenbw    - normalised equivalent noise bandwidth
0012 %       w3db     - 3 dB bandwidth in bins
0013 %       flatness - window flatness
0014 %       ws       - sum of window values
0015 %       ws2      - sum of squares of window values
0016 %       nfft     - window length
0017 %       win      - window samples
0018 %
0019 %     Possible constructors:
0020 %
0021 %       w = specwin(w)         - copies a specwin object
0022 %       w = specwin('name', N) - creates a specwin object of a particular
0023 %                                type and length. (see below for supported types.)
0024 %       w = specwin('Kaiser', N, psll) - create a specwin Kaiser window
0025 %                                        with the prescribed psll.
0026 %
0027 % 'name' should be one of the following standard windows:
0028 %    Rectangular, Welch, Bartlett, Hanning, Hamming,
0029 %    Nuttall3, Nuttall4, Nuttall3a, Nuttall3b, Nuttall4a
0030 %    Nuttall4b, Nuttall4c, BH92, SFT3F, SFT3M, FTNI, SFT4F, SFT5F
0031 %    SFT4M, FTHP, HFT70, FTSRS, SFT5M, HFT90D, HFT95, HFT116D
0032 %    HFT144D, HFT169D, HFT196D, HFT223D, HFT248D
0033 %
0034 % M Hewitson 30-01-07
0035 %
0036 
0037 %       w = specwin('Flattop', N, psll) - create a specwin Flattop window
0038 %                                         with the prescribed psll.
0039 
0040 
0041 ALGONAME = mfilename;
0042 VERSION  = '$Id: specwin.html,v 1.1 2007/06/08 14:15:07 hewitson Exp $';
0043 
0044 if nargin == 0
0045   
0046   % return list of windows
0047   w = {...
0048    'Rectangular', 'Welch', 'Bartlett', 'Hanning', 'Hamming',... 
0049    'Nuttall3', 'Nuttall4', 'Nuttall3a', 'Nuttall3b', 'Nuttall4a',...
0050    'Nuttall4b', 'Nuttall4c', 'BH92', 'SFT3F', 'SFT3M', 'FTNI', 'SFT4F', 'SFT5F',...
0051    'SFT4M', 'FTHP', 'HFT70', 'FTSRS', 'SFT5M', 'HFT90D', 'HFT95', 'HFT116D',...
0052    'HFT144D', 'HFT169D', 'HFT196D', 'HFT223D', 'HFT248D'...
0053    };
0054  
0055   
0056 %-----------------------------------------------------
0057 % create copy specwin
0058 elseif nargin == 1
0059   if isa(varargin{1}, 'specwin')
0060     w = varargin{1};
0061   elseif isstruct(varargin{1})
0062     
0063     w = class(varargin{1}, 'specwin');
0064     return
0065     
0066   elseif isa(varargin{1}, 'plist')
0067     
0068     pl    = varargin{1};
0069     wname = find(pl, 'Name');
0070     N     = find(pl, 'N');
0071     psll  = find(pl, 'PSLL');
0072     
0073     switch wname
0074       case 'Kaiser'
0075         w = specwin(wname, N, psll);
0076       otherwise
0077         w = specwin(wname, N);
0078     end
0079     
0080   else
0081     error('### unknown constructor type for specwin object.');
0082   end
0083   
0084 elseif nargin == 2
0085   %-----------------------------------------------------
0086   % copy AO
0087   if isa(varargin{1}, 'specwin')
0088     w = varargin{1};    
0089     w.created = ''; %sprintf('%s', datestr(now));
0090     w.version = VERSION;
0091   %-----------------------------------------------------
0092   % create a particular type
0093   elseif ischar(varargin{1})
0094     
0095 %     w = ltpda_specwin(varargin{1}, varargin{2});
0096     w = get_window(varargin{1}, varargin{2});
0097     w.created = ''; %sprintf('%s', datestr(now));
0098     w.version = VERSION;
0099     w = class(w, 'specwin');
0100  
0101   %-----------------------------------------------------
0102   % create from x-data
0103   else
0104     error('### unknown constructor for specwin object.')
0105   end
0106 %-----------------------------------------------------
0107 %  Kaiser
0108 elseif nargin == 3
0109   
0110 %     w = ltpda_specwin(varargin{1}, varargin{2}, varargin{3});
0111     w = get_window(varargin{1}, varargin{2}, varargin{3});
0112     w.created = ''; %sprintf('%s', datestr(now));
0113     w.version = VERSION;
0114     w = class(w, 'specwin');
0115     
0116 else
0117   error('### Unknown number of constructor arguments.');
0118 end
0119 
0120 
0121

Generated on Fri 08-Jun-2007 16:09:11 by m2html © 2003