⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pertone.m

📁 多载波调制的仿真程序
💻 M
📖 第 1 页 / 共 3 页
字号:
   top = yPos - btnHt - spacing;   labelWidth = frmWidth-textWidth-.01;   labelBottom=top-textHeight;   labelLeft = left;   labelPos = [labelLeft labelBottom labelWidth textHeight];   h = uicontrol( ...      'Style','text', ...      'Units','normalized', ...      'Position',labelPos, ...      'Horiz','left', ...      'String','FFT Size (N)', ...      'Interruptible','off', ...      'BackgroundColor',[0.5 0.5 0.5], ...      'ForegroundColor','white');      % set FFT size   textPos = [labelLeft+labelWidth-.015 labelBottom textWidth+.025 textHeight];   callbackStr = 'pertone(''setN'')';   str = sprintf('512');   mat = [512];   NHndl = uicontrol( ...      'Style','edit', ...      'Units','normalized', ...      'Position',textPos, ...      'Max',1, ...       'Horiz','right', ...      'Background','white', ...      'Foreground','black', ...      'String',str,'Userdata',mat, ...      'callback',callbackStr);      % coding gain label   btnNumber=4;   yPos=menutop-(btnNumber-1)*(btnHt+spacing);   top = yPos - btnHt - spacing;   labelWidth = frmWidth-textWidth-.01;   labelBottom=top-textHeight;   labelLeft = left;   labelPos = [labelLeft labelBottom labelWidth textHeight];   h = uicontrol( ...      'Style','text', ...      'Units','normalized', ...      'Position',labelPos, ...      'Horiz','left', ...      'String','Coding gain (dB)', ...      'Interruptible','off', ...      'BackgroundColor',[0.5 0.5 0.5], ...      'ForegroundColor','white');      % set coding gain    textPos = [labelLeft+labelWidth-.015 labelBottom textWidth+.025 textHeight];   callbackStr = 'pertone(''setCG'')';   str = sprintf('4.2');   mat = [4.2];   CGHndl = uicontrol( ...      'Style','edit', ...      'Units','normalized', ...      'Position',textPos, ...      'Max',1, ...       'Horiz','right', ...      'Background','white', ...      'Foreground','black', ...      'String',str,'Userdata',mat, ...      'callback',callbackStr);      % Margin label   btnNumber=5;   yPos=menutop-(btnNumber-1)*(btnHt+spacing);   top = yPos - btnHt - spacing;   labelWidth = frmWidth-textWidth-.01;   labelBottom=top-textHeight;   labelLeft = left;   labelPos = [labelLeft labelBottom labelWidth textHeight];   h = uicontrol( ...      'Style','text', ...      'Units','normalized', ...      'Position',labelPos, ...      'Horiz','left', ...      'String','Margin (dB)', ...      'Interruptible','off', ...      'BackgroundColor',[0.5 0.5 0.5], ...      'ForegroundColor','white');      % set margin   textPos = [labelLeft+labelWidth-.015 labelBottom textWidth+.025 textHeight];   callbackStr = 'pertone(''setMargin'')';   str = sprintf('6');   mat = [6];   MarginHndl = uicontrol( ...      'Style','edit', ...      'Units','normalized', ...      'Position',textPos, ...      'Max',1, ...       'Horiz','right', ...      'Background','white', ...      'Foreground','black', ...      'String',str,'Userdata',mat, ...      'callback',callbackStr);         % Dmin label   btnNumber=6;   yPos=menutop-(btnNumber-1)*(btnHt+spacing);   top = yPos - btnHt - spacing;   labelWidth = frmWidth-textWidth-.01;   labelBottom=top-textHeight;   labelLeft = left;   labelPos = [labelLeft labelBottom labelWidth textHeight];   h = uicontrol( ...      'Style','text', ...      'Units','normalized', ...      'Position',labelPos, ...      'Horiz','left', ...      'String','Dmin', ...      'Interruptible','off', ...      'BackgroundColor',[0.5 0.5 0.5], ...      'ForegroundColor','white');      % set Dmin   textPos = [labelLeft+labelWidth-.015 labelBottom textWidth+.025 textHeight];   callbackStr = 'pertone(''setDmin'')';   str = sprintf('15');   mat = [15];   DminHndl = uicontrol( ...      'Style','edit', ...      'Units','normalized', ...      'Position',textPos, ...      'Max',1, ...       'Horiz','right', ...      'Background','white', ...      'Foreground','black', ...      'String',str,'Userdata',mat, ...      'callback',callbackStr);      % Dmax label   btnNumber=7;   yPos=menutop-(btnNumber-1)*(btnHt+spacing);   top = yPos - btnHt - spacing;   labelWidth = frmWidth-textWidth-.01;   labelBottom=top-textHeight;   labelLeft = left;   labelPos = [labelLeft labelBottom labelWidth textHeight];   h = uicontrol( ...      'Style','text', ...      'Units','normalized', ...      'Position',labelPos, ...      'Horiz','left', ...      'String','Dmax', ...      'Interruptible','off', ...      'BackgroundColor',[0.5 0.5 0.5], ...      'ForegroundColor','white');      % set Dmax   textPos = [labelLeft+labelWidth-.015 labelBottom textWidth+.025 textHeight];   callbackStr = 'pertone(''setDmax'')';   str = sprintf('35');   mat = [35];   DmaxHndl = uicontrol( ...      'Style','edit', ...      'Units','normalized', ...      'Position',textPos, ...      'Max',1, ...       'Horiz','right', ...      'Background','white', ...      'Foreground','black', ...      'String',str,'Userdata',mat, ...      'callback',callbackStr);      % input power label   btnNumber=8;   yPos=menutop-(btnNumber-1)*(btnHt+spacing);   top = yPos - btnHt - spacing;   labelWidth = frmWidth-textWidth-.01;   labelBottom=top-textHeight;   labelLeft = left;   labelPos = [labelLeft labelBottom labelWidth textHeight];   h = uicontrol( ...      'Style','text', ...      'Units','normalized', ...      'Position',labelPos, ...      'Horiz','left', ...      'String','Input power (dBm)', ...      'Interruptible','off', ...      'BackgroundColor',[0.5 0.5 0.5], ...      'ForegroundColor','white');      % set input power   textPos = [labelLeft+labelWidth-.015 labelBottom textWidth+.025 textHeight];   callbackStr = 'pertone(''setPwr'')';   str = sprintf('23');   mat = [23];   PwrHndl = uicontrol( ...      'Style','edit', ...      'Units','normalized', ...      'Position',textPos, ...      'Max',1, ...       'Horiz','right', ...      'Background','white', ...      'Foreground','black', ...      'String',str,'Userdata',mat, ...      'callback',callbackStr);      % AWGN power label   btnNumber=9;   yPos=menutop-(btnNumber-1)*(btnHt+spacing);   top = yPos - btnHt - spacing;   labelWidth = frmWidth-textWidth-.01;   labelBottom=top-textHeight;   labelLeft = left;   labelPos = [labelLeft labelBottom labelWidth textHeight];   h = uicontrol( ...      'Style','text', ...      'Units','normalized', ...      'Position',labelPos, ...      'Horiz','left', ...      'String','AWGN pow (dBm/Hz)', ...      'Interruptible','off', ...      'BackgroundColor',[0.5 0.5 0.5], ...      'ForegroundColor','white');      % set AWGN power   textPos = [labelLeft+labelWidth-.015 labelBottom textWidth+.025 textHeight];   callbackStr = 'pertone(''setAWGN'')';   str = sprintf('-140');   mat = [-140];   AWGNHndl = uicontrol( ...      'Style','edit', ...      'Units','normalized', ...      'Position',textPos, ...      'Max',1, ...       'Horiz','right', ...      'Background','white', ...      'Foreground','black', ...      'String',str,'Userdata',mat, ...      'callback',callbackStr);      % channel number label   btnNumber=10;   yPos=menutop-(btnNumber-1)*(btnHt+spacing);   top = yPos - btnHt - spacing;   labelWidth = frmWidth-textWidth-.01;   labelBottom=top-textHeight;   labelLeft = left;   labelPos = [labelLeft labelBottom labelWidth textHeight];   h = uicontrol( ...      'Style','text', ...      'Units','normalized', ...      'Position',labelPos, ...      'Horiz','left', ...      'String','CSA loop # (1-8)', ...      'Interruptible','off', ...      'BackgroundColor',[0.5 0.5 0.5], ...      'ForegroundColor','white');      % set channel number   textPos = [labelLeft+labelWidth-.015 labelBottom textWidth+.025 textHeight];   callbackStr = 'pertone(''setCSA'')';   str = sprintf('1');   mat = [1];   CSAHndl = uicontrol( ...      'Style','edit', ...      'Units','normalized', ...      'Position',textPos, ...      'Max',1, ...       'Horiz','right', ...      'Background','white', ...      'Foreground','black', ...      'String',str,'Userdata',mat, ...      'callback',callbackStr);         % graphic selection menu   labelStr=['SNR & MFB'...         '|Noise Power Spectrum'];   callbackStr='pertone(''plotGraph'');';   mat = 1;   viewHndl=uicontrol( ...      'Style','popupmenu', ...      'Units','normalized', ...      'Position',[left frmBottom+2*(btnHt+spacing) btnWid btnHt], ...      'String',labelStr,'Userdata',mat, ...      'Interruptible','on', ...      'Callback',callbackStr);      % help button   labelStr='Info';   callbackStr='pertone(''info'')';   helpHndl=uicontrol( ...      'Style','pushbutton', ...      'Units','normalized', ...      'Position',[left frmBottom+btnHt+spacing btnWid btnHt], ...      'String',labelStr, ...      'Callback',callbackStr);      % run button   labelStr='Calculate';   callbackStr='pertone(''design'')';   closeHndl=uicontrol( ...      'Style','pushbutton', ...      'Units','normalized', ...      'Position',[left frmBottom btnWid btnHt], ...      'String',labelStr, ...      'Callback',callbackStr);      % put all handles in userdata of the parent object   fhndlList=[freqzHnd TGHndl NwHndl NHndl CGHndl MarginHndl ...         DminHndl DmaxHndl PwrHndl AWGNHndl CSAHndl viewHndl ...         helpHndl closeHndl methodHndl h11 h21 h31 h41 h51 h61];   set(figNumber, ...      'Visible','on', ...      'UserData',fhndlList);      drawnow   axes(freqzHnd)   set(freqzHnd,'Userdata',[])   pertone('design')   set(gcf,'Pointer','arrow','handlevisibility','callback');   set(0,'showHiddenHandles',shh)   return         % change method elseif strcmp(action,'changemethod'),   v = get(gco,'value');     % 1=MMSE-UEC,2=MMSE-UTC,3=MSSNR,4=GEO,5=min-ISI,6=MBR,7=DCC,8=DCM,9=MP,   % 10=MMP, 11=Eig-App 12=ARMA   set(gco,'userdata',v);   return      % set TGelseif strcmp(action,'setTG'),   hndlList=get(gcf,'Userdata');   tg = get(hndlList(2),'userdata');   meth = get(hndlList(15),'value');   v = get(gco,'Userdata');   s = get(gco,'String');   vv = eval(s,num2str(v(1)));   % do not allow tg<1 or tg>256   if vv < 1 | vv >256      vv = v;   end   set(gco,'Userdata',vv,'String',num2str(vv));   return      % set Nwelseif strcmp(action,'setNw'),   hndlList=get(gcf,'Userdata');   nw = get(hndlList(3),'userdata');   meth = get(hndlList(15),'value');   v = get(gco,'Userdata');   s = get(gco,'String');   vv = eval(s,num2str(v(1)));   % do not allow Nw<1    if vv <= 1       vv = v;   end   set(gco,'Userdata',vv,'String',num2str(vv))   return      % set coding gain   elseif strcmp(action,'setCG'),   hndlList=get(gcf,'Userdata');   v = get(gco,'Userdata');   s = get(gco,'String');   vv = eval(s,num2str(v(1)));   % do not allow negative coding gain    if vv < 0,       vv = v; 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -