How to decide sigma when using Gaussian kernel to smooth neuronal firing rate?
25 次查看(过去 30 天)
显示 更早的评论
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:
- What factors do you usually take into consideration when deciding an ideal sigma?
- 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?
- And when dealing with smoothing of firing rate data(1 dimensional time series data), is sigma in milisecond or second?
- 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!
0 个评论
回答(1 个)
Muskan
2023-4-21
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Electrophysiology 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!