基于Matlab的策动点阻抗快速综合库函数-微带线综合
参考书籍:
MICROWAVE AMPLIFIER AND ACTIVE CIRCUIT DESIGN USING THE REAL FREQUENCY TECHNIQUE
1、环境安装
下载RFPLSynth包,链接:https://github.com/Grant-Giesbrecht/RFPLSynth。在下载得到的文件中打开install.m文件并运行:
如果运行得到如下安装成功的结果,则安装完成:
这个包需要安装MSTD的Matlab依赖包,链接:
https://github.com/Grant-Giesbrecht/MSTD/tree/main
这个包可以帮助进行简单日常计算的 MATLAB 函数。许多(但不是全部)函数都侧重于基本电路方程和数据导入或处理。
同样在下载的文件中找到install.m文件并运行
如果运行得到如下安装成功的结果,则安装完成:
此外,RFPLSynth包中的Netlist文件的四百多行存在一些错误需要改正:
使用如下的代码进行部分替换即可,不然运行会报错(mt.table_title没有定义这个方法,且scaleNumUnit找不到这个函数):
matlab
% Initialize table
mt = MTable();
% mt.table_title(title_str);
mt.row(["Ref.", "Value", "Node 1", "Node 2", "Z0", "Stub Type"]);
rowstr = "";
for c=obj.components
rowstr = strcat(c.ref_type, string(c.ref_num));
% rowstr(2) = scaleNumUnit(c.val, c.val_unit, 'DecimalPlaces', precision);
rowstr(2) = strcat(string(c.val),c.val_unit);
rowstr(3) = c.nodes(1);
rowstr(4) = c.nodes(2);
rowstr(5) = "N/A";
rowstr(6) = "N/A";
2、微带线综合
matlab
%=========================================================================%
% This example shows how to use Richard's extraction to realize a
% distributed element circuit from an impedance function. The impedance
% function must be in terms of te Richard's variable (t = j*Z0*tan(theta))
% rather than the laplace variable 's'. This example demonstrates circuits
% with both stubs and stepped impedance lines. This example replicates the
% example in Section 3,8,1 and 3,8,2 of "Microwave Amplifier and Active
% Circuit Design Using the Real Frequency Technique" by P. Jarry & J.
% Beneat.
%
% PROBLEM DESCRIPTION:
% Design a distributed element circuit realizing the input impedance
% functions:
% 1. 100*t^3 + 50*t^2 + 300*t + 30
% Z(t) = ------------------------------- (Section 3,8,1 Ex.)
% 9*t^3 + 170*t^2 + 31*t + 30
%
% 2. 18*t^2 + 240*t + 30
% Z(t) = ------------------------------- (Section 3,8,2 Ex.)
% 9*t^3 + 170*t^2 + 31*t + 30
%
% such that 't' is the Richard's variable.
%
%
% Author: G. Giesbrecht
% Contact: grant.giesbrecht@colorado.edu
%
%=========================================================================%
% Define polynomial vectors
num_1 = [100, 50, 300, 30];
num_2 = [18, 240, 30];
den = [9, 170, 31, 30];
% Example from J+B Section 3,8,1
synth_1 = NetSynth(num_1, den);
synth_1.generate("Richard");
% Example from J+B Section 3,8,2
synth_2 = NetSynth(num_2, den);
synth_2.generate("Richard");
% Print Results
displ("Section 3,8,1 Example:");
displ(synth_1.circ.str());
displ(newline, "Section 3,8,2 Example:");
displ(synth_2.circ.str());
% 使用4GHZ的微带线,最高控制到4GHz,特性阻抗1欧姆
f=4e9;
fe=4e9;
we=2*pi*fe;
tau=pi/2/we;
%光速
c=299792458;
ele_l=360*tau*f;
l=ele_l/360*c/f;
disp(['此处使用在',num2str(f/1e9),'GHz下电长度为',num2str(ele_l),'°的微带线进行实现']);
%求解频率范围,单位GHz
f_start=0.1;
f_stop=4;
f_step=0.1;
%求解范围
freq_solve=[f_start:f_step:f_stop]*1e9;
%计算不同频率下的相移常数beta
beta=2*pi*freq_solve/c;
%转换到lamda域
lamda=1j*tan(beta*l);
% 1. 100*t^3 + 50*t^2 + 300*t + 30
% Z(t) = ------------------------------- (Section 3,8,1 Ex.)
% 9*t^3 + 170*t^2 + 31*t + 30
num_num1=0;
for i=1:1:length(num_1)
num_num1=num_num1+num_1(i).*lamda.^(length(num_1)-i);
end
num_den=0;
for i=1:1:length(den)
num_den=num_den+den(i).*lamda.^(length(den)-i);
end
Zin=num_num1./num_den;
figure
plot(freq_solve,abs(Zin))
% 2. 18*t^2 + 240*t + 30
% Z(t) = ------------------------------- (Section 3,8,2 Ex.)
% 9*t^3 + 170*t^2 + 31*t + 30
num_num1=0;
for i=1:1:length(num_2)
num_num1=num_num1+num_2(i).*lamda.^(length(num_2)-i);
end
Zin=num_num1./num_den;
figure
plot(freq_solve,abs(Zin))
第一个案例的结果:
Matlab的Zin结果:
ADS结构:
ADS的Zin结果:
第二个案例的结果:
Matlab的Zin结果:
ADS结构:
ADS的Zin结果: