Skip to content

Commit eafa1bb

Browse files
committed
Code refactoring in src/graph_spectrum_calc.js
1 parent 6a5d9a5 commit eafa1bb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/graph_spectrum_calc.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,9 @@ GraphSpectrumCalc._dataLoadPowerSpectralDensityVsX = function(vsFieldNames, minV
230230
let maxNoise = 0; // Stores the maximum amplitude of the fft over all chunks
231231
let psdLength = 0;
232232
// Matrix where each row represents a bin of vs values, and the columns are amplitudes at frequencies
233-
const matrixFftOutput = new Array(NUM_VS_BINS).fill(null).map(() => (new Float64Array(fftChunkLength * 2)).fill(-70));
233+
const matrixFftOutput = new Array(NUM_VS_BINS)
234+
.fill(null)
235+
.map(() => (new Float64Array(Math.floor(fftChunkLength / 2))).fill(-70));
234236

235237
const numberSamples = new Uint32Array(NUM_VS_BINS); // Number of samples in each vs value, used to average them later.
236238

0 commit comments

Comments
 (0)