0% found this document useful (0 votes)
2 views3 pages

Code Combline Corrigé

The document is a MATLAB script for designing a combline filter based on user inputs for central frequency, fractional bandwidth, and filter order. It calculates external quality factors, coupling coefficients, and generates plots for quality factors versus spacing and coupling coefficients versus spacing. Additionally, it interpolates spacing values and constructs a table summarizing the resonator lengths and spacings.

Uploaded by

Dores Tamdem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Code Combline Corrigé

The document is a MATLAB script for designing a combline filter based on user inputs for central frequency, fractional bandwidth, and filter order. It calculates external quality factors, coupling coefficients, and generates plots for quality factors versus spacing and coupling coefficients versus spacing. Additionally, it interpolates spacing values and constructs a table summarizing the resonator lengths and spacings.

Uploaded by

Dores Tamdem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

%% combline_geometry_simple.

clear; clc;

%% Entrée utilisateur

f0_GHz = input('Fréquence centrale f0 (GHz) : ');


FBW = input('Bande passante fractionnaire FBW (ex : 0.1 pour 10%) : ');
order = input('Ordre du filtre (nombre de résonateurs) : ');

%% 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

%% Coefficients prototype Chebyshev 0.1 dB

g = getChebyshevPrototype(order);

%% Calcul des facteurs de Qualité externe

Qe =(g(order+1)*g(order+2))/FBW;
display(Qe);

%% Calcul des coefficients de couplage Mij

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

fprintf('\nCoefficient de couplage M(i,i+1):\n')


for k=1:order-1
fprintf('M(%d,%d)= %.5f\n',k,k+1,M(k,k+1));
end

fprintf('\nFull coupling Matrix M:\n');


disp(M);

%% tableaux la courbe de Qe Vs s_mm

s_vals_Qe = [0.40, 0.45, 0.50 ,0.55 ,0.60];


Qe_vals = [7.8,9.0,10.2, 11.4, 12.6 ];

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]);

fprintf('Graph for External Quality factor (Qe) vs .Spacing(s) plotted.\n');

%% tableaux de la courbe de M Vs d_mm

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]);

fprintf('Graph for coupling Coefficient (M) vs .Spacing(d) plotted.\n')

%% Interpolation des espacements s pour les coefficients de couplage M

s_extracted_M = zeros(order-1,1);

fprintf('Extraction des espacements s à partir de M vs Spacing(d)\n');


for k = 1:order-1
s_extracted_M(k) = interp1(M_vals, d_vals_M, coupling_values(k), 'linear',
'extrap');
fprintf('s pour M(%d,%d)= %.5f : %.3f mm\n', k, k+1, coupling_values(k),
s_extracted_M(k));
end

%% Interpolation de s pour Qe

s_vals_Qe_ext = interp1(Qe_vals, s_vals_Qe, Qe, 'linear', 'extrap');


fprintf('Espacement estimé pour Qe=%.3f : %.3f mm\n', Qe, s_vals_Qe_ext);

%% Longueurs physiques (ajustées légèrement selon gi)

Length_mm = (1 + 0.1*(g(2:order+1)-1)) * Lmm;

%% Construction du tableau avec espacement interpolé

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

Spacing_Qe_tab = repmat(s_vals_Qe_ext, order, 1);

T = table(Resonator, Length_mm_tab, Spacing_M_tab, Spacing_Qe_tab, ...


'VariableNames', {'Resonator', 'Length_mm', 'Spacing_M', 'Spacing_Qe'});

disp('--- Géométrie Combline ---');


disp(T);

fprintf('s estimé pour Qe : %.3f mm\n', s_vals_Qe_ext);

%% Fonction prototype Chebyshev (ripple 0.1 dB)

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

You might also like