📄 paramsetting.m
字号:
function ParamSetting(action,varargin)
%
%
%
%
if nargin<1,
action = 'Initialized';
end
feval(action,varargin{:});
return
% ---------------------------------
% subfunction initialized.
% ---------------------------------
function Initialized()
h = findobj(allchild(0),'tag','Digital Communication Analysis');
if isempty(h),
msgbox('Could not run independently, run the main program first.', ...
'ERROR','ERROR');
return
end
TxParamSet.IFcarrier.freq = 10000000;
TxParamSet.IFcarrier.phase = 0;
TxParamSet.IFcarrier.Fs = 40000000;
TxParamSet.IFcarrier.Fd = 4800;
TxParamSet.ModBaseband.method = 'CP4FSK';
TxParamSet.ModBaseband.nSamp = 8;
TxParamSet.ModBaseband.freq_sep = 648;
TxParamSet.ModBaseband.M = 4;
TxParamSet.ModBaseband.h = 0.27;
TxParamSet.ModBaseband.Fd = 4800;
TxParamSet.LPF.order = 64;
TxParamSet.LPF.coef = [0.0096726 0.0057896 1.2411e-017 -0.0068107 ...
-0.013412 -0.018426 -0.020583 -0.018986 -0.01334 ...
-0.0040989 0.0075169 0.019639 0.030011 0.036345 ...
0.036749 0.030121 0.016471 -0.0029127 -0.025484 ...
-0.047673 -0.065313 -0.074197 -0.070711 -0.052426 ...
-0.018578 0.029666 0.089193 0.1552 0.22172 0.28228 ...
0.33075 0.36205 0.37287 0.36205 0.33075 0.28228 0.22172 ...
0.1552 0.089193 0.029666 -0.018578 -0.052426 ...
-0.070711 -0.074197 -0.065313 -0.047673 -0.025484 ...
-0.0029127 0.016471 0.030121 0.036749 0.036345 ...
0.030011 0.019639 0.0075169 -0.0040989 -0.01334 ...
-0.018986 -0.020583 -0.018426 -0.013412 -0.0068107 ...
1.2411e-017 0.0057896 0.0096726
];
TxParamSet.RRC.order = 64;
TxParamSet.RRC.coef = [];
PShdl.TxParamSet = TxParamSet;
hh = findobj(allchild(0), 'tag', 'Parameter Setting');
if ~isempty(hh)
figure(hh);
return
end
hdl = get(h,'UserData');
screenD = get(0, 'ScreenDepth');
if screenD>8
grayres=256;
else
grayres=128;
end
ParamSetFig = figure(...
'Name','Parameter Setting', ...
'NumberTitle','off', 'HandleVisibility', 'on', ...
'tag', 'Parameter Setting', ...
'Visible','on', 'Resize', 'off',...
'BusyAction','Queue','Interruptible','off', ...
'Menubar', 'none', ...
'Color', hdl.Envi.bckgrdColor, ...
'IntegerHandle', 'off', 'Units', 'normalized', ...
'DoubleBuffer', 'on', 'Position', [.25 .24 .5 .43], ...
'Colormap', gray(grayres));
PShdl.mainpanel = uipanel(...
'parent', ParamSetFig, ...
'Units', 'normalized', ...
'Position', [0.02 0.1 0.96 0.86], ...
'BorderType', 'beveledout', ...
'BackgroundColor', hdl.Envi.bckgrdColor+0.09);
uicontrol(...
'parent', ParamSetFig, ...
'style', 'text', ...
'Units', 'normalized', ...
'position', [0.2 0.03 0.6 0.04], ...
'backgroundcolor', hdl.Envi.bckgrdColor, ...
'foregroundcolor', [0.321 0.321 0.321], ...
'fontsize', 8.0 , ...
'string', 'Written by harlemon. harlemon@126.com.');
strList = 'RF Carrier|Modulate Baseband|Lowpass Filter|Pluse Shape Filter';
PShdl.listbox = uicontrol(...
'parent', PShdl.mainpanel, ...
'Style', 'listbox', ...
'Units', 'normalized', ...
'Position', [0.05 0.25 0.3 0.7], ...
'String', strList, ...
'backgroundcolor', hdl.Envi.bckgrdColor, ...
'fontsize', hdl.Envi.fontSize, ...
'callback', 'ParamSetting(''listbox_callback'')');
PShdl.slider = uicontrol(...
'parent', PShdl.mainpanel, ...
'Style', 'slider', ...
'Units', 'normalized', ...
'Position', [0.92 0.25 0.035 0.7], ...
'String', strList, ...
'enable', 'off');
PShdl.panel1 = uipanel(...
'parent', PShdl.mainpanel, ...
'Units', 'normalized', ...
'Position', [0.45 0.836 0.475 0.105], ...
'BorderType', 'etchedin', ...
'BackgroundColor', hdl.Envi.bckgrdColor+0.09);
PShdl.carryfrqEdit = uicontrol(...
'parent', PShdl.mainpanel, ...
'Style', 'edit', ...
'Units', 'normalized', ...
'Position', [0.725 0.845 0.19 0.09], ...
'String', '1000', ...
'fontsize', hdl.Envi.fontSize);
PShdl.carryfrqLabel = uicontrol(...
'Parent', PShdl.mainpanel, ...
'Style', 'text', ...
'Units', 'normalized', ...
'Position', [0.46 0.86 0.25 0.06], ...
'String', 'Carrier Freq (kHz) :', ...
'fontsize', hdl.Envi.fontSize, ...
'backgroundColor', hdl.Envi.bckgrdColor+0.09, ...
'HorizontalAlignment', 'right');
PShdl.panel2 = uipanel(...
'parent', PShdl.mainpanel, ...
'Units', 'normalized', ...
'Position', [0.45 0.736 0.475 0.105], ...
'BorderType', 'etchedin', ...
'BackgroundColor', hdl.Envi.bckgrdColor+0.09);
PShdl.carryPhaseEdit = uicontrol(...
'parent', PShdl.mainpanel, ...
'Style', 'edit', ...
'Units', 'normalized', ...
'Position', [0.725 0.745 0.19 0.09], ...
'String', '0', ...
'fontsize', hdl.Envi.fontSize);
PShdl.carryPhaseLabel = uicontrol(...
'Parent', PShdl.mainpanel, ...
'Style', 'text', ...
'Units', 'normalized', ...
'Position', [0.46 0.76 0.25 0.06], ...
'String', 'Carrier Phase (rad) :', ...
'fontsize', hdl.Envi.fontSize, ...
'backgroundColor', hdl.Envi.bckgrdColor+0.09, ...
'HorizontalAlignment', 'right');
PShdl.panel3 = uipanel(...
'parent', PShdl.mainpanel, ...
'Units', 'normalized', ...
'Position', [0.45 0.636 0.475 0.105], ...
'BorderType', 'etchedin', ...
'BackgroundColor', hdl.Envi.bckgrdColor+0.09);
PShdl.FsEdit = uicontrol(...
'parent', PShdl.mainpanel, ...
'Style', 'edit', ...
'Units', 'normalized', ...
'Position', [0.725 0.645 0.19 0.09], ...
'String', '4000', ...
'fontsize', hdl.Envi.fontSize);
PShdl.FsLabel = uicontrol(...
'Parent', PShdl.mainpanel, ...
'Style', 'text', ...
'Units', 'normalized', ...
'Position', [0.46 0.66 0.25 0.06], ...
'String', 'Sample Rate (kHz) :', ...
'fontsize', hdl.Envi.fontSize, ...
'backgroundColor', hdl.Envi.bckgrdColor+0.09, ...
'HorizontalAlignment', 'right');
PShdl.panel4 = uipanel(...
'parent', PShdl.mainpanel, ...
'Units', 'normalized', ...
'Position', [0.45 0.538 0.475 0.105], ...
'BorderType', 'etchedin', ...
'BackgroundColor', hdl.Envi.bckgrdColor+0.09);
PShdl.FdEdit = uicontrol(...
'parent', PShdl.mainpanel, ...
'Style', 'edit', ...
'Units', 'normalized', ...
'Position', [0.725 0.545 0.19 0.09], ...
'String', '4.8', ...
'fontsize', hdl.Envi.fontSize);
PShdl.FdLabel = uicontrol(...
'Parent', PShdl.mainpanel, ...
'Style', 'text', ...
'Units', 'normalized', ...
'Position', [0.46 0.56 0.25 0.06], ...
'String', 'Symbol Rate (kHz) :', ...
'fontsize', hdl.Envi.fontSize, ...
'backgroundColor', hdl.Envi.bckgrdColor+0.09, ...
'HorizontalAlignment', 'right');
PShdl.panel5 = uipanel(...
'parent', PShdl.mainpanel, ...
'Units', 'normalized', ...
'Position', [0.45 0.440 0.475 0.105], ...
'BorderType', 'etchedin', ...
'BackgroundColor', hdl.Envi.bckgrdColor+0.09);
PShdl.panel6 = uipanel(...
'parent', PShdl.mainpanel, ...
'Units', 'normalized', ...
'Position', [0.45 0.343 0.475 0.105], ...
'BorderType', 'etchedin', ...
'BackgroundColor', hdl.Envi.bckgrdColor+0.09);
PShdl.panel7 = uipanel(...
'parent', PShdl.mainpanel, ...
'Units', 'normalized', ...
'Position', [0.45 0.25 0.475 0.105], ...
'BorderType', 'etchedin', ...
'BackgroundColor', hdl.Envi.bckgrdColor+0.09);
% ------------------------------
% Modulate baseband.
% ------------------------------
PShdl.modMethodPopUp = uicontrol(...
'parent', PShdl.mainpanel, ...
'Style', 'popupmenu', ...
'Units', 'normalized', ...
'Position', [0.725 0.845 0.19 0.09], ...
'String', 'CP4FSK', ...
'fontsize', hdl.Envi.fontSize, ...
'Visible', 'off');
PShdl.modMethodLabel = uicontrol(...
'Parent', PShdl.mainpanel, ...
'Style', 'text', ...
'Units', 'normalized', ...
'Position', [0.46 0.86 0.25 0.06], ...
'String', 'Mod Method :', ...
'fontsize', hdl.Envi.fontSize, ...
'backgroundColor', hdl.Envi.bckgrdColor+0.09, ...
'HorizontalAlignment', 'right', 'Visible', 'off');
PShdl.modnSampEdit = uicontrol(...
'parent', PShdl.mainpanel, ...
'Style', 'edit', ...
'Units', 'normalized', ...
'Position', [0.725 0.745 0.19 0.09], ...
'String', '8', ...
'fontsize', hdl.Envi.fontSize, 'Visible', 'off');
PShdl.modnSampLabel = uicontrol(...
'Parent', PShdl.mainpanel, ...
'Style', 'text', ...
'Units', 'normalized', ...
'Position', [0.46 0.76 0.25 0.06], ...
'String', 'nSamp :', ...
'fontsize', hdl.Envi.fontSize, ...
'backgroundColor', hdl.Envi.bckgrdColor+0.09, ...
'HorizontalAlignment', 'right', 'Visible', 'off');
PShdl.modFreq_sepEdit = uicontrol(...
'parent', PShdl.mainpanel, ...
'Style', 'edit', ...
'Units', 'normalized', ...
'Position', [0.725 0.645 0.19 0.09], ...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -