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

DSP.jl and Unitful.jl #431

Open
jonschumacher opened this issue Jun 14, 2021 · 1 comment
Open

DSP.jl and Unitful.jl #431

jonschumacher opened this issue Jun 14, 2021 · 1 comment

Comments

@jonschumacher
Copy link
Contributor

jonschumacher commented Jun 14, 2021

Hi,

I just tried to resample a signal which is supplied as Unitful volts.

This runs fine:

julia> test = [1 2 3 4]
1×4 Matrix{Int64}:
 1  2  3  4

julia> resample(test, 1//2, dims=2)
1×2 Matrix{Float64}:
 0.718048  3.40596

But this doesn't

julia> test = [1 2 3 4]u"V"
1×4 Matrix{Quantity{Int64, 𝐋^2 𝐌 𝐈^-1 𝐓^-3, Unitful.FreeUnits{(V,), 𝐋^2 𝐌 𝐈^-1 𝐓^-3, nothing}}}:
 1 V  2 V  3 V  4 V

julia> resample(test, 1//2, dims=2)
ERROR: DimensionError: V and 0.0 are not dimensionally compatible.

Am I missing some important point or is DSP.jl not working together with Unitful (yet)? I could not find any issues related to it, but I think it would be an awesome improvement of the package to be able to work with units.

Cheers
Jonas

@jonschumacher jonschumacher changed the title DSP.j and Unitful.jl DSP.jl and Unitful.jl Jun 17, 2021
@martinholters
Copy link
Member

Sure, if we can make this just work, that would certainly be nice. And we can do this one by one. But someone has to do the work, and apparently, those who have been contributing to DSP so far did not care too much about compatibility with Unitful, so they may not be too motivated to do so now. But if you want to give it a shot, a PR would be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants