DavidDiazGuerra / gpuRIR

Python library for Room Impulse Response (RIR) simulation with GPU acceleration
GNU Affero General Public License v3.0
477 stars 91 forks source link

Source Directivity #16

Closed schmiph2 closed 2 years ago

schmiph2 commented 3 years ago

Hi David

Thank you for this great library! Do you have plans to include the directivity of the sources in the library? Would it even be possible to add them to your library?

DavidDiazGuerra commented 3 years ago

Hi schmiph2,

Including non omnidirectional sources in the library is a great idea, but I'm afraid I don't have time time to implement it in the near future. Nevertheless, if anyone wants to try to do it, it should be possible and, actually, not too difficult.

The directivity of the receiver is included in: https://github.com/DavidDiazGuerra/gpuRIR/blob/c1279cd94edf122a565c0973e694ef279829ebbc/src/gpuRIR_cuda.cu#L342 through the function mic_directivity: https://github.com/DavidDiazGuerra/gpuRIR/blob/c1279cd94edf122a565c0973e694ef279829ebbc/src/gpuRIR_cuda.cu#L132 This function first computes the angle between the steering vector of the microphone and the vector with the direction of arrival (DOA) of the image source and then apply the desired directivity pattern.

The directivity of the sources could be implemented in a similar way, but computing the angle bwtween the steering vector of the source (which should be added as a new parameter of the simulateRIR function) and the normal vector of the first reflection wall.

I'll try to implement it in the future if nobody does it before, but I don't know when I'll have time to do it.

schmiph2 commented 3 years ago

Hi David

Thank you for your answer an the hints for the implementing the source directivity and sorry for my late reply. I will check if I can find some time for the implementation. I will let you know if we start the implementation.

catherine-qian commented 3 years ago

Hi all Thanks for the discussion on this issue. just wondered whether there is an existing RIR generator that can simulate speaking head orientation?

DavidDiazGuerra commented 3 years ago

Hi Catherine,

Pyroomacoustics is one of the most comprehensive acoustic simulation libraries for Python, but I don't know if it includes that feature.

catherine-qian commented 3 years ago

thanks for your reply!