Add Metrogram Transform
Reference Issue
Reference #1909
What does this implement/fix? Explain your changes.
This is currently a draft PR to welcome early feedback.
What's done:
- [x] implementation of
metrogramandinterp_broadcast(for computing the DFT/AC product or Fundamental Tempogram) - [x] API documentation for the same
What's left:
- [x] example for metrogram
- [ ] example for interpolation function
- [ ] tests for metrogram
- [ ] tests for interpolation function
metrogram
Takes in a tempogram, an array of factors, and an aggregate function, and returns the metrogram. If the aggregate is set to None, the product before aggregation is returned.
interp_broadcast
Takes in two ndarrays with their differing positioning data along an axis, and a "target" array of positioning data. Both arrays are interpolated at the target points to make them broadcast-compatible.
Then a user supplied broadcast operation (defaults to np.multiply) is performed on them before returning. If the function is set to None, the broadcast-compatible arrays are returned separately.
Any other comments?
Do we want metrogram to optionally directly accept audio as y?
Dropping a note to indicate that I see this PR and will get to review it as soon as I have time.
Meanwhile: would it be possible for you to re-target this PR against the 1.0 dev branch? I don't expect there to be much in the way of conflicts here, but the plan right now is to prioritize 1.0 above a point release on 0.11.
Feel free to take your time! :smile:
I've switched the target branch and got no effective merge conflicts.
Codecov Report
:x: Patch coverage is 39.47368% with 23 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 98.34%. Comparing base (8b92a65) to head (3de0470).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| librosa/util/utils.py | 40.74% | 16 Missing :warning: |
| librosa/feature/rhythm.py | 36.36% | 7 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## 1.0.0dev #1986 +/- ##
============================================
- Coverage 98.81% 98.34% -0.47%
============================================
Files 34 34
Lines 4801 4837 +36
============================================
+ Hits 4744 4757 +13
- Misses 57 80 +23
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 98.34% <39.47%> (-0.47%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Thank you for the review! I've addressed most of the minor comments. I'll work on the examples next.
Also, James Cozens (who authored this method) found us working on this PR! He has kindly offered his help if needed and will be sharing a preprint with more details on his implementation.