drawimp.m

来自「AFD - Advanced Filter Design using MATLA」· M 代码 · 共 51 行

M
51
字号
function drl = drawimp(c,d,f,n,t,p,s,F,dc)

% drawimp.m  Draw impedance
% 2:08  22/2/99
%
%            Album of Analog Filter Realizations
%
%   Authors: Dejan V. Tosic, Miroslav D. Lutovac, 1999.02.21
%                 tosic@telekom.etf.bg.ac.yu
%                 lutovac@galeb.etf.bg.ac.yu
%
%   Copyright (c) 1999 by Tosic & Lutovac
%   $Revision: 1.0 $  $Date: 1999/02/21 02:17:42 $
%
%   References:
%        Miroslav D. Lutovac, Dejan V. Tosic, Brian L. Evans
%           Advanced Filter Design for Signal Processing
%                   Using MATLAB and Mathematica
%

a=(f+c)/2-0.4*s;
b=d;
g=c;
h=(f+d)/2-0.4*s;

if p == 0
 x2 = a + s*[(c-a)/s, 0.1, 0.10, 0.70, 0.70, 0.10, 0.10, 0.70, 0.7, (f-a)/s];
 y2 = b + s*[      0,   0, 0.15, 0.15,-0.15,-0.15, 0.15, 0.15,   0, 0];
 line(x2,y2,'Color',dc)
 text(a+s*0.4,b+s*0.2,t,'FontName','Times','FontSize',F,...
   'HorizontalAlignment','center','VerticalAlignment','bottom')
elseif p == 1
 x = g + s*[      0,   0, 0.15, 0.15,-0.15,-0.15, 0.15, 0.15,   0, 0];
 y = h + s*[(d-h)/s, 0.1, 0.10, 0.70, 0.70, 0.10, 0.10, 0.70, 0.7, (f-h)/s];
 line(x,y,'Color',dc)
 text(g-s*0.2,h+s*0.4,t,'FontName','Times','FontSize',F,...
   'HorizontalAlignment','right','VerticalAlignment','middle')
elseif p == 2
 x2 = a + s*[(c-a)/s, 0.1, 0.10, 0.70, 0.70, 0.10, 0.10, 0.70, 0.7, (f-a)/s];
 y2 = b + s*[      0,   0, 0.15, 0.15,-0.15,-0.15, 0.15, 0.15,   0, 0];
 line(x2,y2,'Color',dc)
 text(a+s*0.4,b-s*0.2,t,'FontName','Times','FontSize',F,...
   'HorizontalAlignment','center','VerticalAlignment','top')
else
 x = g + s*[      0,   0, 0.15, 0.15,-0.15,-0.15, 0.15, 0.15,   0, 0];
 y = h + s*[(d-h)/s, 0.1, 0.10, 0.70, 0.70, 0.10, 0.10, 0.70, 0.7, (f-h)/s];
 line(x,y,'Color',dc)
 text(g+s*0.2,h+s*0.4,t,'FontName','Times','FontSize',F,...
   'HorizontalAlignment','left','VerticalAlignment','middle')
end

⌨️ 快捷键说明

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