Commit 214691e8 authored by Jan Kiene's avatar Jan Kiene
Browse files

return inf on exact same signal

parent 8aa62d03
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -541,6 +541,10 @@ def ssnr(
    ref_sig_norm = ref_sig / -np.iinfo(np.int16).min
    test_sig_norm = test_sig / -np.iinfo(np.int16).min

    diff_norm = ref_sig_norm - test_sig_norm
    if np.all(diff_norm == 0):
        return np.asarray([np.inf] * ref_sig_norm.shape[1])

    denom_add = 10**-13 * len_seg
    segment_counter = np.zeros(ref_sig.shape[1])
    for ref_seg, test_seg in zip(