Vectorized utility functions: abs2, unit phasor, others?
See original GitHub issueDescription
It would be useful to have an efficient function for getting magnitude-squared (power) from real or complex variables. This came up in offline discussion of #742 , where abs
is doing unnecessary work if we actually want power anyway.
This could be efficiently accomplished by using numba.vectorize
to make a ufunc out of x * x.conj()
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:20 (20 by maintainers)
Top Results From Across the Web
Ufuncs for complex numbers · Issue #13179 · numpy ... - GitHub
This is a tracker for a number of requests for making working with complex numbers a bit easier/faster. Get just the normalized number...
Read more >Source code for librosa.util.utils
#!/usr/bin/env python # -*- coding: utf-8 -*- """Utility functions""" from ... Generate a vector >>> data = np.ones(5) >>> librosa.util.pad_center(data, ...
Read more >A Unified Object-Oriented Language for Physical Systems ...
Abstract. This document defines the Modelica1 language, version 3.1, which is developed by the Modelica. Association, a non-profit ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A quick list of places where
abs2
would be useful:autocorrelate
https://github.com/librosa/librosa/blob/25538adb3aed3485a06e60b6dad88be3d540f0c2/librosa/core/audio.py#L848rms
https://github.com/librosa/librosa/blob/25538adb3aed3485a06e60b6dad88be3d540f0c2/librosa/feature/spectral.py#L948-L961icqt
https://github.com/librosa/librosa/blob/25538adb3aed3485a06e60b6dad88be3d540f0c2/librosa/core/constantq.py#L717update: we have a PR! 🎉 https://github.com/scipy/scipy/pull/15390