Code Combline Corrigé
Code Combline Corrigé
clear; clc;
%% Entrée utilisateur
%% Constantes
c = 3e8;
er = 10.8;
f0 = f0_GHz * 1e9;
lambda_g = c / (f0 * sqrt(er));
Lq = lambda_g / 4;
Lmm = Lq * 1e3; % en mm
g = getChebyshevPrototype(order);
Qe =(g(order+1)*g(order+2))/FBW;
display(Qe);
M = zeros(order,order);
coupling_values = zeros(1,order-1);
for k = 1:order-1
M_val= FBW / sqrt(g(k+1)*g(k+2));
M(k,k+1)=M_val;
M(k+1,k)=M_val;
coupling_values(k)=M_val;
end
subplot(1,2,1);
plot(s_vals_Qe, Qe_vals,'b-o','LineWidth',2,'MarkerSize',6);
xlabel('spacing,s_vals_Qe ','FontSize',12);
ylabel('External Quality factor,Qe_vals ','FontSize',12);
title('Figure 5.20(a):External Quality factor vs . Spacing','FontSize',14);
grid on;
xlim([0.38,0.62]);
ylim([7,13]);
subplot(1,2,2);
d_vals_M = [1.6,1.8, 2.0, 2.2,2.4,2.6];
M_vals = [0.082,0.076,0.070,0.064,0.058,0.052];
plot(d_vals_M, M_vals,'r-s','LineWidth',2,'MarkerSize',6);
xlabel('spacing,d_vals_M ','FontSize',12);
ylabel('coupling coeficient,M_vals ','FontSize',12);
title('Figure 5.20(b):coupling coefficient vs . Spacing','FontSize',14);
grid on;
xlim([1.5,2.7]);
ylim([0.048,0.087]);
s_extracted_M = zeros(order-1,1);
%% Interpolation de s pour Qe
Resonator = (1:order).';
Length_mm_tab = reshape(Length_mm, [], 1);
Spacing_M_tab = nan(order, 1);
for i = 1:order-1
Spacing_M_tab(i) = s_extracted_M(i);
end
function g = getChebyshevPrototype(N)
switch N
case 1, g = [1,6.5516,1];
case 2, g = [1,0.6220,0.8431,1.3528];
case 3, g = [1,1.0316,1.1474,1.0316,1];
case 4, g = [1,0.8181,1.7704,1.3062,1.1088,1.3528];
case 5, g = [1,1.1468,1.3712,1.9750,1.3712,1.1468,1];
otherwise
error('Ordre non supporté pour ripple 0.1 dB.');
end
end