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

Issue with filter_ripple_band padlen #6

Closed
m-zimmerman opened this issue Dec 13, 2023 · 3 comments
Closed

Issue with filter_ripple_band padlen #6

m-zimmerman opened this issue Dec 13, 2023 · 3 comments

Comments

@m-zimmerman
Copy link

Hello,

I wanted to try playing around with my own LFP ephys recordings, but cannot seem to run my lfps array (shape=(7350,)) with the filter_ripple_band(lfps) function to get the filtered_lfps.

The ValueError I get is "The length of the input vector x must be greater than padlen, which is 954." which is traced back to the "filtered_data[~is_nan] = filtfilt(filter_numerator, filter_denominator, data[~is_nan], axis=0)" section of the code.

Let me know if you have any ideas or need any more information!

@edeno
Copy link
Contributor

edeno commented Dec 13, 2023

Three things to note here:

  1. The ripple filter here is designed for a signal sampled at 1500 Hz. If your signal is not this, then I would recommend constructing your own ripple filter.
  2. I believe this function is expecting something of shape (7350,1) because it is built to process multiple LFPs.
  3. The other possibility is that you have a bunch of NaNs in your input data.

@m-zimmerman
Copy link
Author

Thanks for the quick reply!

Your second point answered the issue. I needed the extra dimension for the functions to work (I thought I saw in the code it was commented to be shape (X,) ).

Also, to your first point, am I correct in assuming this filter_ripple_band() function is essentially applying a bandpass filter in the high gamma range on the lfp signal?

Appreciate the help!

@edeno
Copy link
Contributor

edeno commented Dec 13, 2023

Correct. The filter is for 150-250 Hz. I'm going to close this issue, but feel free to open it back up if there is an issue.

@edeno edeno closed this as completed Dec 13, 2023
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

2 participants