SpikeInterface / spikeinterface

A Python-based module for creating flexible and robust spike sorting pipelines.
https://spikeinterface.readthedocs.io
MIT License
531 stars 188 forks source link

How to eliminate potential AC noises? #3521

Open DaohanZhang opened 2 weeks ago

DaohanZhang commented 2 weeks ago

Hello everyone! I found my last NPX recording got polluted with some potential AC noises possibly due to poor GND and REF. Here are some of the noises after sorting with KS4, which is spikes approximately appeared at at 50Hz pulses. Is there any preprocess filters could eliminate such noises. I tried using notch_filter centered 50, 100 and 150Hz before default bandpass_filter, it just did not work. 0ecc14c3bf12ebd352303efe0510714 image

alejoe91 commented 2 weeks ago

Hi @DaohanZhang

Can you plot a spectrum of the traces? If the noise is localized, you can play with the q factor of the notch filter to broaden/narrow the notch band to try to remove most of the noise

DaohanZhang commented 2 weeks ago

It's a little bit weird... I have put most of the details on slack. image

alejoe91 commented 2 weeks ago

It would be helpful to look at the spectra though (couldn't find them on slack)

DaohanZhang commented 1 week ago

Here comes the spectra! First I plot the traces and there are periodic patterns: image After that, I plot the spectra of some of the elecs: image image image image image image image image image image image image

alejoe91 commented 1 week ago

Thanks, can you also plot the power spectrum density? It makes it easier to check for very localized noise sources. From the spectrograms, they seem quite distributed so a notch filter won't help much here...

DaohanZhang commented 1 week ago

image image image image image image image image image image These are PSDs

alejoe91 commented 1 day ago

@DaohanZhang

Can you try a notch filter where you have the peak (~5000Hz) and see if it improves the situation?