next up previous
Naprej: hitr.m Gor: Program v jeziku Nazaj: Program v jeziku

Glavni program za izracun karakteristik (ata.m)

function [xfilt,yfilt,vxfilt,vyfilt, ...
        vfilt,axfilt,ayfilt,afilt,t]=ata(ime,tdif);

        [x,y]=kompo(ime);
        [xfilt,yfilt]=myfilt(x,y);

        [t]=cas(xfilt);

        [vx,vy,v]=hitr(x,y,tdif);
        [vxfilt,vyfilt]=myfilt(vx,vy);
        vfilt=sqrt(vxfilt.*vxfilt+vyfilt.*vyfilt);

        [ax,ay,a]=posp1(x,y,tdif);
        [axfilt,ayfilt]=myfilt(ax,ay);
        afilt=sqrt(axfilt.*axfilt+ayfilt.*ayfilt);
end

Ker imamo premalo tock bi to pri dvakratnem odvajanju pomenilo, da dobimo prevec suma zato uporabimo numericni filter, ki je napisan kot program v Matlabu.

function [x,y]=myfilt(xvh, yvh)
  [b,a] = cheby(2, 0.5, 15/62.5)
  x = filtfilt(b, a, xvh)
  y = filtfilt(b, a, yvh)
end

Hitrosti in pospeske se enostavno izracuna z numericnim odvajenjem (funkcija diff()).


Leon Kos
Thu Feb 22 10:40:33 GMT+0100 1996