Skip to content

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