1
13694132257
Unregistered / Unconfirmed
GUEST, unregistred user!
请各位高手帮我看看下面的程序,他是用PUSCAL写的滤波程序,我想他知道采用的是什么
滤波方法
顶者有分。
function weigho.weight(var ds:dds;ports):real;
function wout(b:bislists;c:byte):real;
begin
begin
case c of
1: wout:=weigh*b[1].k;
2: if weigh<=b[1].cz then
wout:=weigh*b[1].k
else
if weigh<=b[2].cz then
wout:=(weigh-b[1].cz)*b[1].k+b[1].bz
else
wout:=(weigh-b[2].cz)*b[2].k+b[2].bz;
3: if weigh<=b[1].cz then
wout:=weigh*b[1].k
else
if weigh<=b[2].cz then
wout:=(weigh-b[1].cz)*b[2].k+b[1].bz
else
if weigh<=b[3].cz then
wout:=(weigh-b[2].cz)*b[3].k+b[2].bz
else
wout:=(weigh-b[3].cz)*b[3].k+b[3].bz;
4: if weigh<=b[1].cz then
wout:=weigh*b[1].k
else
if weigh<=b[2].cz then
wout:=(weigh-b[1].cz)*b[2].k+b[1].bz
else
if weigh<=b[3].cz then
wout:=(weigh-b[2].cz)*b[3].k+b[2].bz
else
if weigh<=b[4].cz then
wout:=(weigh-b[3].cz)*b[4].k+b[3].bz
else
wout:=(weigh-b[4].cz)*b[4].k+b[4].bz;
5: begin
if weigh<=b[1].cz then
wout:=weigh*b[1].k
else
if weigh<=b[2].cz then
wout:=(weigh-b[1].cz)*b[2].k+b[1].bz
else
if weigh<=b[3].cz then
wout:=(weigh-b[2].cz)*b[3].k+b[2].bz
else
if weigh<=b[4].cz then
wout:=(weigh-b[3].cz)*b[4].k+b[3].bz
else
if weigh<=b[5].cz then
wout:=(weigh-b[4].cz)*b[5].k+b[4].bz
else
wout:=(weigh-b[5].cz)*b[5].k+b[5].bz;
end;
end ;{CASE}
end; {with}
end;
var bk:bislists;
count:byte;
begin
case p of
A: begin
case ds of
left: bk:=k.A.bislistl;
right: bk:=k.A.bislistr;
end;
Count:=k.A.Count;
end;
B: begin
case ds of
left: bk:=k.B.bislistl;
right: bk:=k.B.bislistr;
end;
Count:=K.B.Count;
end;
end;
weight:=wout(bk,COUNT);
end;
滤波方法
顶者有分。
function weigho.weight(var ds:dds;ports):real;
function wout(b:bislists;c:byte):real;
begin
begin
case c of
1: wout:=weigh*b[1].k;
2: if weigh<=b[1].cz then
wout:=weigh*b[1].k
else
if weigh<=b[2].cz then
wout:=(weigh-b[1].cz)*b[1].k+b[1].bz
else
wout:=(weigh-b[2].cz)*b[2].k+b[2].bz;
3: if weigh<=b[1].cz then
wout:=weigh*b[1].k
else
if weigh<=b[2].cz then
wout:=(weigh-b[1].cz)*b[2].k+b[1].bz
else
if weigh<=b[3].cz then
wout:=(weigh-b[2].cz)*b[3].k+b[2].bz
else
wout:=(weigh-b[3].cz)*b[3].k+b[3].bz;
4: if weigh<=b[1].cz then
wout:=weigh*b[1].k
else
if weigh<=b[2].cz then
wout:=(weigh-b[1].cz)*b[2].k+b[1].bz
else
if weigh<=b[3].cz then
wout:=(weigh-b[2].cz)*b[3].k+b[2].bz
else
if weigh<=b[4].cz then
wout:=(weigh-b[3].cz)*b[4].k+b[3].bz
else
wout:=(weigh-b[4].cz)*b[4].k+b[4].bz;
5: begin
if weigh<=b[1].cz then
wout:=weigh*b[1].k
else
if weigh<=b[2].cz then
wout:=(weigh-b[1].cz)*b[2].k+b[1].bz
else
if weigh<=b[3].cz then
wout:=(weigh-b[2].cz)*b[3].k+b[2].bz
else
if weigh<=b[4].cz then
wout:=(weigh-b[3].cz)*b[4].k+b[3].bz
else
if weigh<=b[5].cz then
wout:=(weigh-b[4].cz)*b[5].k+b[4].bz
else
wout:=(weigh-b[5].cz)*b[5].k+b[5].bz;
end;
end ;{CASE}
end; {with}
end;
var bk:bislists;
count:byte;
begin
case p of
A: begin
case ds of
left: bk:=k.A.bislistl;
right: bk:=k.A.bislistr;
end;
Count:=k.A.Count;
end;
B: begin
case ds of
left: bk:=k.B.bislistl;
right: bk:=k.B.bislistr;
end;
Count:=K.B.Count;
end;
end;
weight:=wout(bk,COUNT);
end;