Skip to content
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

Support for recorded source/mic directivities from DIRPAT database (#259) #302

Merged
merged 66 commits into from
Oct 29, 2024

Conversation

fakufaku
Copy link
Collaborator

@fakufaku fakufaku commented Feb 2, 2023

This PR is to integrate the work done by @prerak23 into the master branch:

Generalize for other SOFA files

The goal is to generalize what has been done for DIRPAT by @prerak23 to all SOFA files.
The target syntax is as follows.

# the file reader object reads the file and optionally performs interpolation
# if the file contains multiple directivities, they are all read
hrtf = MeasuredDirectivityFile(
    path="hrtf_file.sofa",
    fs=fs,
    interp_order=12,
    interp_n_points=1000,
)

# orientations can be provided as rotation matrices
orientation = Rotation3D([colatitude_deg, azimuth_deg], "yz", degrees=True)

# we can then choose which directivities we want from the file
dir_left = hrtf.get_mic_directivity("left", orientation=orientation)
dir_right = hrtf.get_mic_directivity("right", orientation=orientation)

TODO

  • documentation
  • changelog
  • Read multiple objects from a single file to be able to simulate mic arrays more smoothly, e.g. eigenmike. This could be implemented by detecting the multiple channels after the call to get_response that would return a (n_image_sources, n_channels, n_taps) array.
  • Implement 3D rotations with Euler angles

Co-authored-by: prerak23 [email protected]

Thanks for sending a pull request (PR), we really appreciate that! Before hitting the submit button, we'd be really glad if you could make sure all the following points have been cleared.

Please also refer to the doc on contributing for more details. Even if you can't check all the boxes below, do not hesitate to go ahead with the PR and ask for help there.

  • Are there docstrings ? Do they follow the numpydoc style ?
  • Have you run the tests by doing nosetests or py.test at the root of the repo ?
  • Have you checked that the doc builds properly and that any new file has been added to the repo ? How to do that is covered in the documentation.
  • Is there a unit test for the proposed code modification ? If the PR addresses an issue, the test should make sure the issue is fixed.
  • Last but not least, did you document the proposed change in the CHANGELOG file ? It should go under "Unreleased".

Happy PR 😃

prerak23 and others added 5 commits February 2, 2023 11:53
)

* This is a pretty big commit that includes loading recorded directivity files and using them in the simulation
* Supports source/receiver for shoebox rooms
* Interpolation in spherical harmonic domain
* Adds option for using minimum phase filters
---------

Co-authored-by: prerak23 <[email protected]>
…r the SOFA directivities. Adds samples some pre-generated samples for the tests. Removes some print statements from room.py.
…rical/cartesian conversion functions from doa sub-package. Adds a generalized pinv computation function. Adds a new plotting function. Moves doa sub-package fibonacci mapping to a dedicated function to make it available everywhere.
…ation. Adds also a generalized version of the method for the case where the measurement points are not on a grid. Adds tests for all this. Changes the regression test data files for sofa interpolation.
…s. Modifies slightly doa.GridSphere object so that it can be used to hold simple spherical grids without overhead.
…ore SOFA files. Fixes a bug with using cardioid/sofa responses where the cardioid would expect degrees, but got radians. Re-generates the test files for SOFA measured respones. Fixes a bug in DirectionVector where the degrees argument for the getter methods of azimuth and colatitude was ignored.
@fakufaku fakufaku mentioned this pull request Jun 14, 2023
5 tasks
@fakufaku
Copy link
Collaborator Author

@prerak23
How are you doing?
I have made good progress, and I am feeling good about releasing things soon.
Would you mind taking a look at the current code?
I have also created some documentation here
(I don't have your new email address, so please send me an email)

@fakufaku fakufaku self-assigned this May 28, 2024
@fakufaku fakufaku requested a review from prerak23 May 28, 2024 07:14
@fakufaku fakufaku merged commit 38871cc into master Oct 29, 2024
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants