Skip to content

Commit

Permalink
[CC] correction of nseg in case of a signal <= 200ms
Browse files Browse the repository at this point in the history
  • Loading branch information
wantysal committed May 5, 2022
1 parent 213819e commit 86c39fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
_ear_filter_coeff,
)
from mosqito.utils.conversion import freq2bark, db2amp, amp2db, bark2freq
import matplotlib.pyplot as plt

def _roughness_dw_main_calc(spec, freq_axis, fs, gzi, hWeight):
"""
Expand Down
5 changes: 4 additions & 1 deletion mosqito/sq_metrics/roughness/roughness_dw/roughness_dw.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ def roughness_dw(signal, fs=None, overlap=0.5, is_sdt_output=False):
sig, time = time_segmentation(
signal, fs, nperseg=nperseg, noverlap=noverlap, is_ecma=False
)
nseg = sig.shape[1]
if len(sig.shape) == 1:
nseg = 1
else:
nseg = sig.shape[1]

spec, _ = spectrum(sig, fs, nfft="default", window="blackman", db=False)

Expand Down

0 comments on commit 86c39fb

Please sign in to comment.