Skip to content

Commit c3423d4

Browse files
committed
Code refactoring: using of named constant
1 parent 800eadb commit c3423d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/graph_spectrum_calc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,10 @@ GraphSpectrumCalc._dataLoadPowerSpectralDensityVsX = function(vsFieldNames, minV
237237
let maxNoise = 0; // Stores the maximum amplitude of the fft over all chunks
238238
const psdLength = Math.floor(fftChunkLength / 2);
239239
// Matrix where each row represents a bin of vs values, and the columns are amplitudes at frequencies
240-
const backgroundValue = -200;
240+
const BACKGROUND_PSD_VALUE = -200;
241241
const matrixPsdOutput = new Array(NUM_VS_BINS)
242242
.fill(null)
243-
.map(() => (new Float64Array(psdLength)).fill(backgroundValue));
243+
.map(() => (new Float64Array(psdLength)).fill(BACKGROUND_PSD_VALUE));
244244

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

0 commit comments

Comments
 (0)