File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1717 MAX_ANALYSER_LENGTH = 300 * 1000 * 1000 , // 5min
1818 WARNING_RATE_DIFFERENCE = 0.05 ,
1919 MAX_RPM_HZ_VALUE = 800 ,
20- RPM_AXIS_TOP_MARGIN_PERCENT = 2 ;
20+ RPM_AXIS_TOP_MARGIN_PERCENT = 2 ,
21+ MIN_SPECTRUM_SAMPLES_COUNT = 2048 ;
2122export const NUM_VS_BINS = 100 ;
2223
2324export const GraphSpectrumCalc = {
@@ -410,7 +411,14 @@ GraphSpectrumCalc._getFlightSamplesFreq = function(scaled = true) {
410411 }
411412
412413 // The FFT input size is power 2 to get maximal performance
413- const fftBufferSize = this . getNearPower2Value ( samplesCount ) ;
414+ // Limit fft input count for simple spectrum chart to get normal charts plot quality
415+ let fftBufferSize ;
416+ if ( scaled && samplesCount < MIN_SPECTRUM_SAMPLES_COUNT ) {
417+ fftBufferSize = MIN_SPECTRUM_SAMPLES_COUNT ;
418+ } else {
419+ fftBufferSize = this . getNearPower2Value ( samplesCount ) ;
420+ }
421+
414422 return {
415423 samples : samples . slice ( 0 , fftBufferSize ) ,
416424 count : samplesCount ,
You can’t perform that action at this time.
0 commit comments