You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a question about how to evaluate SIR and SDR for mono wav file.
How do I evaluate SIR and SDR for mono wav files?
I have the following mono wav files.
Mixed voice and noise audio
Voice audio (ref.wav)
Noise audio
Inference file (est.wav)
The length of the wav file is 4 seconds. The sampling frequency is 16k Hz.
I calculated the SIR of the mono wav file and it was Inf.
As I asked in Issue #12, the SIR was Inf for the following code.
from scipy.io import wavfile
import numpy as np
import fast_bss_eval
_, ref = wavfile.read("./data/ref.wav")
_, est = wavfile.read("./data/est.wav")
ref = ref[None, ...]
est = est[None, ...]
# compute the metrics
sdr, sir, sar = fast_bss_eval.bss_eval_sources(ref, est, compute_permutation=False)
print('sdr:', sdr)
print('sir:', sir)
print('sar:', sar)
However, I would like to evaluate the SIR with a mono wav file.
To avoid the SIR to be Inf, I divided the wav file into 4 parts. Is the following code able to evaluate SIR and SDR correctly?
This is indeed a good question! I don't think splitting the file is the correct way to do it.
In your case, you have access to both the clean speech and the noise, so the best is to use both as references.
fromscipy.ioimportwavfileimportnumpyasnpimportfast_bss_eval# assume all files are mono_, speech_ref=wavfile.read("./data/ref.wav")
_, noise_ref=wavfile.read("./data/noise.wav")
_, est=wavfile.read("./data/est.wav")
ref=np.stack([speech_ref, noise_ref], axis=0)
# I think it should work also with `est[None, ...]`, but to be sure make est# the same number of channels as refest=np.stack([est, est], axis=0)
# compute the metricssdr, sir, sar=fast_bss_eval.bss_eval_sources(ref, est, compute_permutation=False)
print('sdr:', sdr[0])
print('sir:', sir[0])
print('sar:', sar[0])
Hello.
I have a question about how to evaluate SIR and SDR for mono wav file.
How do I evaluate SIR and SDR for mono wav files?
I have the following mono wav files.
The length of the wav file is 4 seconds. The sampling frequency is 16k Hz.
I calculated the SIR of the mono wav file and it was Inf.
As I asked in Issue #12, the SIR was Inf for the following code.
However, I would like to evaluate the SIR with a mono wav file.
To avoid the SIR to be Inf, I divided the wav file into 4 parts. Is the following code able to evaluate SIR and SDR correctly?
What signals are needed for each channel of ref and est?
Best regards.
The text was updated successfully, but these errors were encountered: