-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo_algo_001.py
44 lines (32 loc) · 983 Bytes
/
demo_algo_001.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
from pylab import *
from numpy import *
ion()
## Example of GADFLI and QuickGCI processing
import pyglottal as pyg
import corpus_loader
# Replace with path to full APLAWD database
aplawd = corpus_loader.APLAWD('./mini_aplawd')
a = aplawd.load(2)
gci_gadfli = pyg.gadfli(a.e, fmin=20, fmax=1500, fs=a.fs,
m=0.25, tau=-0.25,
theta=0, reps=2,
)
gci_quick = pyg.quick_gci(a.e, fmin=50, fmax=1500, fs=a.fs,
reps=2,
gamma=1)
fig = figure(1)
clf()
ax = subplot(111)
title('APLAWD waveform: %s' % a.name)
t = arange(len(a.d)) / a.fs
plot(t, a.d, alpha=0.5,
label='DEGG')
plot(t[gci_gadfli], 0*gci_gadfli, 'o', ms=10, alpha=0.5,
label='GADFLI')
plot(t[gci_quick], 0*gci_quick, '^', ms=10, alpha=0.5,
label='QuickGCI')
legend(loc='lower right', fancybox=True, framealpha=0.5)
ylabel('DEGG')
xlabel('Time (s)')
tight_layout()
show(block=True)