Skip to content

Commit

Permalink
improve docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
mwprestonjr committed Apr 16, 2024
1 parent acf6450 commit ee965fd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
22 changes: 21 additions & 1 deletion neurodsp/spectral/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,27 @@ def check_spg_settings(fs, window, nperseg, noverlap):


def check_mt_settings(n_samples, fs, bandwidth, n_tapers):
"""Check settings used for computing spectra using the multitaper method """
"""Check settings used for computing spectra using the multitaper method.
Parameters
----------
n_samples : int
Number of samples in the signal.
fs : float
Sampling rate, in Hz.
bandwidth : float or None
Bandwidth of the multitaper window, in Hz. If None, will use
8 * fs / n_samples.
n_tapers : int or None
Number of tapers to use. If None, will use bandwidth * n_samples / fs
Returns
-------
nw : float
Standardized half bandwidth (used to compute DPSS)
n_tapers : int
Number of tapers.
"""

# set bandwidth
if bandwidth is None:
Expand Down
18 changes: 10 additions & 8 deletions neurodsp/spectral/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,16 +271,18 @@ def compute_spectrum_multitaper(sig, fs, bandwidth=None, n_tapers=None,
Time series.
fs : float
Sampling rate, in Hz.
bandwidth : float
Frequency bandwidth of multi-taper window function.
n_tapers : int.
Number of slepian windows used to weight the signal.
low_bias : bool
bandwidth : float, optional
Frequency bandwidth of multi-taper window function. Default is
8 * fs / n_samples.
n_tapers : int, optional
Number of slepian windows used to compute the spectrum. Default is
bandwidth * n_samples / fs.
low_bias : bool, optional
If True, only use tapers with concentration ratio > 0.9. Default is
True.
eigenvalue_weighting : bool
If True, weight spectral estimates by their concentration ratios before
combining. Default is True.
eigenvalue_weighting : bool, optional
If True, weight spectral estimates by the concentration ratio of
their respective tapers before combining. Default is True.
Returns
-------
Expand Down

0 comments on commit ee965fd

Please sign in to comment.