Skip to content

Instantly share code, notes, and snippets.

@raytroop
Created June 11, 2026 15:03
Show Gist options
  • Select an option

  • Save raytroop/ea3aa0bc844e7116a27d22e2ff441fab to your computer and use it in GitHub Desktop.

Select an option

Save raytroop/ea3aa0bc844e7116a27d22e2ff441fab to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
clear; clc; close all;
% Shunt peaking parameter
m = linspace(0.2, 4, 1000);
% Special values
m_bw_max = sqrt(2);
m_no_peak = 1 + sqrt(2);
%% 1. Bandwidth extension ratio: f_3dB / f_RC
bw_ratio = sqrt( ...
(2 + 2*m - m.^2 + sqrt((m.^2 - 2*m - 2).^2 + 4*m.^2)) / 2 );
%% 2. Peaking frequency ratio: f_peak / f_RC
fpeak_ratio = nan(size(m));
idx_peak = m < m_no_peak;
fpeak_ratio(idx_peak) = sqrt( ...
m(idx_peak) .* ...
(sqrt(1 + 2*m(idx_peak)) - m(idx_peak)) );
% For m >= 1 + sqrt(2), no peaking
fpeak_ratio(~idx_peak) = 0;
%% 3. Peaking gain
Gpeak = ones(size(m));
Gpeak(idx_peak) = sqrt( ...
1 ./ ( ...
m(idx_peak) .* ...
(2*sqrt(1 + 2*m(idx_peak)) - m(idx_peak) - 2) ...
) );
Gpeak_dB = 20*log10(Gpeak);
%% Plot
figure('Color','w','Position',[100 100 1400 780]);
tiledlayout(3,1,'TileSpacing','compact','Padding','compact');
% -------------------------
% Bandwidth extension
% -------------------------
nexttile;
plot(m, bw_ratio, 'LineWidth', 2);
grid on;
ylabel('$f_{3\mathrm{dB}}/f_{RC}$', 'Interpreter','latex');
title('Shunt Peaking Trends vs $m = R^2C/L$', ...
'Interpreter','latex', 'FontSize', 18);
xline(m_bw_max, '--', '$\sqrt{2}$', ...
'Interpreter','latex', ...
'LabelVerticalAlignment','bottom', ...
'LabelHorizontalAlignment','center');
xline(m_no_peak, '--', '$1+\sqrt{2}$', ...
'Interpreter','latex', ...
'LabelVerticalAlignment','bottom', ...
'LabelHorizontalAlignment','center');
ylim([1.4 1.9]);
xlim([0.2 4]);
text(1.48, 1.86, 'max BW near $m=\sqrt{2}$', ...
'Interpreter','latex', 'FontSize', 12);
% -------------------------
% Peaking frequency
% -------------------------
nexttile;
plot(m, fpeak_ratio, 'LineWidth', 2);
grid on;
ylabel('$f_{peak}/f_{RC}$', 'Interpreter','latex');
xline(m_bw_max, '--');
xline(m_no_peak, '--');
ylim([0 1.0]);
xlim([0.2 4]);
text(2.6, 0.42, 'no peaking beyond $m=1+\sqrt{2}$', ...
'Interpreter','latex', 'FontSize', 12);
% -------------------------
% Peaking gain
% -------------------------
nexttile;
plot(m, Gpeak_dB, 'LineWidth', 2);
grid on;
ylabel('Peaking gain (dB)');
xlabel('$m = R^2C/L$', 'Interpreter','latex');
xline(m_bw_max, '--');
xline(m_no_peak, '--');
ylim([-0.2 10]);
xlim([0.2 4]);
%% Improve axes appearance
ax = findall(gcf,'Type','axes');
for k = 1:length(ax)
ax(k).FontSize = 12;
ax(k).LineWidth = 1;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment