-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix cohere-demo #7968
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 cohere-demo #7968
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dstansby
When you do work on the examples, can you make sure they follow our new standards?
In particular, concerning their documentation:
http://matplotlib.org/devdocs/devel/MEP/MEP12.html#clean-up-guidelines
Woops, hadn't come across those new standards before! Should be good now, |
r = np.exp(-t / 0.05) | ||
|
||
cnse1 = np.convolve(nse1, r, mode='same') * dt # colored noise 1 | ||
cnse2 = np.convolve(nse2, r, mode='same') * dt # colored noise 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not exactly sure what this "colored noise" means, but something is wrong here. If you don't limit the x-axis, you can see that past 15s, the noise is nearly zero. It works better if you use full mode and truncate the result:
cnse1 = np.convolve(nse1, r)[:len(t)] * dt # colored noise 1
cnse2 = np.convolve(nse2, r)[:len(t)] * dt # colored noise 2
I have removed the convolution completely from the example, since I'm not sure it adds anything. Now it still shows that the coherence peaks at 10Hz, which is the coherent bit of the two signals. |
See http://matplotlib.org/devdocs/_images/cohere_demo1.png for current image
plt.subplots
!