Cited from “A Generalized Coupling Matrix Extraction Technique for Bandpass Filters with Uneven-Qs”, “Rational Approximation of Frequency Domain Response by Vector Fitting”.
close all;home;clc;clear all;
[freq,S] = smart_s2p('n78LC_1601_S.s2p');
Z0=1;
Y0=1/Z0;
f1=3.3;
f2=3.8;
f0=(f1*f2)^0.5;
FBW=(f2-f1)/f0;
w0=2*pi*f0;
w1=2*pi*f1;
w2=2*pi*f2;
S11=S(:,1);
S21=S(:,2);
S12=S(:,3);
S22=S(:,4);
S11dB=20*log10(abs(S(:,1)));
S21dB=20*log10(abs(S(:,2)));
Y11=Y0*((1-S11).*(1+S22)+(S12.*S21))./((1+S11).*(1+S22)-(S12.*S21));
Y12=Y0*((-2*S12)./((1+S11).*(1+S22)-(S12.*S21)));
Y21=Y0*((-2*S21)./((1+S11).*(1+S22)-(S12.*S21)));
Y22=Y0*((1+S11).*(1-S22)+(S12.*S21))./((1+S11).*(1+S22)-(S12.*S21));
Y11dB=20*log10(abs(Y11));
w=2*pi*freq;
cap_w=((w/w0)-(w0./w))/FBW;
figure(1)
plot(cap_w,Y11dB, 'LineWidth', 2.5)
findpeaks(Y11dB,cap_w);
sgtitle('Positions of Eigan Values', 'FontSize', 16);
axis([-2 2 -80 80]);
xlabel('$\Omega$', 'Interpreter', 'latex');
ylabel('Y11(dB)');
[~,EiganY11]=findpeaks(Y11dB,cap_w);
N=size(EiganY11,1);
r11 = zeros(N, 1);
delta_cap_w=0.01;
for j=1:1:N;
Y11_interp(j,1) = interp1(cap_w, Y11, EiganY11(j)+delta_cap_w, 'linear');
Y12_interp(j,1) = interp1(cap_w, Y12, EiganY11(j)+delta_cap_w, 'linear');
r11(j,1)=i*delta_cap_w*Y11_interp(j,1);
r12(j,1)=i*delta_cap_w*Y12_interp(j,1);
end
Y11_reconst=zeros(1601,1);
Y12_reconst=zeros(1601,1);
for j=1:1:N;
Y11_reconst=Y11_reconst+(r11(j)*ones(1601, 1)./(i*cap_w-i*EiganY11(j)*ones(1601, 1)));
Y12_reconst=Y12_reconst+(r12(j)*ones(1601, 1)./(i*cap_w-i*EiganY11(j)*ones(1601, 1)));
end
figure(2)
subplot(2, 2, 1);
plot(cap_w, imag(Y11), 'b', cap_w, imag(Y11_reconst), 'r--', 'LineWidth', 2.5)
xlabel('$\Omega$', 'Interpreter', 'latex');
legend('imag Y11', 'imag Y11_reconst')
axis([-2 2 -20 20]);
subplot(2, 2, 2);
plot(cap_w, real(Y11), 'b', cap_w, real(Y11_reconst), 'r--', 'LineWidth', 2.5)
xlabel('$\Omega$', 'Interpreter', 'latex');
legend('real Y11', 'real Y11_reconst')
axis([-2 2 -0.1 0.1]);
subplot(2, 2, 3);
plot(cap_w, imag(Y12), 'b', cap_w, imag(Y12_reconst), 'r--', 'LineWidth', 2.5)
xlabel('$\Omega$', 'Interpreter', 'latex');
legend('imag Y12', 'imag Y12_reconst')
axis([-2 2 -20 20]);
subplot(2, 2, 4);
plot(cap_w, real(Y12), 'b', cap_w, real(Y12_reconst), 'r--', 'LineWidth', 2.5)
xlabel('Omega');
legend('real Y12', 'real Y12_reconst')
axis([-2 2 -0.1 0.1]);
sgtitle('Comparisions of Real & Imag Y-Parameters', 'FontSize', 18);
Y22_reconst=Y11_reconst;
Y21_reconst=Y12_reconst;
S11_reconst=-((Y11_reconst-Y0).*(Y22_reconst+Y0)-Y12_reconst.*Y21_reconst)./((Y11_reconst+Y0).*(Y22_reconst+Y0)-Y12_reconst.*Y21_reconst);
S12_reconst=-(2*Y12_reconst*Y0)./((Y11_reconst+Y0).*(Y22_reconst+Y0)-Y12_reconst.*Y21_reconst);
S11dB_reconst=20*log10(abs(S11_reconst));
S21dB_reconst=20*log10(abs(S12_reconst));
figure(3)
subplot(2, 2, 1);
plot(cap_w, imag(S12), 'b', cap_w, imag(S12_reconst), 'r--', 'LineWidth', 2.5)
xlabel('$\Omega$', 'Interpreter', 'latex');
legend('imag S12', 'imag S12_reconst')
axis([-2 2 -2 2]);
subplot(2, 2, 2);
plot(cap_w, real(S12), 'b', cap_w, real(S12_reconst), 'r--', 'LineWidth', 2.5)
xlabel('$\Omega$', 'Interpreter', 'latex');
legend('real S12', 'real S12_reconst')
axis([-2 2 -2 2]);
subplot(2, 2, 3);
plot(cap_w, imag(S11), 'b', cap_w, imag(S11_reconst), 'r--', 'LineWidth', 2.5)
xlabel('$\Omega$', 'Interpreter', 'latex');
legend('imag S11', 'imag S11_reconst')
axis([-2 2 -1 1]);
subplot(2, 2, 4);
plot(cap_w, real(S12), 'b', cap_w, real(S12_reconst), 'r--', 'LineWidth', 2.5)
xlabel('$\Omega$', 'Interpreter', 'latex');
legend('real S12', 'real S12_reconst')
axis([-2 2 -1 1]);
sgtitle('Comparisions of Real & Imag S-Parameters', 'FontSize', 18);
figure(4)
plot(freq,S11dB, 'b',freq,S21dB, 'r',freq,S11dB_reconst, 'b--',freq,S21dB_reconst, 'r--', 'LineWidth', 2.5)
axis([2.8 4.2 -60 0]);
xlabel('Freq (GHz)');
ylabel('S-Parameters');
legend('original S11(dB)','original S21(dB)','constructed S11(dB)','constructed S21(dB)')
sgtitle('Comparisions of S-Parameters', 'FontSize', 16);
Comments