-
Notifications
You must be signed in to change notification settings - Fork 9
/
configure.ac
670 lines (529 loc) · 16.4 KB
/
configure.ac
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
# Process this file with autoconf to produce a configure script.
AC_INIT(HTS-demo_CMU-ARCTIC-SLT-STRAIGHT-AR-decision-tree,2.1,matt.shannon@cantab.net)
AC_COPYRIGHT(Copyright 2011 Matt Shannon)
AC_COPYRIGHT(Copyright 2001-2008 Nagoya Institute of Technology)
AC_COPYRIGHT(Copyright 2001-2008 Tokyo Institute of Technology)
# Checks for programs.
# awk
AC_PROG_AWK
# perl
AC_PATH_PROG([PERL], [perl], [/usr/bin], [$PATH:/usr/bin])
if test ! -f "$PERL"; then
AC_MSG_ERROR(Can't find perl)
fi
# bc
AC_PATH_PROG([BC], [bc], [/usr/bin], [$PATH:/usr/bin])
if test ! -f "$BC"; then
AC_MSG_ERROR(Can't find bc)
fi
# festival
# festival search path
AC_ARG_WITH(fest-search-path,
AS_HELP_STRING([--with-fest-search-path],[specify the additional festival search path]),
[fest_search_path=$withval])
# dumpfeats (festival)
AC_PATH_PROG([DUMPFEATS], [dumpfeats], [:], [${fest_search_path}:$PATH])
if test ! -f "$DUMPFEATS"; then
AC_MSG_ERROR(Can't find dumpfeats of festival)
fi
# SPTK commands
# SPTK search path
AC_ARG_WITH(sptk-search-path,
AS_HELP_STRING([--with-sptk-search-path],[specify the additional SPTK binary search path]),
[sptk_search_path=$withval])
# swab
AC_PATH_PROG([SWAB], [swab], [:], [${sptk_search_path}:$PATH])
if test ! -f "$SWAB"; then
AC_MSG_ERROR(Can't find swab of SPTK)
fi
# x2x
AC_PATH_PROG([X2X], [x2x], [:], [${sptk_search_path}:$PATH])
if test ! -f "$X2X"; then
AC_MSG_ERROR(Can't find x2x of SPTK)
fi
# mgcep
if test -z "$GAMMA"; then
AC_PATH_PROG([MGCEP], [mcep], [:], [${sptk_search_path}:$PATH])
if test ! -f "$MGCEP"; then
AC_MSG_ERROR(Can't find mcep of SPTK)
fi
version=`$MGCEP -h 2>&1 | grep "version" | sed -e "s/.* //g"`
if test -z "$version"; then
AC_MSG_ERROR(mcep in SPTK version 3.2 or later is required.)
elif test `echo "$version < 3.2" | $BC` = 1; then
AC_MSG_ERROR(mcep in SPTK version 3.2 or later is required.)
fi
elif test $GAMMA -eq 0; then
AC_PATH_PROG([MGCEP], [mcep], [:], [${sptk_search_path}:$PATH])
if test ! -f "$MGCEP"; then
AC_MSG_ERROR(Can't find mcep of SPTK)
fi
version=`$MGCEP -h 2>&1 | grep "version" | sed -e "s/.* //g"`
if test -z "$version"; then
AC_MSG_ERROR(mcep in SPTK version 3.2 or later is required.)
elif test `echo "$version < 3.2" | $BC` = 1; then
AC_MSG_ERROR(mcep in SPTK version 3.2 or later is required.)
fi
else
AC_PATH_PROG([MGCEP], [mgcep], [:], [${sptk_search_path}:$PATH])
if test ! -f "$MGCEP"; then
AC_MSG_ERROR(Can't find mgcep of SPTK)
fi
version=`$MGCEP -h 2>&1 | grep "version" | sed -e "s/.* //g"`
if test -z "$version"; then
AC_MSG_ERROR(mgcep in SPTK version 3.2 or later is required.)
elif test `echo "$version < 3.2" | $BC` = 1; then
AC_MSG_ERROR(mgcep in SPTK version 3.2 or later is required.)
fi
fi
# lpc2lsp
AC_PATH_PROG([LPC2LSP], [lpc2lsp], [:], [${sptk_search_path}:$PATH])
if test ! -f "$LPC2LSP"; then
AC_MSG_ERROR(Can't find lpc2lsp of SPTK)
fi
version=`$LPC2LSP -h 2>&1 | grep "version" | sed -e "s/.* //g"`
if test -z "$version"; then
AC_MSG_ERROR(lpc2lsp in SPTK version 3.1 or later is required.)
elif test `echo "$version < 3.1" | $BC` = 1; then
AC_MSG_ERROR(lpc2lsp in SPTK version 3.1 or later is required.)
fi
# vstat
AC_PATH_PROG([VSTAT], [vstat], [:], [${sptk_search_path}:$PATH])
if test ! -f "$VSTAT"; then
AC_MSG_ERROR(Can't find vstat of SPTK)
fi
# sopr
AC_PATH_PROG([SOPR], [sopr], [:], [${sptk_search_path}:$PATH])
if test ! -f "$SOPR"; then
AC_MSG_ERROR(Can't find sopr of SPTK)
fi
# vopr
AC_PATH_PROG([VOPR], [vopr], [:], [${sptk_search_path}:$PATH])
if test ! -f "$VOPR"; then
AC_MSG_ERROR(Can't find vopr of SPTK)
fi
# freqt
AC_PATH_PROG([FREQT], [freqt], [:], [${sptk_search_path}:$PATH])
if test ! -f "$FREQT"; then
AC_MSG_ERROR(Can't find freqt of SPTK)
fi
# c2acr
AC_PATH_PROG([C2ACR], [c2acr], [:], [${sptk_search_path}:$PATH])
if test ! -f "$C2ACR"; then
AC_MSG_ERROR(Can't find c2acr of SPTK)
fi
# mc2b
AC_PATH_PROG([MC2B], [mc2b], [:], [${sptk_search_path}:$PATH])
if test ! -f "$MC2B"; then
AC_MSG_ERROR(Can't find mc2b of SPTK)
fi
# b2mc
AC_PATH_PROG([B2MC], [b2mc], [:], [${sptk_search_path}:$PATH])
if test ! -f "$B2MC"; then
AC_MSG_ERROR(Can't find b2mc of SPTK)
fi
# merge
AC_PATH_PROG([MERGE], [merge], [:], [${sptk_search_path}:$PATH])
if test ! -f "$MERGE"; then
AC_MSG_ERROR(Can't find merge of SPTK)
fi
version=`$MERGE -h 2>&1 | grep "version" | sed -e "s/.* //g"`
if test -z "$version"; then
AC_MSG_ERROR(merge in SPTK version 3.1 or later is required.)
elif test `echo "$version < 3.1" | $BC` = 1; then
AC_MSG_ERROR(merge in SPTK version 3.1 or later is required.)
fi
# average
AC_PATH_PROG([AVERAGE], [average], [:], [${sptk_search_path}:$PATH])
if test ! -f "$AVERAGE"; then
AC_MSG_ERROR(Can't find average of SPTK)
fi
version=`$AVERAGE -h 2>&1 | grep "version" | sed -e "s/.* //g"`
if test -z "$version"; then
AC_MSG_ERROR(average in SPTK version 3.1 or later is required.)
elif test `echo "$version < 3.1" | $BC` = 1; then
AC_MSG_ERROR(average in SPTK version 3.1 or later is required.)
fi
# bcp
AC_PATH_PROG([BCP], [bcp], [:], [${sptk_search_path}:$PATH])
if test ! -f "$BCP"; then
AC_MSG_ERROR(Can't find bcp of SPTK)
fi
# lsp2lpc
AC_PATH_PROG([LSP2LPC], [lsp2lpc], [:], [${sptk_search_path}:$PATH])
if test ! -f "$LSP2LPC"; then
AC_MSG_ERROR(Can't find lsp2lpc of SPTK)
fi
version=`$LSP2LPC -h 2>&1 | grep "version" | sed -e "s/.* //g"`
if test -z "$version"; then
AC_MSG_ERROR(lsp2lpc in SPTK version 3.1 or later is required.)
elif test `echo "$version < 3.1" | $BC` = 1; then
AC_MSG_ERROR(lsp2lpc in SPTK version 3.1 or later is required.)
fi
# lspcheck
AC_PATH_PROG([LSPCHECK], [lspcheck], [:], [${sptk_search_path}:$PATH])
if test ! -f "$LSPCHECK"; then
AC_MSG_ERROR(Can't find lspcheck of SPTK)
fi
# mgc2mgc
AC_PATH_PROG([MGC2MGC], [mgc2mgc], [:], [${sptk_search_path}:$PATH])
if test ! -f "$MGC2MGC"; then
AC_MSG_ERROR(Can't find mgc2mgc of SPTK)
fi
# mgc2sp
AC_PATH_PROG([MGC2SP], [mgc2sp], [:], [${sptk_search_path}:$PATH])
if test ! -f "$MGC2SP"; then
AC_MSG_ERROR(Can't find mgc2sp of SPTK)
fi
# interpolate
AC_PATH_PROG([INTERPOLATE], [interpolate], [:], [${sptk_search_path}:$PATH])
if test ! -f "$INTERPOLATE"; then
AC_MSG_ERROR(Can't find interpolate of SPTK)
fi
# dfs
AC_PATH_PROG([DFS], [dfs], [:], [${sptk_search_path}:$PATH])
if test ! -f "$DFS"; then
AC_MSG_ERROR(Can't find dfs of SPTK)
fi
# nan
AC_PATH_PROG([NAN], [nan], [:], [${sptk_search_path}:$PATH])
if test ! -f "$NAN"; then
AC_MSG_ERROR(Can't find nan of SPTK)
fi
# sox (Sound eXchange)
# sox search path
AC_ARG_WITH(sox-search-path,
AS_HELP_STRING([--with-sox-search-path],[specify the additional sox (Sound eXchange) search path]),
[sox_search_path=$withval])
# sox
AC_PATH_PROG([SOX], [sox], [:], [${sox_search_path}:$PATH])
if test ! -f "$SOX"; then
AC_MSG_ERROR(Can't find sox)
fi
# MATLAB
# MATLAB search path
AC_ARG_WITH(matlab-search-path,
AS_HELP_STRING([--with-matlab-search-path],[specify the additional MATLAB binary search path]),
[matlab_search_path=$withval])
AC_PATH_PROG([MATLAB], [matlab], [:], [${matlab_search_path}:$PATH])
if test ! -f "$MATLAB"; then
AC_MSG_ERROR(Can't find MATLAB)
fi
MATLAB="$MATLAB -nodisplay -nosplash -nojvm"
# STRAIGHT
# STRAIGHTpath
AC_ARG_WITH(straight-path,
AS_HELP_STRING([--with-straight-path],[specify the STRAIGHT MATLAB code path]),
[STRAIGHT=$withval])
if test ! -f "$STRAIGHT/exstraightsource.p" -a ! -f "$STRAIGHT/exstraightsource.m"; then
AC_MSG_ERROR(Can't find exstraightsource in $STRAIGHT)
fi
if test ! -f "$STRAIGHT/exstraightspec.p" -a ! -f "$STRAIGHT/exstraightspec.m"; then
AC_MSG_ERROR(Can't find exstraightspec in $STRAIGHT)
fi
if test ! -f "$STRAIGHT/exstraightsynth.p" -a ! -f "$STRAIGHT/exstraightsynth.m"; then
AC_MSG_ERROR(Can't find exstraightsynth in $STRAIGHT)
fi
AC_SUBST(STRAIGHT)
# HTS commands
# HTS search path
AC_ARG_WITH(hts-search-path,
AS_HELP_STRING([--with-hts-search-path],[specify the additional HTS binary search path]),
[hts_search_path=$withval])
# HMGenS
AC_PATH_PROG([HMGENS], [HMGenS], [:], [${hts_search_path}:$PATH])
if test ! -f "$HMGENS"; then
AC_MSG_ERROR(Can't find HMGenS of HTS)
fi
# HCompV
AC_PATH_PROG([HCOMPV], [HCompV], [:], [${hts_search_path}:$PATH])
if test ! -f "$HCOMPV"; then
AC_MSG_ERROR(Can't find HCompV of HTS)
fi
# HInit
AC_PATH_PROG([HINIT], [HInit], [:], [${hts_search_path}:$PATH])
if test ! -f "$HINIT"; then
AC_MSG_ERROR(Can't find HInit of HTS)
fi
# HRest
AC_PATH_PROG([HREST], [HRest], [:], [${hts_search_path}:$PATH])
if test ! -f "$HREST"; then
AC_MSG_ERROR(Can't find HRest of HTS)
fi
# HERest
AC_PATH_PROG([HEREST], [HERest], [:], [${hts_search_path}:$PATH])
if test ! -f "$HEREST"; then
AC_MSG_ERROR(Can't find HERest of HTS)
fi
# HHEd
AC_PATH_PROG([HHED], [HHEd], [:], [${hts_search_path}:$PATH])
if test ! -f "$HHED"; then
AC_MSG_ERROR(Can't find HHEd of HTS)
fi
# hts_engine API
# hts_engine search path
AC_ARG_WITH(hts-engine-search-path,
AS_HELP_STRING([--with-hts-engine-search-path],[specify the additional hts_engine binary search path]),
[hts_engine_search_path=$withval])
# hts_engine
AC_PATH_PROG([ENGINE], [hts_engine], [:], [${hts_engine_search_path}:$PATH])
if test ! -f "$ENGINE"; then
AC_MSG_ERROR(Can't find hts_engine)
fi
version=`$ENGINE -h 2>&1 | grep "version" | sed -e "s/.*version //g" -e "s/ .*//g"`
if test -z "$version"; then
AC_MSG_ERROR(hts_engine using hts_engine API version 0.95 or later is required.)
elif test `echo "$version < 0.95" | $BC` = 1; then
AC_MSG_ERROR(hts_engine using hts_engine API version 0.95 or later is required.)
fi
# check endianness
AC_C_BIGENDIAN(BYTESWAP="1",BYTESWAP="0", AC_MSG_ERROR(Can't determine endianness))
AC_SUBST(BYTESWAP)
# speaker and dataset names
AC_ARG_VAR([SPEAKER],[speaker name (default=slt)])
AC_ARG_VAR([DATASET],[dataset (default=cmu_us_arctic)])
if test -z "$SPEAKER"; then
SPEAKER=slt
fi
if test -z "$DATASET"; then
DATASET=cmu_us_arctic
fi
AC_SUBST(SPEAKER)
AC_SUBST(DATASET)
# version number and question set name
AC_ARG_VAR([VER],[version number of this setting (default=1)])
AC_ARG_VAR([QNUM],[question set number (default='001')])
if test -z "$VER"; then
VER=1
fi
if test -z "$QNUM"; then
QNUM='001'
fi
AC_SUBST(VER)
AC_SUBST(QNUM)
# current directory
AC_SUBST(PWD)
# setting of mel-generalized cepstral analysis, F0 extraction, and postfiltering related settings
# parse command-line arguments
AC_ARG_VAR([FRAMESHIFT],[Frame shift in point (default=80)])
AC_ARG_VAR([FREQWARP],[Frequency warping factor (default=0.42)])
AC_ARG_VAR([GAMMA],[Pole/Zero weight factor (0: mel-cepstral analysis 1: LPC analysis 2,3,...,N: mel-generalized cepstral (MGC) analysis) (default=0)])
AC_ARG_VAR([MGCLSP],[Use MGC-LSPs instead of MGC coefficients (default=0)])
AC_ARG_VAR([MGCORDER],[Order of MGC analysis (default=39)])
AC_ARG_VAR([LNGAIN],[Use logarithmic gain instead of linear gain (default=0)])
AC_ARG_VAR([LOWERF0],[Lower limit for F0 extraction in Hz (default=80)])
AC_ARG_VAR([UPPERF0],[Upper limit for F0 extraction in Hz (default=350)])
AC_ARG_VAR([PSTFILTER],[Postfiltering factor (default=1.0)])
AC_ARG_VAR([IMPLEN],[Length of impulse response (default=4096)])
AC_ARG_VAR([SAMPFREQ],[Sampling frequency in Hz (default=16000)])
# default values
if test -z "$FRAMESHIFT"; then
FRAMESHIFT=80
fi
if test -z "$SAMPFREQ"; then
SAMPFREQ=16000
fi
if test -z "$FREQWARP"; then
case $SAMPFREQ in
8000) FREQWARP=0.31 ;;
10000) FREQWARP=0.35 ;;
12000) FREQWARP=0.37 ;;
16000) FREQWARP=0.42 ;;
22050) FREQWARP=0.45 ;;
*) FREQWARP=0.50 ;;
esac
fi
if test -z "$GAMMA"; then
GAMMA=0
fi
if test -z "$MGCLSP"; then
MGCLSP=0
fi
if test -z "$MGCORDER"; then
MGCORDER=39
fi
if test -z "$LNGAIN"; then
LNGAIN=1
fi
if test -z "$LOWERF0"; then
LOWERF0=80
fi
if test -z "$UPPERF0"; then
UPPERF0=350
fi
if test -z "$PSTFILTER"; then
PSTFILTER=1.0
fi
if test -z "$IMPLEN"; then
IMPLEN=4096
fi
MGCVSIZE=`expr $MGCORDER + 1`
if test $GAMMA -eq 0 -a $MGCLSP -eq 1; then
AC_MSG_ERROR(Cannot convert MGC coefficients into LSP form if GAMMA=0!)
fi
if test $GAMMA -ne 0 -a $MGCLSP -eq 0; then
AC_MSG_ERROR(Cannot use MGC coefficients directly if GAMMA>0! Convert into the LSP form by setting MGCLSP=1!)
fi
# substitute variables
AC_SUBST(FRAMESHIFT)
AC_SUBST(FREQWARP)
AC_SUBST(GAMMA)
AC_SUBST(MGCORDER)
AC_SUBST(MGCLSP)
AC_SUBST(LOWERF0)
AC_SUBST(UPPERF0)
AC_SUBST(PSTFILTER)
AC_SUBST(IMPLEN)
AC_SUBST(SAMPFREQ)
AC_SUBST(MGCVSIZE)
# number of windows
# parse command-line arguments
AC_ARG_VAR([NMGCWIN],[number of delta windows for MGC coefficients (default=4)])
AC_ARG_VAR([NLF0WIN],[number of delta windows for log F0 values (default=3)])
AC_ARG_VAR([NBAPWIN],[number of delta windows for band aperiodicity values (default=4)])
# default values
if test -z "$NMGCWIN"; then
NMGCWIN=4
fi
if test -z "$NLF0WIN"; then
NLF0WIN=3
fi
if test -z "$NBAPWIN"; then
NBAPWIN=4
fi
F0STREN=`expr $NLF0WIN + 1`
BAPSTREN=`expr $F0STREN + 1`
# substitute variables
AC_SUBST(NMGCWIN)
AC_SUBST(NLF0WIN)
AC_SUBST(NBAPWIN)
AC_SUBST(F0STREN)
AC_SUBST(BAPSTREN)
# model training settings
# parse command-line arguments
AC_ARG_VAR([NSTATE],[number of HMM states (default=5)])
AC_ARG_VAR([NITER],[number of iterations of embedded training (default=5)])
AC_ARG_VAR([WFLOOR],[mixture weight flooring scale (default=3)])
AC_ARG_VAR([MAXDEV],[maximum duration scaling factor (default=10)])
AC_ARG_VAR([MINDUR],[minimum duration to be evaluated (default=5)])
AC_ARG_VAR([NMGCTRANSBLK],[number of blocks for MGC transforms (default=4)])
AC_ARG_VAR([NLF0TRANSBLK],[number of blocks for log F0 transforms (default=1)])
AC_ARG_VAR([NBAPTRANSBLK],[number of blocks for band aperiodicity transforms (default=4)])
AC_ARG_VAR([MGCBANDWIDTH],[band width for MGC transforms (default=24 for cepstral form, derault=2 for LSP form)])
AC_ARG_VAR([LF0BANDWIDTH],[band width for log F0 transforms (default=1)])
# default values
if test -z "$NSTATE"; then
NSTATE=5
fi
if test -z "$NITER"; then
NITER=5
fi
if test -z "$WFLOOR"; then
WFLOOR=3
fi
if test -z "$MAXDEV"; then
MAXDEV=10
fi
if test -z "$MINDUR"; then
MINDUR=5
fi
if test -z "$NMGCTRANSBLK"; then
NMGCTRANSBLK=4
fi
if test -z "$NLF0TRANSBLK"; then
NLF0TRANSBLK=1
fi
if test -z "$NBAPTRANSBLK"; then
NBAPTRANSBLK=4
fi
if test -z "$MGCBANDWIDTH"; then
if test $MGCLSP -eq 0; then
MGCBANDWIDTH=$MGCORDER
else
MGCBANDWIDTH=2
fi
fi
if test -z "$LF0BANDWIDTH"; then
LF0BANDWIDTH=0
fi
if test -z "$BAPBANDWIDTH"; then
BAPBANDWIDTH=5
fi
# substitute variables
AC_SUBST(NSTATE)
AC_SUBST(NITER)
AC_SUBST(WFLOOR)
AC_SUBST(MAXDEV)
AC_SUBST(MINDUR)
AC_SUBST(NMGCTRANSBLK)
AC_SUBST(NLF0TRANSBLK)
AC_SUBST(NBAPTRANSBLK)
AC_SUBST(MGCBANDWIDTH)
AC_SUBST(LF0BANDWIDTH)
AC_SUBST(BAPBANDWIDTH)
# parameter generation algorithm settings
# parse command-line arguments
AC_ARG_VAR([MAXEMITER],[max EM iteration (default=20)])
AC_ARG_VAR([EMEPSILON],[convergence factor for EM iteration (default=0.0001)])
AC_ARG_VAR([USEGV],[turn on GV-based parameter generation algorithm (0:off or 1:on, default=1)])
AC_ARG_VAR([MAXGVITER],[maximum number of iterations of GV-based parameter generation algorithm (default=50)])
AC_ARG_VAR([GVEPSILON],[convergence factor for GV iteration (default=0.0001)])
AC_ARG_VAR([MINEUCNORM],[minimum Euclid norm for GV iteration (default=0.01)])
AC_ARG_VAR([STEPINIT],[initial step size (default=1.0)])
AC_ARG_VAR([STEPINC],[step size acceleration factor (default=1.2)])
AC_ARG_VAR([STEPDEC],[step size deceleration factor (default=0.5)])
AC_ARG_VAR([HMMWEIGHT],[weight for HMM output prob. (default=1.0)])
AC_ARG_VAR([GVWEIGHT],[weight for GV output prob. (default=1.0)])
AC_ARG_VAR([OPTKIND],[optimization method (STEEPEST, NEWTON, or LBFGS) (default=NEWTON)])
# default values
if test -z "$MAXEMITER"; then
MAXEMITER=20
fi
if test -z "$EMEPSILON"; then
EMEPSILON=0.0001
fi
if test -z "$USEGV"; then
USEGV=1
fi
if test -z "$MAXGVITER"; then
MAXGVITER=50
fi
if test -z "$GVEPSILON"; then
GVEPSILON=0.0001
fi
if test -z "$MINEUCNORM"; then
MINEUCNORM=0.01
fi
if test -z "$STEPINIT"; then
STEPINIT=1.0
fi
if test -z "$STEPINC"; then
STEPINC=1.2
fi
if test -z "$STEPDEC"; then
STEPDEC=0.5
fi
if test -z "$HMMWEIGHT"; then
HMMWEIGHT=1.0
fi
if test -z "$GVWEIGHT"; then
GVWEIGHT=1.0
fi
if test -z "$OPTKIND"; then
OPTKIND=NEWTON
fi
# substitute variables
AC_SUBST(MAXEMITER)
AC_SUBST(EMEPSILON)
AC_SUBST(USEGV)
AC_SUBST(MAXGVITER)
AC_SUBST(GVEPSILON)
AC_SUBST(MINEUCNORM)
AC_SUBST(STEPINIT)
AC_SUBST(STEPINC)
AC_SUBST(STEPDEC)
AC_SUBST(HMMWEIGHT)
AC_SUBST(GVWEIGHT)
AC_SUBST(OPTKIND)
# output data/Makefile and scripts/Config.pm
AC_OUTPUT(data/Makefile scripts/Config.pm Makefile)