数字信号处理实验十七

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

数字信号处理实验17

例题1:

b=[8,-4,11,-2];

a=[1,-1.25,0.75,-0.125];

[sos,g]=tf2sos(b,a)

[r,p,k]=residuez(b,a)

运行结果:

sos = 1.0000 -0.1900 0 1.0000 -0.2500 0

1.0000 -0.3100 1.3161 1.0000 -1.0000 0.5000

g = 8

r =-8.0000 -12.0000i

-8.0000 +12.0000i

8.0000

p = 0.5000 + 0.5000i

0.5000 - 0.5000i

0.2500

k = 16

例题2:

sos=[1 0.9 0 1 -0.25 0;1 -3 2 1 1 0.5];

g=0.5;

[b,a]=sos2tf(sos,g)

[C,B,A]=dir2par(b,a)

子函数:dir2par(b,a);

function[C,B,A]=dir2par(num,den)

M=length(num);

N=length(den);

[r1,p1,C]=residuez(num,den);

p=cplxpair(p1,10000000*eps);

I=cplxcomp(p1,p);

r=r1(I);

K=floor(N/2);

B=zeros(K,2);

A=zeros(K,3);

if K*2==N;

for i=1:2:N-2

Brow=r(i:1:i+1,:);

Arow=p(i:1:i+1,:);

[Brow,Arow]=residuez(Brow,Arow,[]);

B(fix((i+1)/2),:)=real(Brow);

A(fix((i+1)/2),:)=real(Arow);

end;

[Brow,Arow]=residuez(r(N-1),p(N-1),[]);

B(K,:)=[real(Brow),0];

A(K,:)=[real(Arow),0];

else

for i=1:2:N-1

Brow=r(i:1:i+1,:);

Arow=p(i:1:i+1,:);

[Brow,Arow]=residuez(Brow,Arow,[]);

B(fix(i+1)/2,:)=real(Brow);

A(fix(i+1)/2,:)=real(Arow);

end

end

子函数:cplxcomp(p1,p2)

function I=cplxcomp(p1,p2)

I=[];

for j=1:length(p2)

for i=1:length(p1)

if(abs(p1(i)-p2(j))<0.0001)

I=[I,i];

end;

end

end;

I=I';

运行结果:

b = 0.5000 -1.0500 -0.3500 0.9000

a = 1.0000 0.7500 0.2500 -0.1250

C = -7.2000

B = 3.9846 1.6308 3.7154 0

A = 1.0000 1.0000 0.5000

1.0000 -0.2500 0

例题3:

b=[8,-4,11,-2];

a=[1,-1.25,0.75,-0.125];

[K,C]=tf2latc(b,a)

[b,a]=latc2tf(K,C)

运行结果:

K = -0.7327 0.6032 -0.1250

C = 8.1064 7.4841 8.5000 -2.0000

b = 8.0000 -4.0000 11.0000 -2.0000

a = 1.0000 -1.2500 0.7500 -0.1250

例题4:

b=[1];

a=[1,-1.25,0.75,-0.125];

K=tf2latc(b,a)

[b,a]=latc2tf(K)

运行结果:

K = -0.7327

0.6032

-0.1250

b = 1.0000 -1.2500 0.7500 -0.1250

a = 1

例题5:

b=[2,0.9,1.55,2.375];

a=[1];

[sos,g]=tf2sos(b,a)

[b,a]=sos2tf(sos,g)

运行结果:

sos =1.0000 0.9500 0 1.0000 0 0

1.0000 -0.5000 1.2500 1.0000 0 0

g =2

b = 2.0000 0.9000 1.5500 2.3750

a = 1 0 0 0

例题6:

b=[1,2.7917,2,1.375,0.3333];

a=[1];

K=tf2latc(b,a)

[b,a]=latc2tf(K)

K = 2.0004

0.2498

0.5001

0.3333

相关文档
最新文档