首页 > 微波/射频 > 射频学习交流 > 耦合矩阵滤波器设计的问题

耦合矩阵滤波器设计的问题

录入:edatop.com    阅读:
function [result,RN]=couplingmatrix(x,N,RL,tp,FBW)
syms w;
x=[-j*1.3 j*1.3 j*1.5];
ftz=x;
ftz = ftz/j;
x=x/j;
RL=20;
N=7;
RL=RL;
N=N;
nz = length(ftz);
d=(w^2-1)^(1/2);
u=w-1/x(1);
v=d*(1-(1/x(1))^2)^(1/2);
if nz>1
for i=2:nz
vs=v ;
us=u ;
u=us*(w-1/x(i))+vs*d*(1-(1/x(i))^2)^(1/2);
v=us*((1-1/x(i)^2)^(1/2))*d+vs*(w-1/x(i));
end
for i=nz+1:N
vs=v ;
us=u ;
u=us*(w-1/inf)+vs*d*(1-(1/inf)^2)^(1/2);
v=us*((1-(1/inf^2))^(1/2))*d+vs*(w-1/inf);
end
else
for i=2:N
vs=v ;
us=u ;
u=us*(w-1/inf)+vs*d*(1-(1/inf)^2)^(1/2);
v=us*((1-(1/inf^2))^(1/2))*d+vs*(w-1/inf);
end
end
U=u;
U=simplify(U); %简化函数形式%%多项式综合
F = sym2poly(U)
frz = roots(F)
P = poly(ftz)
F = poly(frz)
y=polyval(F,1);
rip = 1./sqrt(10^(0.1*RL)-1.0)*(polyval(P,1)/polyval(F,1))
PP = conv(P,P);
FF = rip^2*conv(F,F) ;
EE = [zeros(1,length(FF)-length(PP)),PP]+FF;
r = roots(EE);
r = r(find(imag(r)>0)) ;
E = poly(r)
E = poly(j*r); % 变换到复频域
F = poly(j*frz); % 变换到复频域
P = poly(j*ftz) ; % 变换到复频域 help zeros
if mod(N-nz,2)==0 % 保证F(s)和P(s) 向量正交
P = j*P;
end
EF = E+F
m1 = zeros(1,N+1); %1*n-1 0矩阵
n1 = zeros(1,N+1);
coef=fliplr(EF) %翻转
ncoef=length(EF);
for i=1:ncoef %
if mod(i,2)==0 %当i=2
m1(i)=j*imag(coef(i));
n1(i)=real(coef(i));
else
m1(i)=real(coef(i));
n1(i)=j*imag(coef(i));
end
end
m1= fliplr(m1)
n1=fliplr(n1)
if mod(N,2)
[r21,eigval,R] = residue(P/rip,n1);
[r22,eigval,R] = residue(m1,n1);
else
[r21,eigval,R] = residue(P/rip,m1);
[r22,eigval,R] = residue(n1,m1);
end
eigval
r21 = real(r21);
r22 = real(r22);
Tnk = sqrt(r22)
T1k = r21./Tnk
R1 = sum(T1k.^2)
RN = sum(Tnk.^2)

T=zeros(N);
for k=3:N
T(k,k-2)=1;
end
T(1,:) = T1k/sqrt(R1); %归一化
T(2,:) = Tnk/sqrt(RN); %归一化
figure;
n=N;
m=M;
dw=0.01;
w1=-3;
w2=3;
dw=0.01;
nw=(w2-w1)/dw+1;
w=w1:dw:w2;
for k=1:1:nw;
P(k)=w(k);
U=eye(n);
Q=zeros(n);
Q(1,1)=R1;
Q(n,n)=RN;
PU=P(k)*U;
A=-j*Q+PU+m;
A_l=inv(A);
s21(k)=20*log10(-j*2*sqrt(R1*RN)*A_l(n,1));
s11(k)=20*log10(1+j*2*sqrt(R1*RN)*A_l(1,1));
end
[m,n]=size(w);
Q1=R1;
plot(w ,s21,'r',w ,s11,'b');
grid on
legend('s21','s11',11)
result=M
可能在矩阵变换段出了问题。到归一化阻抗验证都是对的。希望高手帮忙看一下,修改一下。另外附上Gram_Schmidt变换函数
function [Q, R] = grams(A)
m, n] = size(A);
Asave = A;
for j = 1:n
for k = 1:j-1
mult = (A(:, j)'*A(:, k)) / (A(:, k)'*A(:, k));
A(:, j) = A(:, j) - mult*A(:, k);
end
end
for j = 1:n
if norm(A(:, j)) < sqrt(eps)
error('Columns of A are linearly dependent.')
end
Q(:, j) = A(:, j) / norm(A(:, j));
end
R = Q'*Asave;

 

没见你的问题

 

你想问什么的?

申明:网友回复良莠不齐,仅供参考。如需专业解答,请学习本站推出的微波射频专业培训课程

上一篇:双工器的优化,一直调整不过来T-T
下一篇:HFSS如何将闭合线转化为面?

射频和天线工程师培训课程详情>>

  网站地图