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

Window length in bz_FindRipples.m #418

Open
37ig opened this issue Dec 28, 2022 · 5 comments
Open

Window length in bz_FindRipples.m #418

37ig opened this issue Dec 28, 2022 · 5 comments

Comments

@37ig
Copy link

37ig commented Dec 28, 2022

Hi,

I'm a bit confused about how the RMS window length is computed in bz_FindRipples.m

Lines 132 reads: windowLength = frequency/frequency*11;

Which should always set the windowLength to 11 data-points. Is this as intended or an error?

Thanks for any help!

@brendonw1
Copy link
Collaborator

brendonw1 commented Dec 30, 2022 via email

@37ig
Copy link
Author

37ig commented Dec 30, 2022

Yes the order of operations means it does return 11. With a bit more investigation it looks like the bz_FindRipples.m may have been inspired by (or vice versa) the FMAToolbox function FindRipples.m.

The line in the FMAToolbox function is
windowLength = round(frequency/1250*11);
which makes much more sense. But would be useful if someone could confirm this please.

Cheers!

@dlevenstein
Copy link
Collaborator

This should absolutely be

windowLength = round(frequency/1250*11);

not sure when it got changed, or who's using that code rn - anyone?

@dlevenstein
Copy link
Collaborator

actually - I bet what happened is someone wanted to change the 1250 to be the sampling frequency from the sessionInfo, and then got messed up between the frequency of the filter vs the sampling frequency....

@evilrobotxoxo
Copy link
Collaborator

evilrobotxoxo commented Jan 6, 2023 via email

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

No branches or pull requests

4 participants