Страница: 11/13
str(round*4:6,s);
setcolor(11);
outtextxy(50,460,'time = '+s+' ns+');
oldx:=xgmax-trunc((xmax-0)*(xgmax- xgmin)/(xmax-xmin));
for aaa:=1 to 10 do
oldy[aaa]:=ygmin-trunc((ymax- y[8]*10)*(ygmin-ygmax)/(ymax-ymin));
end;
bn:=x*1e9;
y1:=y[1]-1;
xg:=xgmax-trunc((xmax-bn)*(xgmax-xgmin)/(xmax- xmin));
xg:=xg-145-580*(loop-1);
yg:=ygmin-trunc((ymax-y[8]*10)*(ygmin- ygmax)/(ymax-ymin));
setcolor(10);
line(oldx,oldy[1],xg,yg);
oldy[1]:=ygmin-trunc((ymax-y[8]*10)*(ygmin- ygmax)/(ymax-ymin));
{ yg:=ygmin-trunc((ymax-frequency/1e10)*(ygmin- ygmax)/(ymax-ymin));
setcolor(14);
line(oldx,oldy[2],xg,yg);
oldy[2]:=ygmin-trunc((ymax- frequency/1e10)*(ygmin-ygmax)/(ymax-ymin));
}
yg:=ygmin-trunc((ymax-y1)*(ygmin-ygmax)/(ymax- ymin));
setcolor(13);
line(oldx,oldy[3],xg,yg);
oldy[3]:=ygmin-trunc((ymax-y1)*(ygmin- ygmax)/(ymax-ymin));
oldx:=xg;
end;
{ phas. portret }
if(iii1>0) then begin
an4;
di:=(y[8]-oldc1)*50*size_y;
yg:=ygmax-trunc((ymax-di)*(ygmax-ygmin)/(ymax- ymin));
xg:=xgmin-trunc((xmax-y[8]*15*size_x)*(xgmin- xgmax)/(xmax-xmin));
putpixel(xg+phas_x,yg+phas_y,10);
oldc1:=y[8];
if(iii1<=500) then begin
Smax:=Smax+y[8];
sign[iii1]:=y[8];
end
else begin
Smax:=Smax-sign[1]+y[8];
for i:=1 to 499 do begin
sign[i]:=sign[i+1];
end;
sign[500]:=y[8];
end;
end;
if(iii1>249) then begin
{ control circle }
if (mark=1) then begin
mark:=0;
setcolor(14);
circle(xg+phas_x,yg+phas_y,3);
setcolor(10);
end;
end;
{ управление экраном }
if keypressed=true then begin
c:=readkey;
case c of
{ пеpемещение фаз. поpepета }
'1': begin
an4;
setfillstyle(0,0);
bar(xgmin+1,ygmin+1,xgmax-1,ygmax-1);
end;
'4': begin
phas_x:=phas_x-10;
an4;
Size := ImageSize(xgmin+1, ygmin+1, xgmax-1, ygmax-1);
GetMem(P, Size);
GetImage(xgmin+1, ygmin+1, xgmax-1, ygmax-1, P^);
setfillstyle(0,0);
bar(xgmin+1,ygmin+1,xgmax-1,ygmax-1);
PutImage(xgmin+1-10, ygmin+1, P^, NormalPut);
FreeMem(P, Size);
scal;
end;
'6': begin
phas_x:=phas_x+10;
an4;
Size := ImageSize(xgmin+1, ygmin+1, xgmax-1, ygmax-1);
GetMem(P, Size);
GetImage(xgmin+1, ygmin+1, xgmax-1, ygmax-1, P^);
setfillstyle(0,0);
bar(xgmin+1,ygmin+1,xgmax-1,ygmax-1);
PutImage(xgmin+1+10, ygmin+1, P^, NormalPut);
FreeMem(P, Size);
scal;
end;
'2': begin
phas_y:=phas_y+10;
an4;
Size := ImageSize(xgmin+1, ygmin+1, xgmax-1, ygmax-1);
GetMem(P, Size);
GetImage(xgmin+1, ygmin+1, xgmax-1, ygmax-1, P^);
setfillstyle(0,0);
bar(xgmin+1,ygmin+1,xgmax-1,ygmax-1);
PutImage(xgmin+1, ygmin+1+10, P^, NormalPut);
FreeMem(P, Size);
scal;
end;
'8': begin
phas_y:=phas_y-10;
an4;
Size := ImageSize(xgmin+1, ygmin+1, xgmax-1, ygmax-1);
GetMem(P, Size);
GetImage(xgmin+1, ygmin+1, xgmax-1, ygmax-1, P^);
setfillstyle(0,0);
bar(xgmin+1,ygmin+1,xgmax-1,ygmax-1);
PutImage(xgmin+1, ygmin+1-10, P^, NormalPut);
FreeMem(P, Size);
scal;
end;
{ пеpеход на вычисление спектpа }
's': begin
goto 1;
end;
{ масштаб фаз. поpтpета }
'+': begin
an4;
setfillstyle(0,0);
bar(xgmin+1,ygmin+1,xgmax-1,ygmax-1);
size_x:=size_x+0.1;
size_y:=size_y+0.1;
end;
'-': begin
an4;
setfillstyle(0,0);
bar(xgmin+1,ygmin+1,xgmax-1,ygmax-1);
size_x:=size_x-0.1;
size_y:=size_y-0.1;
end;
end;
2: end;
end;
{ спектр }
1: SETCOLOR(15);
an2;
f0:=0;
Smax:=0;
sign0:=0;
setcolor(15);
for k:=1 to 200 do begin
s0:=0;s1:=0;
FOR i:=1 to 500 do begin
s0:=s0+(sign[i]-sign0)*cos(f0*i*6.28e-9/250);
s1:=s1+(sign[i]-sign0)*sin(f0*i*6.28e-9/250);
end;
if k=1 then begin sign0:=s0/500; s0:=0; end;
Реферат опубликован: 30/10/2008