Code covered by the BSD License  

Highlights from
RF Utilities V1.2

image thumbnail
from RF Utilities V1.2 by Neill Tucker
Routines for Smith Chart, TDR, Mixed-Mode S-params, Matching

R1=rlossc(Z,Freq,Zo,linetype);
function R1=rlossc(Z,Freq,Zo,linetype);
% Return Loss Plot
%
% Plot Return Loss as a function of frequency
% Default display is figure(5)
%
% Usage : rlossc(Z,Freq,Zo,linetype)
%
%    e.g. rlossc(Z,Freq,50,'r')

% N.Tucker www.activefrance.com 2008

figure(5);
clf;
chartname=sprintf(' Return Loss  (Zo=%g)',Zo);
set(5,'name',chartname);

Zr=Z;
p=(Zr-Zo)./(Zr+Zo);
s=(1+abs(p))./(1-abs(p));
R1=20.*log10(abs(p));
plot(Freq,R1,linetype,'LineWidth',2);
grid;

title(chartname);
xlabel('Frequency MHz');
ylabel('Return Loss dB');

axis('square');
V=[min(Freq),max(Freq),-40,0];
axis(V);

Contact us at files@mathworks.com