PTB-M4D / PyDynamic

Python library for the analysis of dynamic measurements
https://ptb-m4d.github.io/PyDynamic/
GNU Lesser General Public License v3.0
25 stars 13 forks source link

Add elementwise multiplication of signals #328

Closed mgrub closed 4 months ago

mgrub commented 5 months ago

Element-wise multiplication (Hadamar product) is a useful operation to enable applications like "windowing" and "gating" of signals in the time and frequency domain. Two new functions are introduced with this PR.

hadamar_product performs element-wise multiplication of two complex vectors of same length with full covariance uncertainty propagation according to the GUM.

window_application applies a real-valued window to a complex-valued signal. It relies on hadamar_product for the calculations.

Tests against slower implementations that use the non-optimized matrix multiplications are provided.

Docs can be found here: https://pydynamic.readthedocs.io/en/add_hadamar_product_unc/PyDynamic.uncertainty.html#module-PyDynamic.uncertainty.propagate_multiplication

codecov-commenter commented 4 months ago

Codecov Report

Attention: Patch coverage is 96.22642% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 77.53%. Comparing base (67e664d) to head (93a79d1).

Files Patch % Lines
.../PyDynamic/uncertainty/propagate_multiplication.py 96.15% 0 Missing and 2 partials :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #328 +/- ## ========================================== + Coverage 77.32% 77.53% +0.21% ========================================== Files 29 30 +1 Lines 2280 2333 +53 Branches 372 378 +6 ========================================== + Hits 1763 1809 +46 - Misses 390 394 +4 - Partials 127 130 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.