-
Notifications
You must be signed in to change notification settings - Fork 16.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FFT sliding window #20296
FFT sliding window #20296
Conversation
e3bad09
to
81fabc0
Compare
2249d9f
to
d780b69
Compare
d780b69
to
d7ddd08
Compare
Could you describe how you perform the testing in sitl for this one? Once i get a chance to look at more I might see about testing it on a large vehicle soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a run on a real board with --enable-malloc-guard would be good
allow configuration of DSP averaging frames via FFT_NUM_FRAMES
calculate frequency average from sliding window
7c9dc23
to
281ef03
Compare
Added SITL checks and ran on a KakuteH7Mini with --malloc-guard-enabled - all good @hendjoshsr71 the PR includes a test to run in SITL - fly.ArduCopter.GyroFFTContinuousAveraging |
This PR uses continuous averaging of FFT frames reducing noise in the analysis. Welch's method of FFT averaging requires that the input be stationary, so it is not possible to average very many frames without biasing the data. That said some amount of averaging can help especially in situations where signals may be moving more slowly (e.g. larger copters). The behaviour is enabled by setting:
where x is the number of frames to average over. In SITL on a noisy test the results are, before:
after:
it's hard to see the difference, but the test using averaging always completes after one attempt, whereas the non-averaging test takes several attempts to complete
Flew this on my Y6B with FFT_NUM_FRAMES = 5
![image](https://user-images.githubusercontent.com/2893260/169705160-dc74f98f-5567-437b-a3cb-1382616c3e47.png)
![image](https://user-images.githubusercontent.com/2893260/169705197-606b0e41-a51a-4102-b90d-6e42f3d356b8.png)
Before:
After:
The difference is pretty dramatic in terms of noise reduction