comparison trunk/experiments/scripts/master.sh @ 335:71c438f9daf7

- Scripts for running recognition experiments using AIM-C and HTK to compare MFCCs against features generated with AIM-C
author tomwalters
date Wed, 04 Aug 2010 06:41:56 +0000
parents
children b6b6b2082760
comparison
equal deleted inserted replaced
334:4ee5bb246f60 335:71c438f9daf7
1 #!/bin/bash
2 # Copyright 2010 Thomas Walters <tom@acousticscale.org>
3 #
4 # Run a series of experiments which compare MFCC features generated by HTK to
5 # AIM features generated using AIM-C using a series of syllable recogntiton
6 # tasks.
7 # This script expects the HTK binaries and AIM-C AIMCopy binary to be present
8 # in the PATH.
9
10 # Set these to be the location of your input database, and desired output
11 # locations.
12 SYLLABLES_DATABASE_TAR=/media/sounds/cnbh-syllables.tar
13 SOUNDS_ROOT=/mnt/experiments/sounds/
14 FEATURES_ROOT=/mnt/experiments/features/
15 HMMS_ROOT=/mnt/experiments/hmms/
16
17 # Number of cores on the experimental machine. Various scripts will try to use
18 # this if it's set.
19 NUMBER_OF_CORES=2
20
21 # Fail if any command fails
22 set -e
23
24 # Fail if any variable is unset
25 set -u
26
27 if [ ! -d $SOUNDS_ROOT ]; then
28 mkdir -p $SOUNDS_ROOT
29 fi
30
31 # Untar the CNBH syllables database, and convert the files from FLAC to WAV
32 if [ ! -e $SOUNDS_ROOT/.untar_db_success ]; then
33 tar -x -C $SOUNDS_ROOT -f $SYLLABLES_DATABASE_TAR
34 touch $SOUNDS_ROOT/.untar_db_success
35 fi
36
37 # Convert the database to .WAV format and place it in $SOUNDS_ROOT/clean
38 ./cnbh-syllables/convert_flac_to_wave.sh $SOUNDS_ROOT
39
40 # Generate versions of the CNBH syllables spoke pattern with a range of
41 # signal-to-noise ratios (SNRs). The versions are put in the directory
42 # ${SOUNDS_ROOT}/${SNR}_dB/ for each SNR in $SNRS.
43 SNRS="30 27 24 21 18 15 12 9 6 3 0"
44 ./cnbh-syllables/pink_noise.sh $SOUNDS_ROOT/clean/ $SNRS
45
46 # Make the list of all feature drectories
47 FEATURE_DIRS="clean"
48 for SNR in $SNRS; do
49 FEATURE_DIRS="$FEATURE_DIRS snr_${SNR}dB"
50 done
51
52 # Generate feature sets (for the full range of SNRs in $FEATURE_DIRS)
53 # 1. Standard MFCC features
54 # 2. AIM features
55 # 3. MFCC features with optimal VTLN
56 for SOURCE_SNR in $FEATURE_DIRS; do
57
58 if [ ! -e $FEATURES_ROOT/mfcc/$SOURCE_SNR/.make_mfcc_features_success]
59 then
60 mkdir -p $FEATURES_ROOT/mfcc/$SOURCE_SNR/
61 # Generate the list of files to convert
62 ./cnbh-syllables/feature_generation/gen_hcopy_aimcopy_script.sh $FEATURES_ROOT/mfcc/$SOURCE_SNR/ $SOUNDS_ROOT/$SOURCE_SNR/
63 # Run the conversion
64 ./cnbh-syllables/feature_generation/run_hcopy.sh $FEATURES_ROOT/mfcc/$SOURCE_SNR/ $NUMBER_OF_CORES
65 touch $FEATURES_ROOT/mfcc/$SOURCE_SNR/.make_mfcc_features_success
66 done
67
68 if [ ! -e $FEATURES_ROOT/mfcc_vtln/$SOURCE_SNR/.make_mfcc_vtln_features_success]
69 then
70 mkdir -p $FEATURES_ROOT/mfcc_vtln/$SOURCE_SNR/
71 # Generate the file list and run the conversion (all one step, since this
72 # version uses a different configuraiton for each talker)
73 ./cnbh-syllables/feature_generation/run_mfcc_vtln_conversion.sh $FEATURES_ROOT/mfcc_vtln/$SOURCE_SNR/ $SOUNDS_ROOT/$SOURCE_SNR/
74 touch $FEATURES_ROOT/mfcc_vtln/$SOURCE_SNR/.make_mfcc_vtln_features_success
75 done
76
77 if [ ! -e $FEATURES_ROOT/aim/$SOURCE_SNR/.make_aim_features_success]
78 then
79 mkdir -p $FEATURES_ROOT/aim/$SOURCE_SNR/
80 ./cnbh-syllables/feature_generation/gen_hcopy_aimcopy_script.sh $FEATURES_ROOT/aim/$SOURCE_SNR/ $SOUNDS_ROOT/$SOURCE_SNR/
81 # Run the conversion
82 ./cnbh-syllables/feature_generation/run_aimcopy.sh $FEATURES_ROOT/aim/$SOURCE_SNR/ $NUMBER_OF_CORES
83 touch $FEATURES_ROOT/aim/$SOURCE_SNR/.make_aim_features_success
84 done
85 done
86
87 # Now run a bunch of experiments.
88 # For each of the feature types, we want to run HMMs with a bunch of
89 # parameters.
90 TRAINING_ITERATIONS="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"
91 TESTING_ITERATIONS="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"
92 HMM_STATES="3 4 5 6 7 8"
93 HMM_OUTPUT_COMPONENTS=""
94
95