Skip to content

Commit ee5e5ca

Browse files
committed
Code style improvement
1 parent 86423e9 commit ee5e5ca

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/graph_spectrum_calc.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -605,21 +605,21 @@ GraphSpectrumCalc._psd = function(samples, pointsPerSegment, overlapCount, scal
605605

606606

607607
/**
608-
* Compute FFT for samples segments by lenghts as n_per_seg with n_overlap overlap points count
608+
* Compute FFT for samples segments by lenghts as pointsPerSegment with overlapCount overlap points count
609609
*/
610-
GraphSpectrumCalc._fft_segmented = function(samples, n_per_seg, n_overlap) {
610+
GraphSpectrumCalc._fft_segmented = function(samples, pointsPerSegment, overlapCount) {
611611
const samplesCount = samples.length;
612612
let output = [];
613-
for (let i = 0; i <= samplesCount - n_per_seg; i += n_per_seg - n_overlap) {
614-
const fftInput = samples.slice(i, i + n_per_seg);
613+
for (let i = 0; i <= samplesCount - pointsPerSegment; i += pointsPerSegment - overlapCount) {
614+
const fftInput = samples.slice(i, i + pointsPerSegment);
615615

616616
if (userSettings.analyserHanning) {
617-
this._hanningWindow(fftInput, n_per_seg);
617+
this._hanningWindow(fftInput, pointsPerSegment);
618618
}
619619

620620
const fftComplex = this._fft(fftInput);
621-
const magnitudes = new Float64Array(n_per_seg / 2);
622-
for (let i = 0; i < n_per_seg / 2; i++) {
621+
const magnitudes = new Float64Array(pointsPerSegment / 2);
622+
for (let i = 0; i < pointsPerSegment / 2; i++) {
623623
const re = fftComplex[2 * i];
624624
const im = fftComplex[2 * i + 1];
625625
magnitudes[i] = Math.hypot(re, im);

0 commit comments

Comments
 (0)