function [ TT] = Base( )
D1=input('Duct1 dia=');
D2=input('Duct2 dia=');
a=input('extend length(a)=');
b=input('extend length(b)=');
s1=pi*D1^2/4;
s2=pi*D2^2/4;
c=340;
q=1.293;
freq=linspace(1,6486,1082);
K=2*pi*freq/340;
Z22=1i*(q*c/s2)*cot(K*a);
Z21=-1i*(q*c/s2)*cot(K*b);
T=zeros(4,6486);
n=1;
A=zeros(1,1082);
B=zeros(1,1082);
C=zeros(1,1082);
D=zeros(1,1082);
E=zeros(1,1082);
F=zeros(1,1082);
G=zeros(1,1082);
H=zeros(1,1082);
for ii=1:1:1082
A(n)=T(1,4*n)+Z21(n)*T(1,4*n-1);
B(n)=T(3,4*n-3)+Z22(n)*T(4,4*n-3);
C(n)=T(3,4*n-2)+Z22(n)*T(4,4*n-2);
D(n)=T(2,4*n)+Z21(n)*T(2,4*n-3);
E(n)=((T(4,4*n)+T(4,4*n-1)*Z21(n))*Z22(n))-(T(3,4*n)+T(3,4*n-1)*Z21(n));
TT(:,2*n-1:2*n)=[T(1,4*n-3)+A(n)*B(n)/E(n),T(1,4*n-2)+A(n)*C(n)/E(n);T(2,4*n-3)+D(n)*B(n)/E(n),T(2,4*n)+D(n)*C(n)/E(n)];
n=n+1;
end
end