diff --git a/mosqito/sq_metrics/roughness/roughness_dw/_roughness_dw_main_calc.py b/mosqito/sq_metrics/roughness/roughness_dw/_roughness_dw_main_calc.py index 7fe1e50e..1b23c16f 100644 --- a/mosqito/sq_metrics/roughness/roughness_dw/_roughness_dw_main_calc.py +++ b/mosqito/sq_metrics/roughness/roughness_dw/_roughness_dw_main_calc.py @@ -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): """ diff --git a/mosqito/sq_metrics/roughness/roughness_dw/roughness_dw.py b/mosqito/sq_metrics/roughness/roughness_dw/roughness_dw.py index 8262dcab..5325b3b9 100644 --- a/mosqito/sq_metrics/roughness/roughness_dw/roughness_dw.py +++ b/mosqito/sq_metrics/roughness/roughness_dw/roughness_dw.py @@ -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)