bci_workshop_tools.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:Wall-EEG 作者: neurotechuoft 项目源码 文件源码
def plotmultichannel(data, params=None): 
# TODO Receive Labels as arguments
    """
    Creates a plot to present multichannel data

    Arguments
    data:  Multichannel Data [n_samples, n_channels]
    params: information about the data acquisition device being
    """  
    plt.figure()        

    n_samples = data.shape[0]
    n_channels = data.shape[1]

    if params is not None:
        fs = params['sampling frequency']
        names = params['names of channels']
    else:
        fs = 1
        names = [""] * n_channels

    time_vec = np.arange(n_samples) / float(fs)

    data = np.fliplr(data)
    offset = 0
    for i_channel in range (0, n_channels):
        data_ac = data[:,i_channel] - np.mean(data[:,i_channel])
        offset = offset + 2 * np.max(np.abs(data_ac))        
        plt.plot(time_vec, data_ac + offset, label=names[i_channel])        

    plt.xlabel('Time [s]');
    plt.ylabel('Amplitude');
    plt.legend()        
    plt.draw()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号