Let users set the amplified band in Hz (--freq-low/--freq-high) - #65
Merged
Merged
Conversation
-w is a filter width in frames: its meaning changes with the frame rate, and the upper edge was fixed by the width-2 smoothing pass. With --freq-low/--freq-high the pipeline uses an ideal temporal band-pass (bandpass_1d, FFT of a symmetrically extended series; GPU path too): phase += (k - 1) * bandpass(phase). On a synthetic test with 0.8-2 Hz and k=10, a 1.2 Hz oscillation is amplified 9.2x while 0.3 Hz and 5 Hz stay at 1.0x. The Parameters block prints the band in Hz in both modes (the default -w 80 is about 0.20-8.59 Hz at 30 fps). -w keeps working and stays the default, but prints a deprecation note when given. Closes #38
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.
Closes #38
What changed
--freq-low/--freq-high(Hz, given together). They select band mode: an ideal temporal band-pass on the phase,phase += (k - 1) * bandpass(phase), so in-band motion is multiplied by k and out-of-band motion is untouched.bandpass_1dextends the series symmetrically by its own length before the FFT to avoid wrap-around. The GPU path has the same mode (_gpu_bandpass_filter, chunked, with OOM retry).--filter {butter,...}wasn't added; one well-defined band mode is enough.Band: 0.8–2 Hz (ideal band-pass), or for width mode the measured half-amplitude points, e.g.Band: ~0.20–8.59 Hz (flat-top, width 80)at 30 fps (flattop_band()).-wstill works and stays the default when no band is given (existing output unchanged). Passing it prints a deprecation note. Errors for: only one band edge, low ≥ high,-wtogether with a band, and a band above Nyquist (fps / 2).Measured gains (synthetic texture oscillation, 30 fps,
--freq-low 0.8 --freq-high 2 -k 10)The acceptance test asserts 8–12x at 1.2 Hz and < 2x at 0.3 and 5 Hz.
Tests
bandpass_1dkeeps only the in-band sinusoid,flattop_band(80)≈ 0.20 / 8.6 Hz at 30 fps.-wdeprecation note.--gpu -k 10 --freq-low 0.8 --freq-high 2run on face.mp4 takes 27.3 s and passesverify_output.py.