Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Correct output of mlab._spectral_helper when scale_by_freq=False #4593

Merged
merged 1 commit into from Jul 16, 2015

Conversation

e-q
Copy link
Contributor

@e-q e-q commented Jul 6, 2015

Closes #4328

@tacaswell
Copy link
Member

This causes all of the spectral tests to fail.

@e-q
Copy link
Contributor Author

e-q commented Jul 6, 2015

True, didn't check the tests before submitting. In this case, the tests are in error.

Specifically, all of the failures are in test_psd_windowarray_scale_by_freq, which tests assert_allclose(spec_s, spec_n/self.Fs, atol=1e-08), where spec_s is computed with scale_by_freq=True and spec_n is computed with scale_by_freq=False. This equality is only true when using a flat window.

I've chosen to modify the tests to use a flat window, instead of the function's default, which I believe is a Hanning window. If, instead, we want to test with the Hanning window, the test can be modified to calculate the difference in window correction factors.

The tests now seem to pass on my machine, let's see what Travis thinks...

@e-q
Copy link
Contributor Author

e-q commented Jul 6, 2015

Hmm, now the tests are failing by a factor of 100. I'll get back to this soon.

@tacaswell tacaswell added this to the proposed next point release milestone Jul 7, 2015
@e-q e-q force-pushed the fix4328 branch 3 times, most recently from 65718aa to 3029d39 Compare July 8, 2015 22:24
@e-q
Copy link
Contributor Author

e-q commented Jul 9, 2015

There we go. I used the hanning window after all.

tacaswell added a commit that referenced this pull request Jul 16, 2015
FIX: Correct output of mlab._spectral_helper when scale_by_freq=False
@tacaswell tacaswell merged commit cefab28 into matplotlib:master Jul 16, 2015
@e-q e-q deleted the fix4328 branch July 16, 2015 20:08
@QuLogic QuLogic modified the milestones: next point release (1.5.0), proposed next point release (2.1) Oct 13, 2015
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.

None yet

3 participants