2

I am reading the documentation of scipy.signal.stft function. My question: is the 'noverlap' parameter of this function equivalent with STFT hop size?

Peter K.
  • 25,714
  • 9
  • 46
  • 91
skeleton32
  • 29
  • 5

2 Answers2

1

The hop size $M$ is the number of samples between each successive FFT. The 'noverlap' parameter is the number of samples $n$ to overlap between segments (and will default to $N/2$ where $N$ is the FFT frame size). The relationship between hop size, frame size and overlap is:

$M$ = $N - n$

If there is no overlap then this would simply be the total number of samples in the FFT frame. In certain uses the overlap is given as an "Overlap Factor", where a factor of 2 would refer to a 50% overlap (stated here in case that was a source of the OP's confusion; 'noverlap' is clearly stated in the documentation as the number of samples and does not represent "overlap factor").

Dan Boschen
  • 50,942
  • 2
  • 57
  • 135
1

For those ending up here, as stated in 'Notes' at the official SciPy documentation:

hop size = nperseg - noverlap

Synapse
  • 111
  • 1