mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 10:43:34 +08:00
gyro_fft: fix bucket_index size
- needed for larger FFT lengths (eg 1024, 2048, etc)
This commit is contained in:
@@ -292,7 +292,7 @@ void GyroFFT::Run()
|
|||||||
|
|
||||||
// start at 2 to skip DC
|
// start at 2 to skip DC
|
||||||
// output is ordered [real[0], imag[0], real[1], imag[1], real[2], imag[2] ... real[(N/2)-1], imag[(N/2)-1]
|
// output is ordered [real[0], imag[0], real[1], imag[1], real[2], imag[2] ... real[(N/2)-1], imag[(N/2)-1]
|
||||||
for (uint8_t bucket_index = 2; bucket_index < (_imu_gyro_fft_len / 2); bucket_index = bucket_index + 2) {
|
for (uint16_t bucket_index = 2; bucket_index < (_imu_gyro_fft_len / 2); bucket_index = bucket_index + 2) {
|
||||||
const float freq_hz = (bucket_index / 2) * resolution_hz;
|
const float freq_hz = (bucket_index / 2) * resolution_hz;
|
||||||
|
|
||||||
if (freq_hz > _param_imu_gyro_fft_max.get()) {
|
if (freq_hz > _param_imu_gyro_fft_max.get()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user