mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
gyro_fft: log peak frequency magnitudes
This commit is contained in:
committed by
Lorenz Meier
parent
3665f9a3c4
commit
af3573e464
@@ -9,3 +9,7 @@ float32 resolution_hz
|
||||
float32[6] peak_frequencies_x # x axis peak frequencies
|
||||
float32[6] peak_frequencies_y # y axis peak frequencies
|
||||
float32[6] peak_frequencies_z # z axis peak frequencies
|
||||
|
||||
uint32[6] peak_magnitude_x # x axis peak frequencies magnitude
|
||||
uint32[6] peak_magnitude_y # y axis peak frequencies magnitude
|
||||
uint32[6] peak_magnitude_z # z axis peak frequencies magnitude
|
||||
|
||||
@@ -318,7 +318,8 @@ void GyroFFT::Run()
|
||||
}
|
||||
|
||||
if (peaks_detected) {
|
||||
float *peak_frequencies[] { _sensor_gyro_fft.peak_frequencies_x, _sensor_gyro_fft.peak_frequencies_y, _sensor_gyro_fft.peak_frequencies_z};
|
||||
float *peak_frequencies[] {_sensor_gyro_fft.peak_frequencies_x, _sensor_gyro_fft.peak_frequencies_y, _sensor_gyro_fft.peak_frequencies_z};
|
||||
uint32_t *peak_magnitude[] {_sensor_gyro_fft.peak_magnitude_x, _sensor_gyro_fft.peak_magnitude_y, _sensor_gyro_fft.peak_magnitude_z};
|
||||
|
||||
int num_peaks_found = 0;
|
||||
|
||||
@@ -333,6 +334,8 @@ void GyroFFT::Run()
|
||||
}
|
||||
|
||||
peak_frequencies[axis][num_peaks_found] = freq;
|
||||
peak_magnitude[axis][num_peaks_found] = peaks_magnitude[i];
|
||||
|
||||
num_peaks_found++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user