calculate the beat but not accurate