【问题标题】:Neurophysiology recording MATLAB神经生理学记录 MATLAB
【发布时间】:2015-07-15 01:31:40
【问题描述】:

我的数据存储在有关神经元记录的结构中。神经元尖峰存储在一个逻辑数组中,其中尖峰为 1,无尖峰为 0。

spike = <1x50 logical> 
spike = [1 0 0 0 1 0 0 1 0 0 0 0 0 0 1 1 1 0 1 0 1 0 0 0 1 1 0 0 ...]

我要做的是使用高斯滤波器将这些尖峰转换为平滑曲线信号。

我有以下平滑功能:

function z = spikes(x, winWidth)
% places a Gaussian centered on every spike
% if x is matrix, then perform on the columns

winWidth = round(winWidth);

if winWidth == 0
    y = [0 1 0];
    w = 1;
else
    w = winWidth * 5;
    t = -w : w;
    y = normpdf(t,0,winWidth);
end

if isvector(x)
    z = conv(x,y);
    z = z(w+1 : end);
    z = z(1 : length(x));
else
    z = zeros(size(x));
    for i = 1 : size(x,2)
        z1 = conv(x(:,i),y);
        z1 = z1(w+1 : end);
        z1 = z1(1 : length(x));
        z(:,i) = z1;
    end
end

end

我只是想知道如何从类似于上述逻辑数组的尖峰中产生神经信号?

PS:我很迷茫,我的答案无法在这里发布。

【问题讨论】:

    标签: matlab gaussian neuroscience


    【解决方案1】:

    如果我理解正确,您只需要增加采样频率并进行卷积即可。由于你的原始数组对应一个采样频率为一个尖峰的信号,如果你想提高尖峰的分辨率,你需要人为地在尖峰之间引入更多的数据点。

    spike = [1 0 0 0 1 0 0 1 0 0 0 0 0 0 1 1 1 0 1 0 1 0 0 0 1 1 0 0];
    
    ![n_samples = numel(spike);
    resampling_f = 50;
    new_signal = zeros(n_samples*resampling_f,1);
    
    spikes_ind = find(spike);
    new_signal((spikes_ind-1)*50+round(resampling_f/2)) = 1;
    
    %here you can use the spikes function you defined
    winWidth = 10;
    w = winWidth * 5;
    t = -w : w;
    kernel = normpdf(t,0,winWidth);
    spikes_sample = conv(x,kernel);
    
    figure, hold on
    subplot(1,2,1), hold on
    plot(new_signal)
    
    subplot(1,2,2), hold on
    plot(spikes_sample)][1]
    

    【讨论】:

      猜你喜欢
      • 2011-08-17
      • 2015-12-03
      • 2011-08-23
      • 1970-01-01
      • 2016-07-11
      • 2014-01-15
      • 2010-11-20
      • 2011-07-31
      • 2014-04-09
      相关资源
      最近更新 更多