-
-
Notifications
You must be signed in to change notification settings - Fork 156
Added missing slices of data samples arrays in spectrum calc #819
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
Conversation
8f664d7 to
ef22d74
Compare
|
|
we dont have Netlify previews at all anymore @blckmn ? |
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.
Pull Request Overview
This PR fixes an issue with the FFT calculation by correcting the sample slicing for spectrum processing. Key changes include:
- Truncating the samples array in _getFlightSamplesFreq to use only populated data.
- Applying slicing to vsValues arrays in _getFlightSamplesFreqVsX.
- Slicing the piderror and setpoint arrays in _getFlightSamplesPidErrorVsSetpoint to match the actual sample count.
Comments suppressed due to low confidence (3)
src/graph_spectrum_calc.js:302
- Confirm that slicing using samplesCount does not exceed the allocated array length and that samplesCount is properly maintained.
samples : samples.slice(0, samplesCount),
src/graph_spectrum_calc.js:418
- Verify that slicing the 'piderror' TypedArray to samplesCount preserves the intended data and aligns with downstream FFT processing.
piderror: piderror.slice(0, samplesCount),
src/graph_spectrum_calc.js:419
- Ensure the sliced 'setpoint' array correctly reflects the populated data count and remains in sync with the corresponding 'piderror' values.
setpoint: setpoint.slice(0, samplesCount),
nerdCopter
left a comment
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.
- approving untested.
|
It was not big issue as i've thought on begin :). The FFT get real data count as parameter. But it allocate float data memory for huge data count, what is not good. |
|
i should not have approved untested. several reports of breakage. |
|
@haslinghuis @nerdCopter |
…etaflight#819)" This reverts commit 3639e69.



Resolved issue of missing slices of data samples arrays in spectrum calc.
The FFT used huge rezerved data length input before.