Repository navigation
fix(fourier): correct lsft_fast phase and amplitude - #989
Open
Cherith1222 wants to merge 3 commits into
Open
Cherith1222 wants to merge 3 commits into
Cherith1222 wants to merge 3 commits into
Conversation
trig_sum returns sine then cosine, and the variance terms count observations, not frequency bins.
This branch has not been deployed
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.
Why
lsft_fastbound the cosine sum where the sine sum belongs, and it counted frequency bins where the slow transform counts observations. A 300-point series on a 200-bin grid returned a NaN in the first bin. The phase error stayed near pi when oversampling increased.What changed
trig_sumbeforearctan2.Scope
This covers the two formula errors in the reported random-time example. It leaves the exact-Nyquist guard alone, and it leaves the default oversampling at 5. The report says that threshold is not chosen yet. There is no new dependency.
Blast Radius
Callers of the fast transform, including the fast Lomb-Scargle cross spectrum, receive a different complex result. The slow method is unchanged. The existing fast-versus-slow cross-spectrum check still passes.
Verification
nan_bins=1andamp_rel_err=1.827e+00at oversampling 5, 10, and 50.nan_bins=0and relative errors3.689e-02,3.735e-03, and6.298e-07.test_lsft_slow_fast,test_impose_symmetry_lsft, andTestLombScargleCrossspectrum::test_valid_methodpassed (4).See #988. This patch does not close the Nyquist follow-up in that report.
Drafted with Cursor.