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

RoomImpulseResponse Transform: Support for stereo/multi-channel IRs #102

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

crlandsc
Copy link

@crlandsc crlandsc commented Dec 14, 2023

When using stereo/multi-channel IRs, this error is thrown:
RuntimeError: a Tensor with 2 elements cannot be converted to Scalar
This is due to -idx[i].item() having multiple entries from the multiple channels.

Adding .min() to -idx[i].min().item() selects the earliest index of all of the channels to rotate the IR by. This makes it compatible with multi-channel IRs and avoids potentially cutting off parts of the IR.

Addendum:
Refactorring window_idx = early_idx[idx, 0].nonzero() to window_idx = early_idx[idx, :].nonzero() is also required to support multi-channel IRs.

@crlandsc crlandsc changed the title Added .min() to support stereo IR rotation. RoomImpulseResponse Transform: Support for stereo/multi-channel IRs Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant