from pylab import * import scipy.signal as signal import stockwell.smt as smt signal.chirp #?signal.chirp t = linspace(0, 10, num=1000) ch = signal.chirp(t, 1.0, 6.0, 20.0) #figure() #plot(t,ch) K = 4 N = len(t) tapers = smt.calc_tapers(K, N) chs = smt.mtst(K, tapers, ch, 0, len(ch) / 2) chtapers = smt.calc_tapers(K, len(ch)) chs = smt.mtst(K, chtapers, ch, 0, len(ch) / 2) # these don't quite look right #figure(); imshow(chs); axis('auto') #figure(); subplot(211); plot(ch); subplot(212); imshow(chs); axis('auto') ## now try a longer signal import stockwell.plots as stplot print("powerstack of multitaper version of signal") stplot.stpowerstack(ch, chs)
from matplotlib.pyplot import * import _edflib import stockwell.smt as smt # eegfile="/mnt/hgfs/clee/Documents/swaineeg/NKT/EEG2100/CA75510M_1-1+_1-2+.edf" eegfile='/home/clee/Dropbox/data/swainAFIB_CA46803E_1-1+.edf' open(eegfile) e=_edflib.Edfreader(eegfile) # read a short number of samples a = zeros(2000.0) e.readsignal(0,0,2000,a) plot(a) K=4 N=2000 tapers = smt.calc_tapers(K,N) #s=smt.mtst(K,tapers,a) s=smt.mtst(K,tapers,a,0,70) figure(); imshow(s); axis('auto') la=zeros(10000,dtype='float64') #?smt.st e.readsignal(0,0,len(la),la) figure();plot(la) las = smt.st(la, 0,70) #figure(); plot(las) rlas = abs(las) figure(); imshow(rlas); axis('auto') las.shape
from pylab import * import scipy.signal as signal import stockwell.smt as smt signal.chirp #?signal.chirp t=linspace(0,10,num=1000) ch = signal.chirp(t,1.0,6.0,20.0) #figure() #plot(t,ch) K=4; N=len(t) tapers = smt.calc_tapers(K,N) chs = smt.mtst(K,tapers, ch, 0,len(ch)/2) chtapers = smt.calc_tapers(K,len(ch)) chs = smt.mtst(K,chtapers, ch, 0,len(ch)/2) # these don't quite look right #figure(); imshow(chs); axis('auto') #figure(); subplot(211); plot(ch); subplot(212); imshow(chs); axis('auto') ## now try a longer signal import stockwell.plot as stplot print "powerstack of multitaper version of signal" stplot.stpowerstack(ch, chs)