#!/bin/csh
#############################################################################
#
# Test SNR/harmonicity mask Missing Data ASR on Aurora Test Set A data
#
# Requires the environment variables $CTKROOT & $CTK_AURORAROOT to be set.
#
#   syntax: test_harmonicity_asr NOISETYPE SNR
#
#   NOISETYPE can be 1, 2, 3, or 4 - i.e. the 4 Aurora test set A noises
#   SNR can be,  -5, 0, 5, 10, 15, 20,  or  clean
#
#  e.g to set noise type 1 utterances on the clean data set:
#        test_harmonicity_asr 1 clean
#     to test noise type 3 with at 10dB SNR
#        test_harmonicity_asr 3 10
#
#############################################################################

setenv NOISETYPE $1
setenv SNR $2

if ($SNR == "clean") then
    setenv SETNAME $SNR$NOISETYPE
else
    setenv SETNAME N$NOISETYPE\_SNR$SNR
endif

# Set suitable values for the harmonicity_asr script parameters:
# (Note, the following values have been determined empirically and appear
# to work well for most noise types.)
setenv P1 780   # Voicing sigmoid centre  (i.e. 0.780)
setenv P2 500   # Harmonicity mask sigmoid centre  (i.e. 0.5)
setenv P3 400   # SNR mask sigmoid centre  (i.e. 0.4)


# Set RATE32_DATA_PATH and HARMONICITY_DATA_PATH which are required by the CTK script

setenv RATE32_DATA_PATH $CTK_AURORAROOT/data/rate32_d/testa/$SETNAME
setenv HARMONICITY_DATA_PATH $CTK_AURORAROOT/data/harmonicity/testa/$SETNAME

# Run the CTK script using Aurora 3 mixture models
#

$CTKROOT/bin/CTKScript harmonicity_asr.ctk $CTK_AURORAROOT/models/models.rate32_d.GI.7mix -S  $CTK_AURORAROOT/flists/$NOISETYPE.flist -S $CTK_AURORAROOT/transcriptions/$NOISETYPE.trans 0.$P1 0.$P2 0.$P3 ""

# Results are sent to stdout, and can be redirected to a file.
# To send results directly to a file replace "" with a file name.
#

