Skip to content

Commit 4e3ebea

Browse files
committed
Max noise definition low frequency limit is changed from 100Hz to 50Hz for PSD chart
1 parent 8350ecf commit 4e3ebea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/graph_spectrum_calc.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ GraphSpectrumCalc.dataLoadPSD = function(analyserZoomY) {
117117
pointsPerSegment *= 2 ** Math.floor(multipler / 2);
118118
}
119119
pointsPerSegment = Math.min(pointsPerSegment, flightSamples.samples.length);
120-
const overlapCount = pointsPerSegment / 2;
120+
const overlapCount = Math.floor(pointsPerSegment / 2);
121121

122122
const psd = this._psd(flightSamples.samples, pointsPerSegment, overlapCount);
123123

@@ -556,7 +556,7 @@ GraphSpectrumCalc._psd = function(samples, pointsPerSegment, overlapCount, scal
556556
let min = 1e6,
557557
max = -1e6;
558558
const maxFrequency = (this._blackBoxRate / 2.0);
559-
const noise100HzIdx = 100 / maxFrequency * dataCount;
559+
const noise50HzIdx = 50 / maxFrequency * dataCount;
560560
const noise3HzIdx = 3 / maxFrequency * dataCount;
561561
let maxNoiseIdx = 0;
562562
let maxNoise = -100;
@@ -578,7 +578,7 @@ GraphSpectrumCalc._psd = function(samples, pointsPerSegment, overlapCount, scal
578578
min = Math.min(psdOutput[i], min);
579579
max = Math.max(psdOutput[i], max);
580580
}
581-
if (i > noise100HzIdx && psdOutput[i] > maxNoise) {
581+
if (i > noise50HzIdx && psdOutput[i] > maxNoise) {
582582
maxNoise = psdOutput[i];
583583
maxNoiseIdx = i;
584584
}

0 commit comments

Comments
 (0)