0001 function varargout = specwin_viewer(varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 id = findobj('Tag', 'LTPDAspecwin_viewer');
0022 if ~isempty(id)
0023 figure(id)
0024 return
0025 end
0026
0027
0028
0029 Gproperties.Gcol = [240 240 240]/255;
0030 Gproperties.Gwidth = 800;
0031 Gproperties.Gheight = 400;
0032 Gproperties.Gborder = 10;
0033 fontsize = getappdata(0, 'ltpda_repo_gui_fontsize');
0034
0035 Gproperties.Screen = get(0,'screensize');
0036 Gproperties.Gposition = [150 ...
0037 150 ...
0038 Gproperties.Gwidth...
0039 Gproperties.Gheight];
0040
0041
0042 mainfig = figure('Name', 'LTPDA Spectral Window Viewer',...
0043 'NumberTitle', 'off',...
0044 'Visible','off',...
0045 'Position',Gproperties.Gposition,...
0046 'Color', Gproperties.Gcol,...
0047 'ToolBar', 'none', ...
0048 'NextPlot', 'new', ...
0049 'MenuBar', 'none',...
0050 'Resize', 'off',...
0051 'Tag', 'LTPDAspecwin_viewer');
0052
0053
0054 set(mainfig, 'CloseRequestFcn', {'ltpda_specwin_viewer_close', mainfig});
0055
0056
0057 setappdata(mainfig, 'Gproperties', Gproperties);
0058
0059
0060
0061
0062
0063 buildWindowSelectionMenu(mainfig);
0064
0065
0066
0067 sth = uicontrol(mainfig,'Style','text',...
0068 'String','Window Size',...
0069 'BackgroundColor', Gprops.Gcol, ...
0070 'Position',[10 Gprops.Gheight-70 80 25]);
0071
0072 eth = uicontrol(mainfig,'Style','edit',...
0073 'String','100',...
0074 'BackgroundColor', 'w', ...
0075 'Tag', 'LTPDA_specwin_viewer_WinSize', ...
0076 'Position',[100 Gprops.Gheight-70 120 25]);
0077
0078
0079
0080 sth = uicontrol(mainfig,'Style','text',...
0081 'String','Window PSLL',...
0082 'BackgroundColor', Gprops.Gcol, ...
0083 'Position',[10 Gprops.Gheight-100 80 25]);
0084
0085 eth = uicontrol(mainfig,'Style','edit',...
0086 'String','150',...
0087 'BackgroundColor', 'w', ...
0088 'Tag', 'LTPDA_specwin_viewer_PSLL', ...
0089 'Position',[100 Gprops.Gheight-100 120 25]);
0090
0091
0092 pbh = uicontrol(mainfig,'Style','pushbutton',...
0093 'String','Plot Time-domain',...
0094 'Callback', {'ltpda_specwin_viewer_build_window', 'Time-domain'}, ...
0095 'Position',[10 Gprops.Gheight-140 100 25]);
0096
0097
0098 pbh = uicontrol(mainfig,'Style','pushbutton',...
0099 'String','Plot Freq-domain',...
0100 'Callback', {'ltpda_specwin_viewer_build_window', 'Freq-domain'}, ...
0101 'Position',[120 Gprops.Gheight-140 100 25]);
0102
0103
0104
0105 M = 0.01;
0106 ax = axes('Position', [0.5+M 0.2 0.4 0.7], ...
0107 'Parent', mainfig, ...
0108 'Tag', 'LTPDA_specwin_viewer_axes', ...
0109 'Visible', 'on', ...
0110 'Box', 'on');
0111
0112 setappdata(mainfig, 'axes', ax);
0113
0114 sth = uicontrol(mainfig,'Style','text',...
0115 'String','None',...
0116 'BackgroundColor', Gprops.Gcol, ...
0117 'Tag', 'LTPDA_specwin_viewer_wininfo', ...
0118 'Position',[10 10 300 Gproperties.Gheight/2 - 20], ...
0119 'FontSize', 14, 'ForegroundColor', 'b');
0120
0121
0122 sth = uicontrol(mainfig,'Style','edit',...
0123 'String','',...
0124 'BackgroundColor', 'w', ...
0125 'Tag', 'LTPDA_specwin_viewer_cstr', ...
0126 'Position',[10 10 300 25]);
0127
0128
0129
0130 ltpda_specwin_viewer_wintype(mainfig);
0131
0132
0133 ltpda_specwin_viewer_build_window('Time-domain');
0134
0135
0136
0137
0138
0139
0140
0141 set(mainfig,'Visible','on')
0142
0143
0144
0145
0146
0147 function buildWindowSelectionMenu(mainfig)
0148
0149 Gprops = getappdata(mainfig, 'Gproperties');
0150
0151
0152 wins = specwin('Types');
0153
0154
0155 sth = uicontrol(mainfig,'Style','text',...
0156 'String','Window Type',...
0157 'BackgroundColor', Gprops.Gcol, ...
0158 'Position',[10 Gprops.Gheight-40 80 25]);
0159
0160
0161 pmh = uicontrol(mainfig,'Style','popupmenu',...
0162 'String', [{'Kaiser'} wins],...
0163 'Value', 1, ...
0164 'BackgroundColor', Gprops.Gcol, ...
0165 'Tag', 'LTPDA_specwin_viewer_WinType', ...
0166 'Callback', {'ltpda_specwin_viewer_wintype', mainfig}, ...
0167 'Position',[100 Gprops.Gheight-40 120 25]);
0168
0169 end
0170
0171 end
0172
0173
0174