Skip to content

Conversation

@sroycode
Copy link

@sroycode sroycode commented Nov 9, 2024

Most people expect results for welch to match scipy welch default which applies constant detrend. I have patched the same here.

Copy link
Owner

@pwstegman pwstegman left a comment

Choose a reason for hiding this comment

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

Thank you so much for contributing! I appreciate you catching and adding this! I added some comments to the PR, let me know what you think

import { windowApply } from '../data/windowApply';
import { nextpow2 } from './nextpow2';

const d_mean = (arr) => arr.reduce((a, b) => a + b, 0) / arr.length;
Copy link
Owner

Choose a reason for hiding this comment

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

Nice! Can you add a corresponding unit test to cover this logic in test/tests/shared/math/welch.test.js? Maybe something like a copy of the existing unit test but we add a very obvious upward trend to the input

Copy link
Author

Choose a reason for hiding this comment

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

Sent a fresh pull request with default 'none'

Copy link
Author

Choose a reason for hiding this comment

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

Will work on the test part in Dec once I get some time pl ...

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.

2 participants