实例介绍
【实例截图】
【核心代码】
% The DFEcator % General Information % =================== % The DFEcator is a tool for design of minimum mean square error (MMSE) and % adaptive decision feedback equalizers (DFE) based on % The Bergulator (refer to http://www.backhoe.ee.cornell.edu/BERG). Both % baud-spaced equalizers (BS) and T/2 fractionally-spaced (FS) DFEs may be % designed to equalize complex, additive white gaussian noise channels (AWGN) % for various choices of parameters. For MMSE designs some of these choices % include: % % * channel (coefficients, source and SNR) % * forward and feedback filter lengths % OR total number of coefficients % * cursor delay (for non-blind equalization) % * processing delay (delay required for processing decisions before they % are sent to the feedback filter) % * bias % % For adaptive designs, we also have: % % * forward and feedback filter initializations % * adaptive algorithm (LMS, decision-direction, CMA) for both linear IIR % and DFE structures % * forward and feedback filter step-size % % Figures displaying information about the designs may be accessed through % toggle buttons on the left side of the screen. Variables containing % results of designs and experiments may be accessed by typing % % dfec_global % % at the Matlab prompt. Type % % help dfec_global % % for a description of each variable. % % % There are four main pieces of The DFEcator: channel, equalizer and % adaptation parameter boxes, and action buttons. A brief description of % each follows: % % % CHANNEL PARAMETERS % ================== % "Channel Type" % -------------- % * "8-tap" and "3-tap" select demonstration channels. % * "Custom" allows typing in channel taps in the % editing box or typing the name of a variable % residing in the Matlab workspace. % WARNING: avoid using variable names which are % global to The DFEcator. Check for the % list of variables by typing "dfec_global" % and using the "who" command % * "File" allows typing in the name of a .mat file % containing the vector "c" of channel coefficients. % % % "Source" % -------- % Includes several real and complex valued sources of several sizes, % i.e. PAM, QAM % % % "dB SNR" % -------- % * Enter signal to noise ratio in dBs. % * Type "Inf" for no noise. % * Can type range of SNRs, e.g. 10:2:20 for SER vs. SNR waterfall curves % Figures display results of MMSE design for the highest value of the SNR % vector. % % % "Normalize" % ----------- % * Normalizes channel to unit (l_2) norm when toggled on. % % % "Display" % --------- % * Displays channel impulse and frequency responses when toggled on. % % % % EQUALIZER PARAMETERS % ==================== % "Nf Nd or [Nf,Nd]" % ------------------ % * Type [Nf Nd] for length of forward and feedback filters, % e.g. [4 3] for a length Nf=4 forward filter and % length Nd=3 feedback filter. % * Type single integer M for a total number of parameters. % The DFEcator will compute all possible MMSE designs for each % combination [Nf Nd] (over other parameters such as SNR and delay) % such that Nf Nd=M. % * If the Nf Nd format is used adaptation capabilities are turned % off since filter lengths are unspecified. % % % "Cursor Delay" % -------------- % * "Opt" optimizes MMSE design over every possible cursor delay choice. % * "Max" swith matches cursor to maximum channel tap. % * "Center Spike" computes transmission delay as sum of delays introduced % by largest channel tap and a center spike in forward filter tap delay % line % * "End" computes the transmission delay as sum of delays introduced % by largest channel tap and a spike at the end of forward filter % tap delay line % * "Range" allows selection of range of delays in the "Range" edit box. % % % "Spacing" % --------- % Switches between baud- ("BSE") and T/2 fractionally-spaced ("FSE") % channels/equalizers. % % % "Unbiased" % ---------- % Switch between biased ("Biased") and unbiased ("Unbiased") designs. % An unbiased design constrains the MMSE cursor to unity while a biased design % minimizes MSE without constraints. % % % "Proc. Delay" % ------------- % Processing time required to make decisions on symbols. Must be greater % than zero. The default is one (1) baud interval. % % % % ADAPTATION PARAMETERS % ===================== % "Initialization" % ---------------- % * "Zero" sets initial forward and feedback filters to zero. % * "Center spike" sets initial forward equalizer to have a single, center % spike and feedback filter to zero. % * "Double spike" sets initial forward equalizer to have double, center % spikes and feedback filter to zero. % * "DFE-MMSE" sets filters to MMSE-DFE design filters. The "Design!" button % should be pressed in advance to compute these filters. % * "IIR-MMSE" sets filters to linear truncated Wiener filters. Filter % lengths are changed to a feedback filter matching the channel memory % and a forward filter which is at least as long as the channel memory % * "End spike" sets initial forward equalizer to have a single % spike at the end of the tap-delay line and feedback filter is set to zero. % * "Previous" sets filters to the final settings of the previous adaptation. % * "Custom" allows typing in the edit boxes "f0" and "d0" initial % coefficients or variable names residing in the Matlab workspace. % WARNING: avoid using variable names which are % global to The DFEcator. Check for the % list of variables by typing "dfec_global" % and using the "who" command % * "From file" allows typing in a .mat file containing variables f0 for % forward filter taps and d0 for feedback filter taps. % % % "Algorithm" % ----------- % * "DFE-LMS" uses the least mean squares algorithm with training sequence % delayed by the choice of delay in the EQUALIZER PARAMETERS box to update % the DFE structure. % * "DFE-DD" uses decision direction to update DFE structure with training % and blind data. % * "DFE-CMA" uses the constant modulus algorithm to update DFE structure using % training and blind data. % * "DFE-LMS DD" uses LMS during training and decision-direction in blind mode. % * "DFE-LMS CMA" uses LMS during training and CMA in blind mode. % * "IIR-LMS" adapts forward and linear AR feedback filters with training % and LMS. % * "IIR-DD" adapts forward and linear AR feedback filters with % decision direction. % * "IIR-CMA" adapts forward and linear AR feedback filters with CMA. % * "IIR-LMS DD" uses LMS during training and decision-direction in blind mode. % * "IIR-LMS CMA" uses LMS during training and CMA in blind mode. % % "Exact gradient" % ---------------- % * Toggle on to use an exact gradient during IIR adaptation and off % to use Feintuch updates. Has no effect during DFE adaptation. % % % "[Tr,Bl,Reps] or file" % ---------------------- % * Format of transmitted sequence or file name. If internal data used, % "Tr" sets the length of a training block, "Bl" sets the length of a % blind data block and "Reps" sets how many of these training and data % blocks will be transmitted. If external data used, type in % .mat file as detailed below in "Data". % % % "Data" % ------ % * "Simulation" creates "Reps" different blocks of training and blind data. % * "Sim. - Loops" repeats first block of training and blind data "Reps" times. % * "From file" - allows user to type in name of a .m file with blind and % training data. Requires variables: % o column vector "a" with source symbols % o column vector "r" of received T-spaced data for BSE case and % two column vectors "ra" and "rb" of received T-spaced data % for FSE case % o row vector "Lsim" with three entries [Tr,Bl,Reps] % % % % "Stepsize [Tr,Bl]" % ------------------ % * For each filter, enter a pair of stepsizes, i.e. [muf1,muf2] and % [mud1,mud2]. The first entry indicates the stepsize used during % trained mode and the second entry is for blind mode. % * Enter 0 if a particular filter should stay fixed in time. % % % % ACTION BUTTONS % ============== % "Design!" % --------- % Press button to update design once a set of parameters is selected. % If a wide range of parameters is selected (for example, optimization over % a large total number of filter coefficients and choice of delay and many % SNRs) computations may be intensive and require a long time. NOTE: for % this reason, figures are NOT updated automatically once parameters are % changed. They are only update once "Design!" is pressed and parameters % are recalculated. % % % "MMSE Imp" % ---------- % Impulse responses of filters and combinations of filters and channel. % % % "MMSE Freq" % ----------- % Frequency responses of filters and combinations of filters and channel. % % % "MSE vs. Params" % ---------------- % Figure plots MSE vs. filter length & delay parameters. Three different % plots may be displayed according to settings: % % * If the filter length choice is set to Nf Nd=M and a range of delays % is selected with the "Range" or the "Opt" options the "MSE vs. Params" % figure is a three-dimensional surface of MSEs over (Nf,delay) parameter % space (1<=Nf<=M). The third parameter, Nd, may be derived from Nd=M-Nf. % The mouse can be used to rotate the surface for better views. % % * If the format [Nf Nd] is used for filter lengths, and a range of delays is % selected with the "Range" or the "Opt" options the "MSE vs. Params" % figure is a curve of MSE for each possible delay. % % * If the filter length choice is set to Nf Nd=M but the cursor delay is % set to "Max" (matching the channel cursor) then a curve of MSE is % plotted for each Nf, 1<=Nf<=M. % % Note that these figures are plotted for the highest value of the SNR. % % % "MMSE Cluster" % -------------- % Cluster plot of MMSE design (optimized over all parameters) for selected % source and (highest) SNR. % % % "Error Propagation" % ------------------- % Hard and soft decision errors as well as noise filtered through % forward equalizer for 1000 transmitted symbols for MMSE design (optimized % over all parameters) for selected source and (highest) SNR. % Zooming is set on by default. To move the legends around turn zoom off % by typing "zoom off" at the Matlab prompt. % % % "SER Curves" % ------------ % Symbol error rate (SER) vs. SNR for MMSE design (optimized % over all parameters) for selected source and (highest) SNR. % % % "Adapt!" % -------- % Adapts filters using choice of algorithm, step-sizes, duration and % initialization. % % % "Trajectories" % -------------- % Displays evolution of filter taps over time. % % % "Adaptation Error" % ------------------ % Displays adaptation error associated with particular choice of algorithm. % Certain algorithms have separate error criteria for feedforward and % feedback filters. % % % % "Ad. Clus." % ------------------ % Evolution of (adaptation) cluster plot in time. % % % "Fin. Clus." % ------------------ % Cluster plot associated with final equalizer. % % % "Final Imp" % ------------------ % Impulse responses of filters and combinations of filters and channel % resulting from adaptation. % % % "Final Freq" % ------------------ % Frequency responses of filters and combinations of filters and channel % resulting from adaptation. % % % "Help" % ------------------ % Helps. % % % "Quit" % ------------------ % Quits. % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% The DFEcator written by: Raul A. Casas % %% raulc@ee.cornell.edu % %% Blind Equalization Research Group % %% (http://backhoe.ee.cornell.edu/BERG/) % %% Cornell University % %% February 1998 % %% % %% Copyright 1998-2000 Cornell University % %% % %% last updated 03/30/99 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [] = DFEcator(); dfec_global; ui_private_global; % Advise use of dfec_global to look % at variables disp('Type "dfec_global" at prompt to look at design variables'); disp('(use "who" command). Type "help dfec_global for descriptions.'); %%%%%%%%%%%%%%%%%%% % Declare figures % %%%%%%%%%%%%%%%%%%% % Declare output figure numbers and clear them fig_chan = 1; fig_freq = 2; fig_imp = 3; fig_mse = 4; fig_ser = 5; fig_cluster = 6; fig_ep = 7; fig_fimp = 8; fig_ffreq = 9; fig_acluster = 10; fig_fcluster = 11; fig_aerr = 12; fig_traj = 13; if ishandle(fig_imp), delete(fig_imp); end; if ishandle(fig_freq), delete(fig_freq); end; if ishandle(fig_mse), delete(fig_mse); end; if ishandle(fig_ser), delete(fig_ser); end; if ishandle(fig_cluster), delete(fig_cluster); end; if ishandle(fig_ep), delete(fig_ep); end; if ishandle(fig_chan), delete(fig_chan); end; if ishandle(fig_fimp), delete(fig_fimp); end; if ishandle(fig_ffreq), delete(fig_ffreq); end; if ishandle(fig_acluster), delete(fig_acluster); end; if ishandle(fig_fcluster), delete(fig_fcluster); end; if ishandle(fig_aerr), delete(fig_aerr); end; if ishandle(fig_traj), delete(fig_traj); end; %%%%%%%%%%%%%%%%%%%%%%%%%%% % Allocate control window % %%%%%%%%%%%%%%%%%%%%%%%%%%% if exist('fig_menu'), if ishandle(fig_menu), delete(fig_menu); end; end; fig_menu = figure('IntegerHandle', 'off', 'Name', 'The DFEcator',... 'NumberTitle', 'off', 'MenuBar', 'none', 'Resize', 'off'); pos = get(fig_menu, 'Position'); set(fig_menu, 'Position', [pos(1) 100 pos(2)-300 440 720]); clf; %%%%%%%%%%%%%%%%%%%%%% % Channel Parameters % %%%%%%%%%%%%%%%%%%%%%% uicontrol('Style', 'frame', 'Position',[170 500 250 200]); uicontrol('Style', 'text', 'Position', [180 670 160 20], 'String',... 'CHANNEL PARAMETERS'); uicontrol('Style', 'text', 'Position', [180 640 100 20], 'String',... 'Channel Type'); h_chan = uicontrol('Style', 'popupmenu', 'Position', [180 620 100 20],... 'String', '8-tap|3-tap|Custom|From file',... 'Callback', 'ui_params,ui_chan'); uicontrol('Style', 'text', 'Position', [180 580 100 25], 'String',... 'Coefficients'); h_coefs = uicontrol('Style', 'edit', 'Position', [180 560 140 25],... 'BackgroundColor', [1 1 1], 'Callback',... 'ui_params,ui_chan'); h_norm = uicontrol('Style', 'checkbox', 'Position', [180 520 100 20],... 'String', 'Normalize', 'Value', 1, 'Callback',... 'ui_params,ui_chan'); h_resp = uicontrol('Style', 'checkbox', 'Position', [330 520 80 20],... 'String', 'Display', 'Callback', 'ui_chan'); uicontrol('Style', 'text', 'Position', [330 640 75 25], 'String',... 'Source'); h_source = uicontrol('Style', 'popupmenu', 'Position', [330 620 85 20],... 'String',... ['BPSK|4-PAM|8-PAM|16-PAM|32-PAM|QPSK',... '|16-QAM|64-QAM|256-QAM|1024-QAM'],... 'Callback', 'ui_params'); uicontrol('Style', 'text', 'Position', [340 580 50 25 ], 'String', 'dB SNR'); h_SNR = uicontrol('Style', 'edit', 'Position', [340 560 50 25],... 'String', '30', 'BackgroundColor', [1 1 1],... 'Callback', 'ui_params'); %%%%%%%%%%%%%%%%%%%%%%%% % Equalizer Parameters % %%%%%%%%%%%%%%%%%%%%%%%% uicontrol('Style', 'frame', 'Position', [170 280 250 200]); uicontrol('Style', 'text', 'Position', [180 450 180 20], 'String',... 'EQUALIZER PARAMETERS'); uicontrol('Style', 'text', 'Position', [180 420 100 25], 'String',... 'Nf Nd or [Nf,Nd]'); h_len = uicontrol('Style', 'edit', 'Position', [180 400 100 25],... 'String', '[32 8]', 'BackgroundColor', [1 1 1],... 'Callback', 'ui_params'); uicontrol('Style', 'text', 'Position', [180 370 80 20], 'String', 'Spacing'); h_spa = uicontrol('Style', 'popupmenu', 'Position', [180 350 80 20],... 'String', 'BSE|FSE', 'Callback', 'ui_params,ui_chan'); h_bias = uicontrol('Style', 'checkbox', 'Position', [180 300 80 20],... 'String', 'Unbiased', 'Callback', 'ui_params'); uicontrol('Style', 'text', 'Position', [330 420 80 20], 'String',... 'Cursor Delay'); h_deltype = uicontrol('Style', 'popupmenu', 'Position', [330 400 80 20],... 'String', 'Opt|Max|End|Center Spike|Range',... 'Callback', 'ui_params'); uicontrol('Style', 'text', 'Position', [330 370 80 20], 'String', 'Range'); h_del = uicontrol('Style', 'edit', 'Position', [330 350 80 25],... 'BackgroundColor', [1 1 1], 'String', '1',... 'Callback', 'ui_params'); uicontrol('Style', 'text', 'Position', [330 320 80 20], 'String',... 'Proc. Delay'); h_proc = uicontrol('Style', 'edit', 'Position', [330 300 60 25],... 'BackgroundColor', [1 1 1], 'String', '1',... 'Callback', 'ui_params'); %%%%%%%%%%%%%%%%%%%%%%%%% % Adaptation Parameters % %%%%%%%%%%%%%%%%%%%%%%%%% uicontrol('Style', 'frame', 'Position', [170 20 250 240]); uicontrol('Style', 'text', 'Position', [180 230 180 20], 'String',... 'ADAPTATION PARAMETERS'); uicontrol('Style', 'text', 'Position', [180 205 110 20], 'String',... 'Algorithm'); h_alg = uicontrol('Style', 'popupmenu', 'Position', [180 185 110 20],... 'String', ['DFE-LMS|DFE-DD|DFE-CMA|DFE-LMS DD|DFE-LMS CMA|IIR-LMS|IIR-DD|IIR-CMA|IIR-LMS DD|IIR-LMS CMA'],'Callback', 'ui_params'); h_reg = uicontrol('Style', 'checkbox', 'Position', [300 185 100 20],... 'String', 'Exact gradient', 'Value', 1, 'Callback',... 'ui_params,ui_chan'); uicontrol('Style', 'text', 'Position', [180 145 75 20], 'String',... 'Initialization'); h_init = uicontrol('Style', 'popupmenu', 'Position', [180 125 75 20],... 'String', ['Zero|Center Spike|Double Spike|DFE-MMSE|IIR-MMSE|End Spike|Previous|Custom|From file'], 'Callback', 'ui_params'); uicontrol('Style', 'text', 'Position', [255 145 40 20], 'String',... 'f0'); h_f0 = uicontrol('Style', 'edit', 'Position', [285 145 120 25],... 'BackgroundColor', [1 1 1],... 'Callback', 'ui_params'); uicontrol('Style', 'text', 'Position', [255 125 40 20], 'String',... 'd0'); h_d0 = uicontrol('Style', 'edit', 'Position', [285 125 120 25],... 'BackgroundColor', [1 1 1],... 'Callback', 'ui_params'); uicontrol('Style', 'text', 'Position', [180 80 30 20], 'String',... 'Data'); h_data = uicontrol('Style', 'popupmenu', 'Position', [215 85 90 20],... 'String', ['Simulation|Sim.-Loops|From file'],... 'Callback', 'ui_params'); uicontrol('Style', 'text', 'Position', [180 55 120 20], 'String',... '[Tr,Bl,Reps] or file'); h_sim = uicontrol('Style', 'edit', 'Position', [180 30 120 25],... 'String', '[100 900 10]', 'BackgroundColor', [1 1 1],... 'Callback', 'ui_params'); uicontrol('Style', 'text', 'Position', [330 70 80 20], 'String',... 'Stepsize [Tr,Bl]'); uicontrol('Style', 'text', 'Position', [300 45 30 20], 'String',... 'muf'); h_muf = uicontrol('Style', 'edit', 'Position', [330 45 80 25],... 'String', '[1e-2,0]', 'BackgroundColor', [1 1 1],... 'Callback', 'ui_params'); uicontrol('Style', 'text', 'Position', [300 25 30 20], 'String',... 'mud'); h_mud = uicontrol('Style', 'edit', 'Position', [330 25 80 25],... 'String', '[1e-2,0]', 'BackgroundColor', [1 1 1],... 'Callback', 'ui_params'); %%%%%%%%%%%%%%%%% % Text messages % %%%%%%%%%%%%%%%%% h_msg = uicontrol('Style', 'text', 'Position', [10 20 140 20],... 'BackgroundColor', [0.8 0.8 0.8], 'String',... 'click a button...'); %%%%%%%%%%%%%%%%%% % Action Buttons % %%%%%%%%%%%%%%%%%% h_design = uicontrol('Style', 'pushbutton', 'Position', [20 670 130 30],... 'Callback', 'ui_design', 'String', 'Design!'); h_imp = uicontrol('Style', 'checkbox', 'Position', [20 630 130 30],... 'Callback', 'ui_imp', 'String', 'MMSE Imp'); h_freq = uicontrol('Style', 'checkbox', 'Position', [20 590 130 30],... 'Callback', 'ui_freq', 'String', 'MMSE Freq'); h_mse = uicontrol('Style', 'checkbox', 'Position', [20 550 130 30],... 'Callback', 'ui_mse', 'String', 'MSE vs Params'); h_cluster = uicontrol('Style', 'checkbox', 'Position', [20 510 130 30],... 'Callback', 'ui_cluster', 'String', 'MMSE Cluster'); h_ep= uicontrol('Style', 'checkbox', 'Position', [20 470 130 30],... 'Callback', 'ui_ep', 'String', 'Error Propagation'); h_ser = uicontrol('Style', 'checkbox', 'Position', [20 430 130 30],... 'Callback', 'ui_ser', 'String', 'SER Curves'); h_adapt = uicontrol('Style', 'pushbutton', 'Position', [20 320 130 30],... 'Callback', 'ui_adapt', 'String', 'Adapt!'); h_traj = uicontrol('Style', 'checkbox', 'Position', [20 280 130 30],... 'Callback', 'ui_traj', 'String', 'Trajectories'); h_aerr = uicontrol('Style', 'checkbox', 'Position', [20 240 130 30],... 'Callback', 'ui_aerr', 'String', 'Adaptation Error'); h_acluster = uicontrol('Style', 'checkbox', 'Position', [20 200 60 30],... 'Callback', 'ui_acluster', 'String', 'Ad. Clus.'); h_fcluster = uicontrol('Style', 'checkbox', 'Position', [90 200 60 30],... 'Callback', 'ui_fcluster', 'String', 'Fin. Clus.'); h_fimp = uicontrol('Style', 'checkbox', 'Position', [20 160 130 30],... 'Callback', 'ui_fimp', 'String', 'Final Imp'); h_ffreq = uicontrol('Style', 'checkbox', 'Position', [20 120 130 30],... 'Callback', 'ui_ffreq', 'String', 'Final Freq'); h_help = uicontrol('Style', 'pushbutton', 'Position', [20 70 60 30],... 'Callback', 'helpwin dfecator', 'String', 'Help'); h_quit = uicontrol('Style', 'pushbutton', 'Position', [90 70 60 30],... 'Callback', 'ui_quit', 'String', 'Quit'); set(fig_menu, 'HandleVisibility', 'off'); ui_params; ui_design;
标签: MATLAB
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论