📄 tfb.m
字号:
% TFB Demonstrates time domain equalizer filter bank design functions
% in the DMTTEQ Toolbox.
%
% To start the demo type "tfb".
%
% For more information use the "info" button after starting
% the demo.
%
% The algorithm is from:
% M. Milosevic, L.F.C. Pessoa, B. L. Evans, and R. Baldick, "Optimal Time
% Domain Equalization Design for Maximizing Data Rate of Discrete Multi_tone
% Systems", IEEE Trans. on Signal Proc., accepted for publication.
%
% M. Milosevic, L. F. C. Pessoa, B. L. Evans, and R. Baldick,
% "DMT Bit Rate Maximization With Optimal Time Domain Equalizer
% Filter Bank Architecture", Proc. IEEE Asilomar Conf. on Signals,
% Systems, and Computers, Nov. 3-6, 2002, vol. 1, pp. 377-382,
% Pacific Grove, CA, USA, invited paper.
%
% Copyright (c) 1999-2003 The University of Texas
% All Rights Reserved.
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% The GNU Public License is available in the file LICENSE, or you
% can write to the Free Software Foundation, Inc., 59 Temple Place -
% Suite 330, Boston, MA 02111-1307, USA, or you can find it on the
% World Wide Web at http://www.fsf.org.
%
% Programmers: Guner Arslan and Zukang Shen
% Version: @(#)tfb.m 3.0 10/17/02
%
% The authors are with the Department of Electrical and Computer
% Engineering, The University of Texas at Austin, Austin, TX.
% They can be reached at arslan@ece.utexas.edu.
% Guner Arslan is also with the Embedded Signal Processing
% Laboratory in the Dept. of ECE, http://signal.ece.utexas.edu.
function tfb(action);
if nargin < 1,
action='init';
end;
if strcmp(action,'init'),
%close all;
shh = get(0,'showHiddenHandles');
set(0,'showHiddenHandles','on')
figNumber=figure( ...
'Name','TEQ Filter Bank Design Demo', ...
'ToolBar','figure',...
'handlevisibility','callback',...
'IntegerHandle','off',...
'NumberTitle','off',...
'Position',[232 255 575 423]);
set(gcf,'Pointer','watch');
% figure parameters
labelColor=[0.8 0.8 0.8];
yInitPos=0.90;
menutop=0.97;
btnTop = 0.6;
top=0.75;
left=0.685;
btnWid=0.290;
btnHt=0.055;
textHeight = 0.04;
textWidth = 0.06;
spacing=0.005;
resWidth = 0.55;
resHeight = 0.12;
grpleft = 0.09;
grpbuttom = 0.3;
% graph axis setup
axesposition = [grpleft grpbuttom 0.55 0.65];
axes( ...
'Units','normalized', ...
'Position',axesposition, ...
'XTick',[],'YTick',[], ...
'Box','on');
set(figNumber,'defaultaxesposition',axesposition)
freqzHnd = subplot(1,1,1);
set(gca, ...
'Units','normalized', ...
'Position',axesposition, ...
'XTick',[],'YTick',[], ...
'Box','on');
% console frame setup
frmBorder=0.019; frmBottom=0.04;
frmHeight = 0.92; frmWidth = btnWid;
yPos=frmBottom-frmBorder;
frmPos=[left-frmBorder yPos frmWidth+2*frmBorder frmHeight+2*frmBorder];
h=uicontrol( ...
'Style','frame', ...
'Units','normalized', ...
'Position',frmPos, ...
'BackgroundColor',[0.5 0.5 0.5]);
% result frame setup
numColumn = 6;
numRow = 2;
border = 0.002;
tabWidth = (resWidth - (numColumn + 1) * border) / numColumn;
tabHeight = (resHeight - (numRow + 1) * border) / numRow;
resyPos = yPos+tabHeight+border;
resfrmPos=[grpleft resyPos resWidth resHeight+border];
h=uicontrol( ...
'Style','frame', ...
'Units','normalized', ...
'Position',resfrmPos, ...
'BackgroundColor',[0.5 0.5 0.5]);
% result table entries
gridNum = [1 1];
tabBottom = resyPos + border + (border+tabHeight)*(gridNum(2)-1);
tabLeft = grpleft+ border + (border+tabWidth)*(gridNum(1)-1);
tabPos = [tabLeft tabBottom tabWidth tabHeight];
h11 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',tabPos, ...
'Horiz','center', ...
'String',' ', ...
'Interruptible','off', ...
'BackgroundColor','white', ...
'ForegroundColor','black');
gridNum = [1 2];
tabBottom = resyPos+border + (border+tabHeight)*(gridNum(2)-1);
tabLeft = grpleft+ border + (border+tabWidth)*(gridNum(1)-1);
tabPos = [tabLeft tabBottom tabWidth tabHeight];
h12 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',tabPos, ...
'Horiz','center', ...
'String','Rate', ...
'Interruptible','off', ...
'BackgroundColor','white', ...
'ForegroundColor','black');
gridNum = [2 1];
tabBottom = resyPos+border + (border+tabHeight)*(gridNum(2)-1);
tabLeft = grpleft+ border + (border+tabWidth)*(gridNum(1)-1);
tabPos = [tabLeft tabBottom tabWidth tabHeight];
h21 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',tabPos, ...
'Horiz','center', ...
'String','', ...
'Interruptible','off', ...
'BackgroundColor','white', ...
'ForegroundColor','black');
gridNum = [2 2];
tabBottom = resyPos+border + (border+tabHeight)*(gridNum(2)-1);
tabLeft = grpleft+ border + (border+tabWidth)*(gridNum(1)-1);
tabPos = [tabLeft tabBottom tabWidth tabHeight];
h22 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',tabPos, ...
'Horiz','center', ...
'String','SNR', ...
'Interruptible','off', ...
'BackgroundColor','white', ...
'ForegroundColor','black');
gridNum = [3 1];
tabBottom = resyPos+border + (border+tabHeight)*(gridNum(2)-1);
tabLeft = grpleft+ border + (border+tabWidth)*(gridNum(1)-1);
tabPos = [tabLeft tabBottom tabWidth tabHeight];
h31 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',tabPos, ...
'Horiz','center', ...
'String','', ...
'Interruptible','off', ...
'BackgroundColor','white', ...
'ForegroundColor','black');
gridNum = [3 2];
tabBottom = resyPos+border + (border+tabHeight)*(gridNum(2)-1);
tabLeft = grpleft+ border + (border+tabWidth)*(gridNum(1)-1);
tabPos = [tabLeft tabBottom tabWidth tabHeight];
h32 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',tabPos, ...
'Horiz','center', ...
'String','SSNR', ...
'Interruptible','off', ...
'BackgroundColor','white', ...
'ForegroundColor','black');
gridNum = [4 1];
tabBottom = resyPos+border + (border+tabHeight)*(gridNum(2)-1);
tabLeft = grpleft+ border + (border+tabWidth)*(gridNum(1)-1);
tabPos = [tabLeft tabBottom tabWidth tabHeight];
h41 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',tabPos, ...
'Horiz','center', ...
'String','', ...
'Interruptible','off', ...
'BackgroundColor','white', ...
'ForegroundColor','black');
gridNum = [4 2];
tabBottom = resyPos+border + (border+tabHeight)*(gridNum(2)-1);
tabLeft = grpleft+ border + (border+tabWidth)*(gridNum(1)-1);
tabPos = [tabLeft tabBottom tabWidth tabHeight];
h42 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',tabPos, ...
'Horiz','center', ...
'String','MSE', ...
'Interruptible','off', ...
'BackgroundColor','white', ...
'ForegroundColor','black');
gridNum = [5 1];
tabBottom = resyPos+border + (border+tabHeight)*(gridNum(2)-1);
tabLeft = grpleft+ border + (border+tabWidth)*(gridNum(1)-1);
tabPos = [tabLeft tabBottom tabWidth tabHeight];
h51 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',tabPos, ...
'Horiz','center', ...
'String','', ...
'Interruptible','off', ...
'BackgroundColor','white', ...
'ForegroundColor','black');
gridNum = [5 2];
tabBottom = resyPos+border + (border+tabHeight)*(gridNum(2)-1);
tabLeft = grpleft+ border + (border+tabWidth)*(gridNum(1)-1);
tabPos = [tabLeft tabBottom tabWidth tabHeight];
h52 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',tabPos, ...
'Horiz','center', ...
'String','Delay', ...
'Interruptible','off', ...
'BackgroundColor','white', ...
'ForegroundColor','black');
gridNum = [6 1];
tabBottom = resyPos+border + (border+tabHeight)*(gridNum(2)-1);
tabLeft = grpleft+ border + (border+tabWidth)*(gridNum(1)-1);
tabPos = [tabLeft tabBottom tabWidth tabHeight];
h61 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',tabPos, ...
'Horiz','center', ...
'String','', ...
'Interruptible','off', ...
'BackgroundColor','white', ...
'ForegroundColor','black');
gridNum = [6 2];
tabBottom = resyPos+border + (border+tabHeight)*(gridNum(2)-1);
tabLeft = grpleft+ border + (border+tabWidth)*(gridNum(1)-1);
tabPos = [tabLeft tabBottom tabWidth tabHeight];
h62 = uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',tabPos, ...
'Horiz','center', ...
'String','MaxRate 1-FIR', ...
'Interruptible','off', ...
'BackgroundColor','white', ...
'ForegroundColor','black');
% TEQ Design Routine Selection Menu
btnNumber=1;
yPos=menutop-(btnNumber-1)*(btnHt+spacing);
btnPos=[left yPos-btnHt btnWid btnHt];
labelStr='TFB'; %09/18 ARMA added by ming
callbackStr='tfb(''changemethod'');';
methodHndl=uicontrol( ...
'Style','popupmenu', ...
'Units','normalized', ...
'Position',btnPos, ...
'String',labelStr, ...
'Interruptible','on', ...
'Callback',callbackStr);
% Nb label
btnNumber=1;
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','SIR length (Nb)', ...
'Interruptible','off', ...
'BackgroundColor',[0.5 0.5 0.5], ...
'ForegroundColor','white');
% set Nb
textPos = [labelLeft+labelWidth-.015 labelBottom textWidth+.025 textHeight];
callbackStr = 'tfb(''setNb'')';
str = sprintf('32');
mat = [32];
NbHndl = uicontrol( ...
'Style','edit', ...
'Units','normalized', ...
'Position',textPos, ...
'Max',1, ...
'Horiz','right', ...
'Background','white', ...
'Foreground','black', ...
'String',str,'Userdata',mat, ...
'callback',callbackStr);
% Nw label
btnNumber=2;
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','TEQ length (Nw)', ...
'Interruptible','off', ...
'BackgroundColor',[0.5 0.5 0.5], ...
'ForegroundColor','white');
% set Nw
textPos = [labelLeft+labelWidth-.015 labelBottom textWidth+.025 textHeight];
callbackStr = 'tfb(''setNw'')';
str = sprintf('32'); %default setting changed from 16 to 3 09/18/01 by ming
mat = [32];
NwHndl = uicontrol( ...
'Style','edit', ...
'Units','normalized', ...
'Position',textPos, ...
'Max',1, ...
'Horiz','right', ...
'Background','white', ...
'Foreground','black', ...
'String',str,'Userdata',mat, ...
'callback',callbackStr);
% FFT Size label
btnNumber=3;
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','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 = 'tfb(''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 = 'tfb(''setCG'')';
str = sprintf('4.2');
mat = [4.2];
CGHndl = uicontrol( ...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -