📄 dfdesign.m
字号:
% dfdesign.m Advanced Filter Design Alternatives (main script)
%
% Authors: Dejan V. Tosic, Miroslav D. Lutovac, 1999.03.07
% tosic@telekom.etf.bg.ac.yu
% lutovac@galeb.etf.bg.ac.yu
%
% Copyright (c) 1999 by Tosic & Lutovac
% $Revision: 1.0 $ $Date: 1999/03/07 03:07:42 $
%
% References:
% Miroslav D. Lutovac, Dejan V. Tosic, Brian L. Evans
% Advanced Filter Design for Signal Processing
% Using MATLAB and Mathematica
% calls:
%% dfda2k.m, dfdesbut.m
% spec format (spec is attenuation-limits spec)
% 4-number spec defaults to lowpass analog
% spec is a set of positive numbers, the first number is filter type specifier
% 1 -- lowpass 'l'
% 2 -- highpass 'h'
% 3 -- bandpass 'b'
% 4 -- band reject 'r'
% lowpass spec: 1, Fpass, Fstop, Apass, Astop
% highpass spec: 2, Fstop, Fpass, Apass, Astop
% bandpass spec: 3, Fstop1, Fpass1, Fpass2, Fstop2, Astop1, Apass, Astop2
% bandstop spec: 4, Fpass1, Fstop1, Fstop2, Fpass2, Apass1, Astop, Apass2
% (band reject)
clear all; close all; clc; disp('Advanced Filter Design');
% mainfig, editfig, zoomfig
fig1 = 0;
fig2 = 0;
fig3 = 0;
% demo init spec
speca = [0.2 0.212 0.2 40];
filnumb = 1;
filtype = 'l';
speck = speca;
speck(3:4) = dfda2k(speca(3:4));
% demo design D1 parameters
desnumb = 1;
destype = 'D1';
nD = 8;
aD = 1.08155069576185;
eD = 0.217091;
fpD= 0.2;
numD = [0.02486430630874 0.02187331664743 0.07633088394268 ...
0.06729427078353 0.10381314278932 0.06729427078353 ...
0.07633088394268 0.02187331664743 0.02486430630874];
denD = [1 -2.98219203035993 6.06974818317651 ...
-7.95485544794521 7.83507110290910 -5.53041664554408 ...
2.83474731743684 -0.94319508831423 0.16691765211468];
nmin = 8;
nmax = 16;
nincmin = 0;
nincmax = 8;
ninc = 0;
zoomfmin = 0;
zoomfmax = 2*speca(2);
zoomn = 100;
filname = ['lowpass '; 'highpass '; 'bandpass '; 'bandreject'];
eseconds = 2;
dfddinfo
%-----------------------------------------------------------------%
fig1 = figure;
initaxis = get(gca,'Position');
moreaxis = 0;
axis off;
initsize = [120 120 560 420]+[80 0 0 100];
set(fig1, 'Name', 'Advanced Filter Design Alternatives' ...
, 'NumberTitle', 'off' ...
, 'Position', initsize);
svgasize = [0 0 800 562];
dfdesbut;
text(0,1.05,'Advanced Filter Design for Signal Processing', 'FontWeight', 'bold')
text(0,1.0,'Miroslav D. Lutovac, Dejan V. Tosic, Brian L. Evans', 'FontWeight', 'bold')
text(0,0.94,'Demo = load DEMO attenuation limits specification')
text(0,0.88,'Open = load USER attenuation limits specification')
text(0,0.82,'View = view CURRENT attenuation limits specification')
text(0,0.76,'Edit = edit CURRENT attenuation limits specification')
text(0,0.70,'Plot = plot attenuation versus frequency')
text(0,0.64,'Pass = plot attenuation versus frequency in passband')
text(0,0.58,'Tran = plot attenuation versus frequency in transition')
text(0,0.52,'Stop = plot attenuation versus frequency in stopband')
text(0,0.46,'Zoom = zoom attenuation characteristics')
text(0,0.40,'D1,D2,D3a,D3b,D4a,D4b,D5,2D5 = Design alternatives')
text(0,0.34,'n+ n- = increment/decrement order for the design')
%text(0,0.28,'white = toggle white/black background')
text(0,0.22,'grid = toggle grid on/off')
text(0,0.16,'full/small = full/small screen display')
%text(0,0.10,'color = set figure background color')
text(0,0.04,'close = close figure, exit/quit')
text(0,0.00,'reset = reset default values, reinitialize program')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -