fix bug

Frequency calculation for odd number of samples was incorrect.