Skip to content

Commit 0d2b037

Browse files
committed
Added computing of PSD - Power Spectral Density for spectrum chart
1 parent a263152 commit 0d2b037

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/graph_spectrum_calc.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ GraphSpectrumCalc.dataLoadPSD = function(analyserZoomY) {
110110
const flightSamples = this._getFlightSamplesFreq(false);
111111

112112
let pointsPerSegment = 512;
113-
const multiplier = Math.floor(1 / analyserZoomY); // 0. ... 10
113+
const multipiler = Math.floor(1 / analyserZoomY); // 0. ... 10
114114
if (multipiler == 0) {
115115
pointsPerSegment = 256;
116-
} else if (multiplier > 1) {
117-
pointsPerSegment *= 2 ** Math.floor(multiplier / 2);
116+
} else if (multipiler > 1) {
117+
pointsPerSegment *= 2 ** Math.floor(multipiler / 2);
118118
}
119119
pointsPerSegment = Math.min(pointsPerSegment, flightSamples.samples.length);
120120
const overlapCount = Math.floor(pointsPerSegment / 2);
@@ -561,7 +561,7 @@ GraphSpectrumCalc._psd = function(samples, pointsPerSegment, overlapCount, scal
561561
psdOutput: new Float64Array(0),
562562
min: 0,
563563
max: 0,
564-
maxNoiseIdx: 0
564+
maxNoiseIdx: 0,
565565
};
566566
}
567567
const maxFrequency = (this._blackBoxRate / 2.0);

0 commit comments

Comments
 (0)