www.pudn.com > WCDMA.rar > ModulatorMenu.m


function fig = ModulatorMenu(sam) 
%************************************************************ 
% 
% Copyright 2002 The Mobile and Portable Radio Research Group 
% 
% Part of GUI for downlink simulator. 
% Generates the Modulator menue. 
% This menu allows the user to determine the length of the 
% pulse shape filter and the oversampling rate 
% 
%************************************************************ 
 
 
global PulseLengthHandle OversampleHandle  
 
load ModulatorMenu 
 
SamplesPerChipString = [' 2';' 3';' 4';' 5';' 6';' 7';' 8';' 9';'10']; 
PulseLenghtString = [' 6';' 8';'10';'12';'14';'16';'18';'20';'22';'24';'26';'28';'30']; 
 
bdwidth = 5; 
topbdwidth=30; 
ScreenSize = get(0,'ScreenSize'); 
Width = 386; 
Height = 286; 
right = round((ScreenSize(3)-Width)/2)-2*bdwidth; 
bottom = ScreenSize(4)-Height-4*topbdwidth; 
 
%Generate figure 
h0 = figure('Color',[0.8 0.8 0.8], ... 
	'Colormap',mat0, ... 
	'FileName','C:\MATLABR11\work\LGIChannel\DownlinkSimulator\gui\ModulatorMenu.m', ... 
	'PaperPosition',[18 180 576 432], ... 
	'PaperUnits','points', ... 
	'Position',[right bottom 386 286], ... 
	'Tag','Fig1', ... 
   'ToolBar','none'); 
 
% Object for Title 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
	'FontSize',18, ... 
	'ListboxTop',0, ... 
	'Position',[24.75 177 237 24], ... 
	'String','WCDMA Downlink Simulator', ... 
	'Style','text', ... 
   'Tag','StaticText1'); 
 
%Object for subtitle 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
	'FontSize',14, ... 
	'ListboxTop',0, ... 
	'Position',[34.5 147 198.75 19.5], ... 
	'String','Modulator Configuation', ... 
	'Style','text', ... 
   'Tag','StaticText2'); 
 
%Objects for Determining Pulse Length 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'FontSize',10, ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
	'HorizontalAlignment','left', ... 
	'ListboxTop',0, ... 
	'Position',[51.75 100.5 75 20.25], ... 
	'String','Pulse Length', ... 
	'Style','text', ... 
	'Tag','StaticText3'); 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'FontSize',10, ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
	'ListboxTop',0, ... 
	'Position',[226.5 104.25 41.25 18], ... 
	'String','Chips', ... 
	'Style','text', ... 
	'Tag','StaticText5'); 
PulseLengthHandle = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 1 1 1], ... 
	'ListboxTop',0, ... 
	'Position',[165.75 102.75 57 18.75], ... 
	'String',PulseLenghtString , ... 
	'Style','popupmenu', ... 
	'Tag','PulseLength Popup Menu', ... 
   'Value',3); 
 
%Objects for determining the oversampling factor 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
	'FontSize',10, ... 
	'HorizontalAlignment','left', ... 
	'ListboxTop',0, ... 
	'Position',[48 57 104.25 27.75], ... 
	'String','Oversampling Factor (Samples Per Chip)', ... 
	'Style','text', ... 
	'Tag','StaticText4'); 
OversampleHandle = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 1 1 1], ... 
	'ListboxTop',0, ... 
	'Position',[164.25 63 61.5 18.75], ... 
	'String',SamplesPerChipString , ... 
	'Style','popupmenu', ... 
	'Tag','SamplesPerChip Popup Menu', ... 
   'Value',4); 
 
%Navigation Buttons 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[0.831372549019608 0.815686274509804 0.784313725490196], ... 
	'ListboxTop',0, ... 
	'Position',[35.25 18 45 15], ... 
   'Callback','BackModulatorCallback',... 
	'String','<< Back', ... 
	'Tag','Pushbutton2'); 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[0.831372549019608 0.815686274509804 0.784313725490196], ... 
   'ListboxTop',0, ... 
   'Callback','NextModulatorCallback',... 
	'Position',[103.5 18.75 45 15], ... 
	'String','Next >>', ... 
	'Tag','Pushbutton2'); 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[0.831372549019608 0.815686274509804 0.784313725490196], ... 
	'ListboxTop',0, ... 
   'Position',[172.5 19.5 45 15], ... 
   'Callback','close',... 
	'String','Cancel', ... 
   'Tag','Pushbutton2'); 
 
if nargin == 1 
   if isfield(sam,'PulseUpperBound') 
      if sam.PulseUpperBound >= 3 
         PulseLength = sam.PulseUpperBound * 2; 
         I = (0.5 * PulseLength) -2; 
         set(PulseLengthHandle,'value',I); 
      end 
   end 
    
   if isfield(sam,'SamplesPerChip') 
      if sam.SamplesPerChip >= 2 
         I = sam.SamplesPerChip - 1; 
         set(OversampleHandle,'value',I); 
      end 
   end 
end 
 
        
if nargout > 0, fig = h0; end