-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathipython_log.py
123 lines (122 loc) · 7.4 KB
/
ipython_log.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# IPython log file
get_ipython().magic(u'paste')
get_ipython().magic(u'paste')
get_ipython().magic(u'paste')
data
plot(data.T)
get_ipython().magic(u'pylab')
plot(data.T)
plot(data)
data.shape
plot(data[:600000,:])
get_ipython().magic(u'paste')
x = isft(stft(data[:,0].squeeze(),44100,0.01,0.01),44100,data.shape[0]/44100)
x = istft(stft(data[:,0].squeeze(),44100,0.01,0.01),44100,data.shape[0]/44100)
x = istft(stft(data[:,0].squeeze(),44100,0.01,0.01),44100,data.shape[0]/44100,0.01)
x
plot(x[:60000])
plot(x[:600000])
plot(data[0,:600000])
plot(x[:600000])
plot(x[:600000]-data[0,:600000])
plot(x[:600000]-data[0,:600000])
plot(data[0,:600000])
plot(data[:600000,0])
plot(x[:600000])
get_ipython().magic(u'paste')
x = istft(stft(data[:,0].squeeze())
)
x
plot(data[:600000,0])
plot(x[:600000])
plot(data[:600000,0]-x[:600000])
x = stft(data[:,0].squeeze())
x
x.shape
imshow(np.abs(x),interpolation='nearest',aspect='auto',origin='lower')
imshow(np.log(np.abs(x)),interpolation='nearest',aspect='auto',origin='lower')
imshow(np.log(np.abs(x)).T,interpolation='nearest',aspect='auto',origin='lower')
imshow(np.log(np.abs(x[:,:350])).T,interpolation='nearest',aspect='auto',origin='lower')
imshow(np.log(np.abs(x[:,:350])).T,interpolation='nearest',aspect='auto',origin='lower')
hist(x[:,350],100)
hist(np.log(np.abs(x[:,350])),100)
hist(np.log(np.abs(x.flatten())),100)
imshow(np.log(np.abs(x[:,:350])).T,interpolation='nearest',aspect='auto',origin='lower',vmin=-3)
imshow(np.log(np.abs(x[:,:350])).T,interpolation='nearest',aspect='auto',origin='lower',vmin=-3,vmax=2)
imshow(np.log(np.abs(x[:,:350])).T,interpolation='nearest',aspect='auto',origin='lower',vmin=-3,vmax=3)
plot(np.log(np.abs(x[:,:])).mean(axis=0))
imshow(np.log(np.abs(x[:,:350])).T-np.log(np.abs(x[:,:])).mean(axis=0),interpolation='nearest',aspect='auto',origin='lower',vmin=-3,vmax=3)
imshow(np.log(np.abs(x[:,:])).T-np.log(np.abs(x[:,:])).mean(axis=0),interpolation='nearest',aspect='auto',origin='lower',vmin=-3,vmax=3)
imshow(np.log(np.abs(x[:,:])).T-np.log(np.abs(x[:,:])).mean(axis=0,keepdims=True),interpolation='nearest',aspect='auto',origin='lower',vmin=-3,vmax=3)
imshow(np.log(np.abs(x[:,:])).T-np.log(np.abs(x[:,:])).mean(axis=0,keepdims=True).T,interpolation='nearest',aspect='auto',origin='lower',vmin=-3,vmax=3)
imshow(np.log(np.abs(x[:,:])).T-np.log(np.abs(x[:,:])).mean(axis=0,keepdims=True).T,interpolation='nearest',aspect='auto',origin='lower')
colorbar()
imshow(np.log(np.abs(x[:,:])).T-np.log(np.abs(x[:,:])).mean(axis=0,keepdims=True).T,interpolation='nearest',aspect='auto',origin='lower',vmin=-2.5,vmax=2.5)
ax = _
ax = plt.subplot(121)
imshow(np.log(np.abs(x[:,:])).T-np.log(np.abs(x[:,:])).mean(axis=0,keepdims=True).T,interpolation='nearest',aspect='auto',origin='lower',vmin=-2.5,vmax=2.5)
ax2 = plt.subplot(122,sharex=ax,sharey=ax)
imshow(np.sin(np.angle(x[:,:])).T,interpolation='nearest',aspect='auto',origin='lower',vmin=-2.5,vmax=2.5)
imshow(np.sin(np.angle(x[:,:])).T,interpolation='nearest',aspect='auto',origin='lower')
imshow(np.sin(np.angle(x[:,:-1])-np.angle(x[:,1:])).T,interpolation='nearest',aspect='auto',origin='lower')
scatter(np.angle(x[100,:-1]),np.angle(x[100,1:]))
scatter(np.angle(x[2000,:-1]),np.angle(x[200,1:]))
scatter(np.angle(x[200,:-1]),np.angle(x[200,1:]))
scatter(np.angle(x[10,:-1]),np.angle(x[10,1:]))
scatter(np.angle(x[11,:-1]),np.angle(x[11,1:]))
scatter(np.angle(x[11,:-1]),np.angle(x[11,1:]))
scatter(np.angle(x[10,:-1]),np.angle(x[10,1:]))
scatter(np.angle(x[10,:-1]),np.angle(x[10,1:]))
scatter(np.angle(x[11,:-1]),np.angle(x[11,1:]),color='red')
scatter(np.angle(x[21,:-1]),np.angle(x[21,1:]),color='green')
x = stft(data[:,0].squeeze(),overlap=0)
x = stft(data[:,0].squeeze(),overlap=1)
scatter(np.angle(x[21,:-1]),np.angle(x[21,1:]),color='green')
scatter(np.angle(x[21,:-1]),np.angle(x[21,1:]),color='green')
scatter(np.angle(x[21,:-1]),(np.angle(x[21,1:])+np.pi)%2*.np.i,color='green')
scatter(np.angle(x[21,:-1]),(np.angle(x[21,1:])+np.pi)%2*np.i,color='green')
scatter(np.angle(x[21,:-1]),(np.angle(x[21,1:])+np.pi)%2*np.pi,color='green')
scatter(np.angle(x[21,:-1]),(np.angle(x[21,1:])+np.pi)%2*np.pi,color='green')
scatter(np.angle(x[21,:-1]),np.angle(x[21,1:]),color='green')
scatter(np.angle(x[21,:-1]),(np.angle(x[21,1:])+np.pi),color='green')
scatter(np.angle(x[21,:-1]),np.angle(x[21,1:]),color='green')
scatter(np.angle(x[21,:-1]),(np.angle(x[21,1:])+np.pi),color='red')
scatter(np.angle(x[21,:-1]),(np.angle(x[21,1:])+2*np.pi),color='red')
scatter(np.angle(x[21,:-1]),np.angle(x[21,1:]),color='green')
scatter(np.sin(np.angle(x[21,:-1])),np.sin(np.angle(x[21,1:])),color='green')
scatter(np.sin(np.angle(x[21,:-1])),np.sin(np.angle(x[21,1:])),color='green')
scatter(np.sin(np.angle(x[21,:-1])),np.cos(np.angle(x[21,1:])),color='green')
scatter(np.sin(np.angle(x[21,:-1])),np.cos(np.angle(x[21,1:])),color='green')
scatter(np.angle(x[21,:-1]),np.angle(x[21,1:]),color='green')
hist(np.angle(x[21,:-1])-np.angle(x[21,1:]),100)
hist((np.angle(x[21,:-1])-np.angle(x[21,1:]))%np.pi*2,100)
scatter(np.angle(x[21,:-1]),np.angle(x[21,1:]),color='green')
scatter(np.angle(x[21,:-1]),np.angle(x[21,:-1])-np.pi,color='green')
scatter(np.angle(x[21,:-1]),np.angle(x[21,:-1])-np.pi,color='red')
scatter(np.angle(x[21,:-1]),np.angle(x[21,:-1])-np.pi,color='red')
scatter(np.angle(x[21,:-1]),np.angle(x[21,1:]),color='green')
scatter(np.angle(x[21,:-1]),((np.angle(x[21,:-1])+np.pi)%2*np.pi)-np.pi,color='red')
scatter(np.angle(x[21,:-1]),((np.angle(x[21,:-1])+np.pi)%2*np.pi)-np.pi,color='red')
scatter(np.angle(x[21,:-1]),((np.angle(x[21,:-1])-np.pi)%2*np.pi)-np.pi,color='red')
scatter(np.angle(x[21,:-1]),((np.angle(x[21,:-1])-np.pi)%(2*np.pi))-np.pi,color='red')
scatter(np.angle(x[21,:-1]),((np.angle(x[21,:-1])+np.pi)%(2.*np.pi))-np.pi,color='red')
scatter(np.angle(x[21,:-1]),((np.angle(x[21,:-1])+2*np.pi)%(2.*np.pi))-np.pi,color='red')
scatter(np.angle(x[21,:-1]),((np.angle(x[21,:-1])+2*np.pi)%(2.*np.pi))-np.pi,color='red')
scatter(np.angle(x[21,:-1]),np.angle(x[21,1:]),color='green')
scatter(np.angle(x[21,:-1]),np.angle(x[21,1:]),color='green')
scatter(np.angle(x[21,:-1]),((2*np.angle(x[21,:-1])+np.pi)%(2.*np.pi))-np.pi,color='red')
scatter(np.angle(x[21,:-1]),((2*np.angle(x[21,:-1])+np.pi)%(2.*np.pi))-np.pi,color='red')
scatter(np.angle(x[21,:-1]),np.angle(x[21,1:]),color='green')
scatter(np.angle(x[21,:-1]),((2*np.angle(x[21,:-1])+np.pi)%(2.*np.pi))-np.pi,color='red')
scatter(np.angle(x[21,:-1]),((np.angle(x[21,:-1])+2*np.pi)%(2.*np.pi))-np.pi,color='red')
scatter(np.angle(x[21,:-1]),np.angle(x[21,1:]),color='green')
scatter(np.angle(x[21,:-1]),((np.angle(x[21,:-1])+2*np.pi-np.angle(x[21,1:]))%(2.*np.pi))-np.pi,color='red')
scatter(np.angle(x[21,:-1]),((np.angle(x[21,:-1])+2*np.pi-np.angle(x[21,1:]))%(2.*np.pi))-np.pi,color='red')
hist(((np.angle(x[21,:-1])+2*np.pi-np.angle(x[21,1:]))%(2.*np.pi))-np.pi,100)
hist(((np.angle(x[210,:-1])+2*np.pi-np.angle(x[210,1:]))%(2.*np.pi))-np.pi,100)
imshow((((np.angle(x[:,:-1])+2*np.pi-np.angle(x[:,1:]))%(2.*np.pi))-np.pi).T,interpolation='nearest',aspect='auto',origin='lower')
imshow((((np.angle(x[:,:-1])+2*np.pi-np.angle(x[:,1:]))%(2.*np.pi))-np.pi).T,interpolation='nearest',aspect='auto',origin='lower',vmin=-0.5,vmax=0.5)
imshow((((np.angle(x[:,:-1])+2*np.pi-np.angle(x[:,1:]))%(2.*np.pi))-np.pi).T,interpolation='nearest',aspect='auto',origin='lower',vmin=-1.5,vmax=1.5)
plot(((np.angle(x[210,:-1])+2*np.pi-np.angle(x[210,1:]))%(2.*np.pi))-np.pi)
plot(((np.angle(x[21,:-1])+2*np.pi-np.angle(x[21,1:]))%(2.*np.pi))-np.pi)
get_ipython().magic(u'logstart')