egrinstein / neural_srp

The Neural-SRP method for DOA estimation
13 stars 3 forks source link

fixed snr calculation #3

Closed yezhangyinge closed 4 months ago

yezhangyinge commented 4 months ago

I try this code but found that the SNR which is not calculated correctly. So I fixed it like this.

egrinstein commented 4 months ago

Hi @yezhangyinge, thank you very much for your work!

Could you describe a little bit why it was not working and what you did to change it?

Thanks!

yezhangyinge commented 4 months ago

When calculating the SNR, we use the formula: $SNR = 10log{10}(\frac{ac\ pow}{ac\_ pow\ noise\ now}). $ Therefore, the code:

np.sqrt(
    ac_pow / 10 ** (acoustic_scene["SNR"] / 10)
 )

only calculates the desired ac_pow_noise_now. However, it does not account for the original ac_pow_noise of the interfering signals, resulting in an incorrect computation of the SNR scaler.

yezhangyinge commented 4 months ago

Hi @yezhangyinge, thank you very much for your work!

Could you describe a little bit why it was not working and what you did to change it?

Thanks!

May I ask if my understanding is correct? Or perhaps I didn't explain clearly enough?

egrinstein commented 4 months ago

Hi @yezhangyinge,

Sorry for the delay, I started a new job this week so I've been really busy. Your explanation makes sense, so I will accept the PR.

Thanks again,

Eric