Skip to content

Commit

Permalink
fix finding wave frequency from FFT
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrouch committed Apr 22, 2024
1 parent 48fc747 commit 1277270
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/bareboat-math.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ w = fft.rfft(accZ_val)
freqs = fft.rfftfreq(N_SAMP, 1 / SAMPLE_RATE)
# Find the peak in the coefficients
idx = np.argmax(np.abs(w))
idx = np.argmax(np.divide(np.divide(np.abs(w), freqs), freqs))
freq = freqs[idx]
freq_in_hertz = abs(freq)
period = 1 / freq_in_hertz
Expand Down

0 comments on commit 1277270

Please sign in to comment.