Repository navigation
Reject empty bands and report the band's resolution - #70
Merged
Merged
Conversation
A band that contains no FFT bins (e.g. 0.9-0.9001 Hz on a 301-frame clip) made bandpass_1d return zeros, so the output silently equalled the input after the whole forward DTCWT had run. main() now rejects such a band before processing, warns when the band is narrower than the clip's frequency resolution (fps / frames), and prints the bins kept and the resolution. bandpass_1d and the GPU band filter raise ValueError for library callers. The Nyquist check moved before the Parameters output. Closes #67
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 #67
main(), before the Parameters output and any processing:fps / frames.Band: 0.9–0.95 Hz (ideal band-pass; 2 bins, resolution 0.0997 Hz).bandpass_1dand the GPU band filter raiseValueErroron an empty band. Newband_bins()helper.fps / framesinstead.Checked on face.mp4 (301 frames):
--freq-low 0.9 --freq-high 0.9001now exits 1 withError: the band 0.9–0.9001 Hz contains no frequency bins for 301 frames at 30 fps (resolution 0.0997 Hz) ...(previously: unmagnified output, exit 0).0.9–0.95Hz runs with the resolution warning.Tests: empty band raises (CPU and GPU filter), CLI rejects before processing, Nyquist before Parameters, narrow-band warning. CPU image 108 passed, 3 skipped; GPU image on an RTX 4050 132 passed, 1 skipped.