kamo-naoyuki / pySIIB

A python implementation of Speech intelligibility in bits (SIIB)
GNU General Public License v3.0
24 stars 7 forks source link

How to use for denoised audio (which is the 'clean' signal?) #1

Open youssefavx opened 2 years ago

youssefavx commented 2 years ago

Hey! Thank you so much for making this super helpful library.

In the read me, the usage says:

from pysiib import SIIB
from scipy.io import wavefile

fs, x = wavfile.read("clean.wav")
fs, y = wavfile.read("distorted.wav")

# SIIB with MI function in C-implementation (this is used in [1],[2])
SIIB(x, y, fs)
# SIIB with MI function in python implementation
SIIB(x, y, fs, use_MI_Kraskov=False)
# SIIB^Gauss
SIIB(x, y, fs, gauss=True)

My first question is:

  1. Does order matter? Meaning, does it matter whether the clean and distorted signal are like so: SIIB(y, x fs) as opposed to SIIB(x, y, fs)?
  2. If it does matter... if I'm trying to measure how much a denoising process has affected a signal, what is classified as clean and what is classified as distorted? Is 'clean' in this context the original noisy signal, and 'distorted' the new denoised signal?

Thanks again! No pressure to respond if you don't have time.

youssefavx commented 2 years ago

Also, I've tested the algorithm on a bunch of different noisy files and I get numbers that vary wildly from 40 to 1000. There doesn't seem to be a kind of 'fixed' score (above 50, it's all unintelligible), it seems to be relative to the given file. Or am I doing something wrong?

I was planning on using this to fade in a noisy signal when the denoised version made intelligibility poorer rather than better...but since it varies so much it's hard to pick a threshold ("Over 700, I'll start fading in the signal") because it's different for every new noisy file (since the noise varies and the denoising success varies).

kamo-naoyuki commented 2 years ago

Does order matter? Meaning, does it matter whether the clean and distorted signal are like so: SIIB(y, x fs) as opposed to SIIB(x, y, fs)?

SIIB(y, x fs) is not identical to SIIB(x, y, fs) because SIIB performs on the vad region of the clean reference; https://github.com/kamo-naoyuki/pySIIB/blob/226c2f3d92800d4587bba95d14b11aba50d91076/pysiib.py#L97-L100

If it does matter... if I'm trying to measure how much a denoising process has affected a signal, what is classified as clean and what is classified as distorted? Is 'clean' in this context the original noisy signal, and 'distorted' the new denoised signal?

I'm not sure what you mean. The clean signal should be a noise-free signal, i.e. only speech.

Also, I've tested the algorithm on a bunch of different noisy files and I get numbers that vary wildly from 40 to 1000. There doesn't seem to be a kind of 'fixed' score (above 50, it's all unintelligible), it seems to be relative to the given file. Or am I doing something wrong?

Actually, I just only ported this code from the author's one for my purpose. I recommend you ask the author deep questions.

youssefavx commented 2 years ago

SIIB(y, x fs) is not identical to SIIB(x, y, fs) because SIIB performs on the vad region of the clean reference;

Ah! Thank you for answering.

I'm not sure what you mean. The clean signal should be a noise-free signal, i.e. only speech.

Ah okay, sorry I meant that, let's say that:

  1. I have a noisy signal (recorded on tape in an old format, so I don't have an original 'clean' noise-free signal of the voice.)
  2. I want to denoise this old noisy recording. I generate a denoised recording using an AI.
  3. Because I don't know if this AI will accurately denoise the signal without artifacts or affecting/distorting the voice in some regions, I want to measure if there was a loss in intelligibility on the denoised signal relative to the original (noisy) signal.

In this case, the clean signal / variable should be data of the denoised signal, and not the original initially noisy old recording?

Actually, I just only ported this code from the author's one for my purpose. I recommend you ask the author deep questions

Will do! Thank you so so much for your help!