Skip to content

Commit 712e182

Browse files
committed
Added computing of maximal points per segment PSD values
1 parent 1e00e03 commit 712e182

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/graph_spectrum.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export function FlightLogAnalyser(flightLog, canvas, analyserCanvas) {
155155

156156
case SPECTRUM_TYPE.POWER_SPECTRAL_DENSITY:
157157
fftData = GraphSpectrumCalc.dataLoadPSD(analyserZoomY);
158+
analyserSegmentLengthPSD.prop("max", fftData.maximalSegmentsLength);
158159
break;
159160

160161
case SPECTRUM_TYPE.FREQUENCY:

src/graph_spectrum_calc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ GraphSpectrumCalc.dataLoadPSD = function(analyserZoomY) {
125125
overlapCount = 0;
126126
} else {
127127
pointsPerSegment = this._pointsPerSegmentPSD;
128-
overlapCount = pointsPerSegment / 2;
128+
overlapCount = pointsPerSegment * 3 / 4;
129129
}
130130

131131
const psd = this._psd(flightSamples.samples, pointsPerSegment, overlapCount);
@@ -139,6 +139,7 @@ GraphSpectrumCalc.dataLoadPSD = function(analyserZoomY) {
139139
minimum: psd.min,
140140
maximum: psd.max,
141141
maxNoiseFrequency: psd.maxNoiseFrequency,
142+
maximalSegmentsLength: this.getNearPower2Value(flightSamples.samples.length),
142143
};
143144
return psdData;
144145
};

0 commit comments

Comments
 (0)