Previously, the frequency_array was passed to infft, but it should instead be the sampling frequency.