Azzera filtri
Azzera filtri

How to decide sigma when using Gaussian kernel to smooth neuronal firing rate?

37 visualizzazioni (ultimi 30 giorni)
Hi everyone! I'm a beginner in neurophysiology. I have some basic questions about how to decide the sigma when smoothing the neuronal firing rate using the Gaussian filter or Gaussian kernel.
My questions:
  1. What factors do you usually take into consideration when deciding an ideal sigma?
  2. I learned that you can multiply the spike density function window (SDF window) by opts.Fs to get sigma, but was not sure what opts.Fs was referring to here. Is opts.Fs referring to sampling frequency of the neural data?
  3. And when dealing with smoothing of firing rate data(1 dimensional time series data), is sigma in milisecond or second?
  4. I currently wrote code to smooth the data. Can I use the Signal Processing Toolbox to achieve the same result?
An example of the code I'm using:
spike_count = randi([0,30],100); % Random generated neural data: spike counts of 100 neurons (each row is a neuron) within 100 seconds(each column is a time bin). Time bin length: 1 second. Because the time bin is 1 second, spike_count also represents firing rate before smoothing.
sigma = 1; % I experimented different sigmas, but not sure if there is a more systematic way to decide sigma. Just put 1 here for convenience.
gaussian_range = -3*sigma:3*sigma; % setting up Gaussian window
gaussian_kernel = normpdf(gaussian_range,0,sigma); % setting up Gaussian kernel
gaussian_kernel = gaussian_kernel/sum(gaussian_kernel);
smoothed_firingrate = conv2(spike_count,gaussian_kernel,'same'); % convolution
figure (1)
plot (spike_count(1,:)); % plot the first neuron in spike_count as an example
hold on
plot(smoothed_firingrate(1,:)); % plot also the first neuron in smoothed_firingrate as an example
legend('Firing rate before smoothing','Firing rate after smoothing');
hold off
Thank you!

Risposte (1)

Muskan
Muskan il 21 Apr 2023
Hi Yufan,
As per my understanding of the question, the optimal value of sigma depends on various factors, such as the sampling rate of the neuronal signal, the duration of the signal, the noise level in the data, and the desired level of smoothing.
One approach can be to use a statistical method to estimate the optimal value of sigma.
Another approach can be to perform a sensitivity analysis in which different values of sigma are tested and the results are compared.
Thanks

Categorie

Scopri di più su Electrophysiology in Help Center e File Exchange

Prodotti


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by