Skip to content

Feature/new windows#658

Merged
wheeheee merged 11 commits into
JuliaDSP:masterfrom
daniel-s-w:feature/new_windows
May 8, 2026
Merged

Feature/new windows#658
wheeheee merged 11 commits into
JuliaDSP:masterfrom
daniel-s-w:feature/new_windows

Conversation

@daniel-s-w
Copy link
Copy Markdown
Contributor

@daniel-s-w daniel-s-w commented Apr 20, 2026

As suggested in #657 this PR adds two conventional windows to DSP (blackmanharris and flattop), so they do not need manual user implementation with makewindow. The flattop as well as the Blackman-Harris 4-term window coefficients are the same as the ones in MATLAB. Additionally, the blackmanharris function supports the selection of the 3-term minimum sidelobe version (not given in MATLAB).
The gen_winplots.jl has been updated such that the negative values for the flattop window are shown.

closes #657

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.03%. Comparing base (5661658) to head (61f4669).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #658      +/-   ##
==========================================
+ Coverage   98.01%   98.03%   +0.01%     
==========================================
  Files          19       19              
  Lines        3279     3303      +24     
==========================================
+ Hits         3214     3238      +24     
  Misses         65       65              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/windows.jl Outdated
@daniel-s-w
Copy link
Copy Markdown
Contributor Author

Done

Copy link
Copy Markdown
Member

@wheeheee wheeheee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. Maybe the other maintainers have further comments, so I'll just leave this lying around for 2 weeks or so.

Comment thread src/windows.jl Outdated
Comment thread test/windows.jl
Comment thread src/windows.jl Outdated
Copy link
Copy Markdown
Member

@wheeheee wheeheee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small typos.

I'm not sure if it's in there somewhere, but how did you generate the reference data? It would be good to put that in comments near where they are loaded.

Comment thread test/windows.jl Outdated
Comment thread test/windows.jl Outdated
@daniel-s-w
Copy link
Copy Markdown
Contributor Author

I'm not 100% sure about the codecov complaint, as the mentioned lines have been there before. Is this due to some coverage checker update?

@wheeheee
Copy link
Copy Markdown
Member

wheeheee commented May 4, 2026

Yeah, seems to be. It's the same on master, after bumping setup-julia from v2 to v3. You can rebase onto master and add on from there, hopefully it all goes away.

daniel-s-w added 10 commits May 4, 2026 10:52
As described in (On the use of windows for harmonic analysis with the
discrete Fourier
transform)[https://ieeexplore.ieee.org/document/1455106], this commit
adds the derived minimum sidelobe versions of the 4-term and 3-term
blackman harris windows. To not clutter the window function names, the
arbitration is done by an additional named parameter (term), that
decides for the used term number.

To not change to much of the DSP implementation for windows, only the
4-term version is included in the automatic 2D-expansion of the windows,
since this is the one that is available in MATLAB as well.
To preserve the conventional kwargs structure of all windows, the `term`
argument for blackmanharris and nuttall are change into normal
positional arguments. This implies some updates for the tests and the
make_matrix function, but it works quite well. Now it is even possible
to create a two-dimensional nuttall window, where the first dimension
consists of a 4-term nuttall window of arbitrary length while the second
dimension consists of a 3-term nuttall window of a different length.
@daniel-s-w daniel-s-w force-pushed the feature/new_windows branch from 36e7536 to ea694ce Compare May 4, 2026 08:53
Copy link
Copy Markdown
Member

@wheeheee wheeheee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wheeheee wheeheee merged commit a1c471e into JuliaDSP:master May 8, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add more typical window functions (i.e. Blackman-Harris) to the defaults

3 participants