Skip to content

Commit

Permalink
updated docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcfee committed Oct 2, 2016
1 parent e5e31f2 commit e31a842
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
14 changes: 8 additions & 6 deletions librosa/core/spectrum.py
Expand Up @@ -53,8 +53,8 @@ def stft(y, n_fft=2048, hop_length=None, win_length=None, window='hann',
If unspecified, defaults to ``win_length = n_fft``.
window : None, function, np.ndarray [shape=(n_fft,)]
- None (default): use an asymmetric Hann window
window : string, tuple, function, or np.ndarray [shape=(n_fft,)]
- a window specification (string or tuple); see `scipy.signal.get_window`
- a window function, such as `scipy.signal.hanning`
- a vector or array of length `n_fft`
Expand Down Expand Up @@ -205,8 +205,8 @@ def istft(stft_matrix, hop_length=None, win_length=None, window='hann',
If unspecified, defaults to `n_fft`.
window : None, function, np.ndarray [shape=(n_fft,)]
- None (default): use an asymmetric Hann window
window : string, tuple, function, np.ndarray [shape=(n_fft,)]
- a window specification (string or tuple); see `scipy.signal.get_window`
- a window function, such as `scipy.signal.hanning`
- a user-specified window vector of length `n_fft`
Expand Down Expand Up @@ -324,8 +324,10 @@ def ifgram(y, sr=22050, n_fft=2048, hop_length=None, win_length=None,
Window length. Defaults to `n_fft`.
See `stft` for details.
window : string, tuple, function, or np.ndarray
Window function to use in ifgram calculation.
window : string, tuple, function, or np.ndarray [shape=(n_fft,)]
- a window specification (string or tuple); see `scipy.signal.get_window`
- a window function, such as `scipy.signal.hanning`
- a user-specified window vector of length `n_fft`
See `stft` for details.
norm : bool
Expand Down
3 changes: 1 addition & 2 deletions librosa/feature/rhythm.py
Expand Up @@ -49,8 +49,7 @@ def tempogram(y=None, sr=22050, onset_envelope=None, hop_length=512,
If `False`, windows are left-aligned.
window : string, function, tuple, or np.ndarray [shape=(win_length,)]
Window function to apply to onset strength function.
By default an asymmetric Hann window.
A window specification as in `core.stft`
norm : {np.inf, -np.inf, 0, float > 0, None}
Normalization mode. Set to `None` to disable normalization.
Expand Down
7 changes: 5 additions & 2 deletions librosa/filters.py
Expand Up @@ -758,7 +758,10 @@ def window_bandwidth(window, default=1.0):

@cache(level=10)
def get_window(window, Nx, fftbins=True):
'''Compute a window function
'''Compute a window function.
This is a wrapper for `scipy.signal.get_window` that additionally
supports callable or pre-computed windows.
Parameters
----------
Expand Down Expand Up @@ -798,7 +801,7 @@ def get_window(window, Nx, fftbins=True):
return window(Nx)

elif isinstance(window, (str, tuple)):
# TODO: if we add more window functions, put that index check here
# TODO: if we add custom window functions in librosa, call them here

return scipy.signal.get_window(window, Nx, fftbins=fftbins)
elif isinstance(window, (np.ndarray, list)):
Expand Down

0 comments on commit e31a842

Please sign in to comment.