@@ -605,21 +605,21 @@ GraphSpectrumCalc._psd = function(samples, pointsPerSegment, overlapCount, scal
605
605
606
606
607
607
/**
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
609
609
*/
610
- GraphSpectrumCalc . _fft_segmented = function ( samples , n_per_seg , n_overlap ) {
610
+ GraphSpectrumCalc . _fft_segmented = function ( samples , pointsPerSegment , overlapCount ) {
611
611
const samplesCount = samples . length ;
612
612
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 ) ;
615
615
616
616
if ( userSettings . analyserHanning ) {
617
- this . _hanningWindow ( fftInput , n_per_seg ) ;
617
+ this . _hanningWindow ( fftInput , pointsPerSegment ) ;
618
618
}
619
619
620
620
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 ++ ) {
623
623
const re = fftComplex [ 2 * i ] ;
624
624
const im = fftComplex [ 2 * i + 1 ] ;
625
625
magnitudes [ i ] = Math . hypot ( re , im ) ;
0 commit comments