fig5_12.m

来自「电子工业出版社出版的《射频电路设计》」· M 代码 · 共 43 行

M
43
字号
%
%   This file computes the bandstop filter response 
% 
%   Copyright (c) 1999 by P.Bretchko and R.Ludwig
%   "RF Circuit Design: Theory and Practice"
%

close all; % close all opened graphs
clear all; % clear all variables
figure;    % open new graph

% define problem parameters
C=2e-12;  % filter capacitance
L=5e-9;   % filter inductance
G=5e-3;   % filter resistance
Zg=50;    % source impedance
ZL=50;    % load imperances

% define frequency range
f_min=10e6;  % lower frequency limit
f_max=100e9; % upper frequency limit
N=100;       % number of points in the graph
f=f_min*((f_max/f_min).^((0:N)/N)); % compute frequency points on log scale
w=2*pi*f;  

H=ZL*(G+1./(j*w*L)+j*w*C)./((ZL+Zg).*(G+1./(j*w*L)+j*w*C)+1);

semilogx(f,-20*log10(abs(H)));
title('Bandstop filter response');
xlabel('Frequency, Hz');
ylabel('Attenuation, dB');

%print -deps 'fig5_12a.eps'  % if uncommented -> saves a copy of plot in EPS format

figure;    % open new graph
phase=atan(imag(H)./real(H));
semilogx(f,phase/pi*180);
title('Bandstop filter response');
xlabel('Frequency, Hz');
ylabel('Phase, deg.');

%print -deps 'fig5_12b.eps'   % if uncommented -> saves a copy of plot in EPS format

⌨️ 快捷键说明

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