% calltl.m         Version 1     T.l.Szabo    9/24/2002
%  try out transmission line function tl
% T. L. Szabo July 2004 Diagnostic Ultrasound Imaging: Inside Out
close all;
clear all;
delt0=0.5e-7;            %  time sample increment
nt=128;               %  number of time points
fd0=1./(nt*delt0);    %  frequency increment
f1=fd0*[-nt/2:1.0:nt/2-1];         % sets final frequency range
%  create transmission line variables
c1=3.e3;    % line sound speed
d1=1.5e-4;  % line length
z1=15.;     % line impedance
zm=1.5;     % load impedance
[r,zin] = tl1(f1,c1,d1,z1,zm);    % call tl function
%
figure;               %  plot results
plot(f1,abs(r));
title('pressure ratio magnitude');
xlabel('frequency (Hz)');
figure;               %  plot results
plot(f1,1./abs(r));
title('pressure p2/p1 ratio magnitude');
xlabel('frequency (Hz)');figure;               %  plot results
plot(f1,abs(zin));
title('input impedance magnitude');
xlabel('frequency (Hz)');