vilopos=5:0.05:95;
lambda=50;
c=340;
omega=2*pi*c/lambda;
ampl=4;
k=2*pi/lambda;
T=lambda/c;
tsteg=T/10;
y=rand(size(vilopos));
for t=0:tsteg:50*tsteg
   Tid=t/5/T
   s=ampl*sin(omega*t-k*vilopos);
   s1=ampl*cos(omega*t-k*vilopos);
   pos=s+vilopos;
   plot(pos,y,'.b')
   hold on
   plot(vilopos,(1.5+s/ampl/2),'r')
   plot(vilopos,(-0.5+s1/ampl/2),'g')
   text(10,1.2,'Förskjutning')
   text(10,-0.2,'Tryck')
   hold off
   pause(1)
end
