Pyroomacoustics is a package for audio signal processing for indoor applications. It was developed as a fast prototyping platform for beamforming algorithms in indoor scenarios.
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 factory object reads the file and optionally performs interpolation
dir_factory = SOFADirectivityFactory(
path=Path(DEFAULT_SOFA_PATH) / sofa_file_name,
DIRPAT_pattern_enum=pattern_id,
source=sofa_info[sofa_file_name]["type"] == "sources",
fs=room.fs,
interp_order=interp_order,
interp_n_points=1000,
)
# we use the factory object to create directivities. This allows to reuse the pattern for
# multiple objects without having to redo the interpolation
directivity = dir_factory.create(
orientation=DirectionVector(azimuth=0, colatitude=0, degrees=False)
)
# TODO: make a short cut object that would fuse the two above in case we
# only need one source
TODO
[ ] documentation
[ ] changelog
[ ] maybe a shortcut function that would fuse the factory/creation workflow
[ ] 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.
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".
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.
TODO
[ ] documentation [ ] changelog [ ] maybe a shortcut function that would fuse the factory/creation workflow [ ] 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.Co-authored-by: prerak23 prerak23@github.com
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.
nosetests
orpy.test
at the root of the repo ?Happy PR :smiley: