graphics.py 文件源码

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

项目:NeoAnalysis 作者: neoanalysis 项目源码 文件源码
def __spectrogram(self,data,samp_rate,window,per_lap,wlen,mult):        
        samp_rate = float(samp_rate)
        if not wlen:
            wlen = samp_rate/100.0

        npts=len(data)
        nfft = int(self.__nearest_pow_2(wlen * samp_rate))
        if nfft > npts:
            nfft = int(self.__nearest_pow_2(npts / 8.0))
        if mult is not None:
            mult = int(self.__nearest_pow_2(mult))
            mult = mult * nfft
        nlap = int(nfft * float(per_lap))
        end = npts / samp_rate

        window = signal.get_window(window,nfft)
        specgram, freq, time = mlab.specgram(data, Fs=samp_rate,window=window,NFFT=nfft,
                                            pad_to=mult, noverlap=nlap)
        return specgram,freq,time

    # Sort data by experimental conditions and plot spectrogram for analog signals (e.g. LFP)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号