audio icon indicating copy to clipboard operation
audio copied to clipboard

torchaudio.functional.resample() doesn't work with complex types

Open pfeatherstone opened this issue 2 years ago • 2 comments

🐛 Describe the bug

torchaudio.functional.resample() doesn't work with complex types.

Example:

x = torch.randn(1024, 2)
x = torch.view_as_complex(x)
y = torchaudio.functional.resample(x, 1.0, 2.0)

Gives error:

RuntimeError: "arange_cpu" not implemented for 'ComplexFloat'

Versions

>>> import torch
>>> import torchaudio
>>> torch.__version__
'2.0.0+cu117'
>>> torchaudio.__version__
'2.0.1+cu117'

pfeatherstone avatar Apr 24 '23 15:04 pfeatherstone

Hi @pfeatherstone, thank you for opening the issue. Could you share more details on your use case for us to figure out to how to address this?

hwangjeff avatar Apr 25 '23 19:04 hwangjeff

I wanted to resample some IQ data. It's not a problem. The filter is real-valued so you can resample real and imaginary separately.

pfeatherstone avatar Apr 25 '23 21:04 pfeatherstone