[featuring] - add hanning window function#3124
Merged
angeloskath merged 1 commit intoml-explore:mainfrom Feb 16, 2026
Merged
Conversation
angeloskath
requested changes
Feb 15, 2026
Member
angeloskath
left a comment
There was a problem hiding this comment.
Thanks! I left some comments after these we can merge it.
b42e5ec to
37e7a3c
Compare
37e7a3c to
00f7403
Compare
Contributor
Author
|
Thanks for the feedback! I've updated the implementation as discussed:
Ready for another look! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements the Hanning window function (
mlx.core.hanning), bringing MLX closer to feature parity with NumPy's signal processing capabilities (numpy.hanning).Window functions are essential for audio processing and various signal analysis tasks.
Implementation Details
hanninginmlx/ops.cppusing existing primitives (arange,cos,multiply,subtract). UsedM_PIfrom<cmath>for precision.python/src/ops.cppundermlx.core.Test Plan
I have verified the implementation locally against NumPy to ensure numerical accuracy.
Verification script:
Unit Tests:
Added a test case in python/tests/test_ops.py covering standard usage, edge cases (M=1), and empty input (M=0).
Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes