-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
room.plot_rir ignores "global_delay" #247
Comments
Hi @boeddeker , this has come up in some forms several times 😄 Thanks for taking the time to post your questions and suggestions here! Suggestions for improving the doc are also welcome! Fractional Delay FiltersFirst, let me describe briefly what a fractional delay filter is. We start in continuous time; the echoes arrive at the microphone at real valued delays. However, practical requirements means that all we can compute is the RIR at discrete values. One way to do that is to low-pass at
In pyroomacoustics, computing all the sinc functions was actually taking most of the computation time, so I replaced it by a look-up table with linear interpolation. Again, this should not introduce too much distortion. Global DelayThe reason for the global delay is due to the fractional delay filter implemented as a windowed sinc. The filter has ripples in past samples for When you say that the plot is wrong in the example, I guess you mean the time should start at -40 samples, correct ? Or is there any other error ? Of course we could shift all RIR by 40 samples back, but this would truncate the sinc in some cases and this would introduce some high frequency artefacts. I think for most purposes, the global delay is not really an issue, and when it is, we can simply shift all timings by AmplitudeThe reason for the different amplitude is that I have decided to not divide by Also, not that the amplitude is divided by the source-mic distance so that you could get arbitrarily large amplitudes by bringing the source and mic very close. In practice you will always have the physical size of the source/mic limiting the minimal distance, but even like this, limiting the amplitude be smaller than one seems an arbitrary choice. DirectivitiesI tried on my local
|
First, thank you for the explanation and taking the time to write a long response. Fractional Delay Filters and Global DelayThe fractional delay filters and global delay is now clear to me.
I think keeping the values is a good decision. In Habets code, the first peak matches the time of flight.
No, I only observed the wrong starting point. AmplitudeThank you, with the
I never checked what are reasonable values for a RIR, I simply sometimes plot RIRs and observed that the values are smaller than one. I just thought, if I play a signal and then record it at another position, it shouldn't be amplified.
In many cases I agree, but sometimes the scaling is important. DirectivitiesSorry, my fault. Everything is fine. I installed the pyroomacoustics in a new environment and executed the code in an old one. Action pointShould I prepare a PR?
It may be better to write some more text and for that, I think you are better qualified. |
Thanks for your patience! My reply is overdue!!! 😅 If you are willing to do a PR to fix the example that would be fantastic! I also think it may be nice to add some more explanation about the delay in the documentation, but it is also fairly technical, so if you have a suggestion of the right place to do it that would be welcome. And, just a quick note about the scale. I think that especially for DNNs you should not rely on the global scale of the input signals. Even when only using recorded signals, the gain of the amplifier may be set differently for different recordings or train/test time. So in this case it is more realistic to have a systematic normalization of the input signals. |
Hey,
I compared pyroomacoustics with habets image method RIR generation code and was confused by two things:
For the time of flight, I found the warning in the documentation (doc),
but the later example in the documentation ignores it and also
room.plot_rir
ignores it. For the attenuation, I found nothing in the documentation, but maybe you used a different word to describe it.It would be nice, if you could answer me the following questions:
pyroomacoustics
has a global delay? Sorry, if it is already in the documentation, but I didn't found it.Ideas for the documentation/code:
room.plot_rir
.Here is an example that shows:
room.plot_rir
has a wrong x-axis.Note:
from pyroomacoustics.directivities import ...
from the documentation didn't work with my installation of pyroomacoustics.The text was updated successfully, but these errors were encountered: