      program bereken_sn
      real*8 x(250000),y(250000),gemid,ruis,sn
      integer tel   

      open(2,file='f')
      read(2,*)
      tel=0
      gemid=0.
      ruis=0.
      do 32 j=1,100000
            read(2,*,end=33)x(j),y(j)
cccccccccc
cc vul hier het interval van frequencies in c/d in waarover je de
cc S/N verhouding wil berekenen
cccccccccccccc
            if (x(j).lt.(0.)) goto 32
            if (x(j).gt.(10.)) goto 32
            gemid=gemid+y(j)
            tel=tel+1
 32   continue  
 33   close(2)
      gemid=gemid/tel
      write(6,*) tel, gemid
      end






