fixed the speed calculation

wave is an int, therefore the division was returning only integer
values, so the speed would change like each 5 waves, what i did was cast
wave to float so the speed could be more analog