@@ -153,55 +153,6 @@ def window_sumsquare(
153153 n_fft = 2048 ,
154154 dtype = np .float32 ,
155155 norm = None , ):
156- """Compute the sum-square envelope of a window function at a given hop length.
157-
158- This is used to estimate modulation effects induced by windowing observations
159- in short-time Fourier transforms.
160-
161- Parameters
162- ----------
163- window : string, tuple, number, callable, or list-like
164- Window specification, as in `get_window`
165-
166- n_frames : int > 0
167- The number of analysis frames
168-
169- hop_length : int > 0
170- The number of samples to advance between frames
171-
172- win_length : [optional]
173- The length of the window function. By default, this matches ``n_fft``.
174-
175- n_fft : int > 0
176- The length of each analysis frame.
177-
178- dtype : np.dtype
179- The data type of the output
180-
181- Returns
182- -------
183- wss : np.ndarray, shape=``(n_fft + hop_length * (n_frames - 1))``
184- The sum-squared envelope of the window function
185-
186- Examples
187- --------
188- For a fixed frame length (2048), compare modulation effects for a Hann window
189- at different hop lengths:
190-
191- >>> n_frames = 50
192- >>> wss_256 = librosa.filters.window_sumsquare('hann', n_frames, hop_length=256)
193- >>> wss_512 = librosa.filters.window_sumsquare('hann', n_frames, hop_length=512)
194- >>> wss_1024 = librosa.filters.window_sumsquare('hann', n_frames, hop_length=1024)
195-
196- >>> import matplotlib.pyplot as plt
197- >>> fig, ax = plt.subplots(nrows=3, sharey=True)
198- >>> ax[0].plot(wss_256)
199- >>> ax[0].set(title='hop_length=256')
200- >>> ax[1].plot(wss_512)
201- >>> ax[1].set(title='hop_length=512')
202- >>> ax[2].plot(wss_1024)
203- >>> ax[2].set(title='hop_length=1024')
204- """
205156 if win_length is None :
206157 win_length = n_fft
207158
0 commit comments