comparison trunk/scripts/gen_features.sh @ 316:66a23c0545b6

-Added MFCCs back to the feature generation script
author tomwalters
date Thu, 04 Mar 2010 17:38:58 +0000
parents f8aa25bd6085
children
comparison
equal deleted inserted replaced
315:90488d48b267 316:66a23c0545b6
12 12
13 # Location of the AIMCopy binary if not in the path 13 # Location of the AIMCopy binary if not in the path
14 AIMCOPY_PREFIX="../aimc-read-only/build/posix-release/" 14 AIMCOPY_PREFIX="../aimc-read-only/build/posix-release/"
15 15
16 MACHINE_CORES=8 16 MACHINE_CORES=8
17
18 # Set to true / 1 to enable MFCC features rather than AIM features
19 # (leave blank for AIM features)
20 MFCC_FEATURES=
17 21
18 # Names of various internal files and directories. 22 # Names of various internal files and directories.
19 # Rename here if you don't like them for some reason. 23 # Rename here if you don't like them for some reason.
20 SYLLIST=syls 24 SYLLIST=syls
21 TRAIN_SPEAKERS=train_speakers 25 TRAIN_SPEAKERS=train_speakers
24 TRAIN_LIST=train.list 28 TRAIN_LIST=train.list
25 TEST_LIST=test.list 29 TEST_LIST=test.list
26 COMBINED_LIST=combined.list 30 COMBINED_LIST=combined.list
27 FEATURES_DIR=features 31 FEATURES_DIR=features
28 AIMCOPY_CONFIG=aimcopy.cfg 32 AIMCOPY_CONFIG=aimcopy.cfg
33 HCOPY_CONFIG=hcopy.cfg
29 AIMCOPY_LOG_TRAIN=aimcopy_train.log 34 AIMCOPY_LOG_TRAIN=aimcopy_train.log
30 AIMCOPY_LOG_TEST=aimcopy_test.log 35 AIMCOPY_LOG_TEST=aimcopy_test.log
36 HTK_PREFIX=""
31 37
32 38
33 # The vowels and consonants that make up the CNBH database 39 # The vowels and consonants that make up the CNBH database
34 VOWELS="a e i o u" 40 VOWELS="a e i o u"
35 CONSONANTS="b d f g h k l m n p r s t v w x y z" 41 CONSONANTS="b d f g h k l m n p r s t v w x y z"
167 ssi.weight_by_cutoff=false 173 ssi.weight_by_cutoff=false
168 ssi.weight_by_scaling=true 174 ssi.weight_by_scaling=true
169 ssi.log_cycles_axis=true 175 ssi.log_cycles_axis=true
170 EOF 176 EOF
171 echo "noise.level_db=$1" >> $WORK/$AIMCOPY_CONFIG 177 echo "noise.level_db=$1" >> $WORK/$AIMCOPY_CONFIG
178
179 echo "Creating HCopy config file..."
180 cat <<"EOF" > $WORK/$HCOPY_CONFIG
181 # Coding parameters
182 SOURCEFORMAT= WAV
183 TARGETKIND = MFCC_0_D_A
184 TARGETRATE = 100000.0
185 SAVECOMPRESSED = T
186 SAVEWITHCRC = T
187 WINDOWSIZE = 250000.0
188 USEHAMMING = T
189 PREEMCOEF = 0.97
190 NUMCHANS = 200
191 CEPLIFTER = 22
192 NUMCEPS = 12
193 ENORMALISE = F
194 EOF
172 195
173 echo "Splitting data files..." 196 echo "Splitting data files..."
174 cat $WORK/${TRAIN_LIST} $WORK/${TEST_LIST} > $WORK/${COMBINED_LIST} 197 cat $WORK/${TRAIN_LIST} $WORK/${TEST_LIST} > $WORK/${COMBINED_LIST}
175 198
176 total_cores=$(($MACHINE_CORES)) 199 total_cores=$(($MACHINE_CORES))
186 splits=( $(ls $WORK/split_list*)) 209 splits=( $(ls $WORK/split_list*))
187 element=0 210 element=0
188 echo "Spawning tasks..." 211 echo "Spawning tasks..."
189 for ((c=1;c<=$MACHINE_CORES;c+=1)); do 212 for ((c=1;c<=$MACHINE_CORES;c+=1)); do
190 s=${splits[$element]} 213 s=${splits[$element]}
191 ${AIMCOPY_PREFIX}AIMCopy -C $WORK/$AIMCOPY_CONFIG -S $s & 214 if [ "$MFCC_FEATURES" ]
215 then
216 ${HTK_PREFIX}HCopy -T 1 -C $WORK/$HCOPY_CONFIG -S $s &
217 else
218 ${AIMCOPY_PREFIX}AIMCopy -C $WORK/$AIMCOPY_CONFIG -S $s &
219 fi
192 let element=element+1 220 let element=element+1
193 done 221 done
194 222
195 echo "Waiting for tasks to complete..." 223 echo "Waiting for tasks to complete..."
196 wait 224 wait