check

来自「speech signal process tools」· 代码 · 共 605 行 · 第 1/2 页

TXT
605 行
字号
#frame_len	90 #num_pulses	0 #frame_type	UNVOICED #voiced_fraction	0 #raw_power	108.01 -1 0 0 0 0 0 0 	0 #lpc_power	72.7474 -1 0 0 0 0 0 0 	0 #p_pulse_len	0 0 0 0 0 0 0 0 	0 #spec_param	264.209 559.896 #Tag 195#frame_len	90 #num_pulses	0 #frame_type	UNVOICED #voiced_fraction	0 #raw_power	127.188 -1 0 0 0 0 0 0 	0 #lpc_power	94.8108 -1 0 0 0 0 0 0 	0 #p_pulse_len	0 0 0 0 0 0 0 0 	0 #spec_param	321.138 567.859 #Tag 285#frame_len	90 #num_pulses	0 #frame_type	UNVOICED #voiced_fraction	0 #raw_power	153.627 -1 0 0 0 0 0 0 	0 #lpc_power	94.7586 -1 0 0 0 0 0 0 	0 #p_pulse_len	0 0 0 0 0 0 0 0 	0 #spec_param	322.014 547.445 ENDecho Convert $ASCII_TEST to input test fileecho "atosps $ASCII_TEST $TEST_FILE"atosps $ASCII_TEST $TEST_FILEecho " "echo "Check the mean, covariance, and inverse covariance computation"echo "fea_stats -I -nLSF -fspec_param $TEST_FILE - | tee $TEST_STAT | psps -H - > $RESULT"echo  " "fea_stats -I -nLSF -fspec_param $TEST_FILE - | tee $TEST_STAT | psps -H - > $RESULTecho " " # make ascii file for comapring fea_stats outputcat >$ASCII_RESULT <<END.RESULTRecord 1: class:  LSF nsamp:  4 mean:    0:     310.36725     553.22351 covar:    0:     981.95398    -195.44623    -195.44623      177.7592 invcovar:    0:  0.0013036776  0.0014333935  0.0014333933  0.0072016041 END.RESULTecho diff $RESULT with correct outputecho " " diff $RESULT $ASCII_RESULTecho  " "echo If there was no significant diff output, then everything is OK so farecho " "echo "Now let's check -i , -f, and -r options"echo "First the -i option"echo " "echo "fea_stats -i0,1,4 -fraw_power $TEST_FILE > $I_RESULT"fea_stats -i0,1,4 -fraw_power $TEST_FILE > $I_RESULTecho  " "#Make the ascii file to compare with $I_RESULTcat >$I_ASCII <<END.I_OPTIONField Name   Elemt    Min      at        Max      at       Mean       Std. Dev----------   -----  --------   --      --------   --     --------     --------raw_power    0         108.01   2         153.63   4        126.37        19.79raw_power    1          -1.00   1          -1.00   1         -1.00         0.00raw_power    4           0.00   1           0.00   1          0.00         0.00END.I_OPTIONecho "diff $I_RESULT $I_ASCII"diff $I_RESULT $I_ASCIIecho  " "echo There should be no diff outputecho " "echo Now check the -f optionecho ""echo "fea_stats -R -f\"raw_power[0,1,4]\" $TEST_FILE > $F_RESULT"fea_stats -R -f"raw_power[0,1,4]" $TEST_FILE > $F_RESULTecho "diff $F_RESULT $I_ASCII"diff $F_RESULT $I_ASCIIecho  " "echo There should be no diff outputecho ""echo Now check the -r optionecho " " echo "fea_stats -r2:4 -R -fp_pulse_len $TEST_FILE"fea_stats -r2:4 -R -fp_pulse_len $TEST_FILEecho " " echo The MIN, MAX, MEAN, and STD. DEV should all = 0.0echo for all 9 elements in the field.echo " " echo "Check adding records to existing STAT(5-ESPS) file"echo  " "echo "fea_stats -I -fspec_param -nLSF  $TEST_FILE $TEST_STAT"fea_stats -I -fspec_param -nLSF  $TEST_FILE $TEST_STATecho " "echo "check fea_stats output; it should contain two identical records"psps -H $TEST_STAT## Check with various input data types.#echo Checking consistent treatment of data types.echo Making Ascii input file with same data in fields of 5 types.echo " "cat >$ASCII_MULT <<aArDvArK1{01 d02 6a1a03 Thu Oct  1 14:50:36 1987 04 1.5005 fea_edit06 1.607 7/16/8753 burton08 409 10b 1e0c 20d 110 4.fana12 fea_edit -g 4.fana 
hdshrink t.fana t2.fana 
Embedded headers dropped by hdshrink
 Converted from t2.fana by spstoa.
521 2 0frame_len LONG 1 0 num_pulses LONG 1 0 frame_type CODED 1 0  NONE UNKNOWN VOICED UNVOICED SILENCE TRANSITIONvoiced_fraction FLOAT 1 0 raw_power FLOAT 9 1 lpc_power FLOAT 9 1 p_pulse_len FLOAT 9 1 spec_param_b FLOAT 2 1 spec_param_s FLOAT 2 1 spec_param_l FLOAT 2 1 spec_param_f FLOAT 2 1 spec_param_d FLOAT 2 1 @nan LONG 1 134887 @src_sf FLOAT 1 8000 @frmlen SHORT 1 180 @maxlpc LONG 1 9 @spec_rep CODED 1 [ NONE RC LAR LSF AUTO AFC CEP AF ] LSF @order_vcd LONG 1 2 @maxraw LONG 1 9 @start LONG 1 15 @filters CODED 1 [ NO YES ] NO @pre_siz SHORT 2 3 3 @matsiz SHORT 1 11 @pre_poles FLOAT 3 1 0 0 @win_type SHORT 1 0 @order_unvcd LONG 1 2 @pre_zeros FLOAT 3 1 -0.875 0 @rms_fullscale DOUBLE 1 0 @maxpulses LONG 1 9 }#Tag 15#frame_len	90 #num_pulses	1#frame_type	VOICED #voiced_fraction	0 #raw_power	116.642 -1 0 0 0 0 0 0 	0 #lpc_power	80.3488 -1 0 0 0 0 0 0 	0 #p_pulse_len	30 0 0 0 0 0 0 0 	0 #spec_param_b	334 537 #spec_param_s	334 537 #spec_param_l	334 537 #spec_param_f	334 537 #spec_param_d	334 537 #Tag 105#frame_len	90 #num_pulses	0 #frame_type	UNVOICED #voiced_fraction	0 #raw_power	108.01 -1 0 0 0 0 0 0 	0 #lpc_power	72.7474 -1 0 0 0 0 0 0 	0 #p_pulse_len	0 0 0 0 0 0 0 0 	0 #spec_param_b	264 559 #spec_param_s	264 559 #spec_param_l	264 559 #spec_param_f	264 559 #spec_param_d	264 559 #Tag 195#frame_len	90 #num_pulses	0 #frame_type	UNVOICED #voiced_fraction	0 #raw_power	127.188 -1 0 0 0 0 0 0 	0 #lpc_power	94.8108 -1 0 0 0 0 0 0 	0 #p_pulse_len	0 0 0 0 0 0 0 0 	0 #spec_param_b	321 567 #spec_param_s	321 567 #spec_param_l	321 567 #spec_param_f	321 567 #spec_param_d	321 567 #Tag 285#frame_len	90 #num_pulses	0 #frame_type	UNVOICED #voiced_fraction	0 #raw_power	153.627 -1 0 0 0 0 0 0 	0 #lpc_power	94.7586 -1 0 0 0 0 0 0 	0 #p_pulse_len	0 0 0 0 0 0 0 0 	0 #spec_param_b	322 547 #spec_param_s	322 547 #spec_param_l	322 547 #spec_param_f	322 547 #spec_param_d	322 547 aArDvArK1echo Convert $ASCII_MULT to input test file $TEST_MULTecho "atosps $ASCII_MULT $TEST_MULT"atosps $ASCII_MULT $TEST_MULTecho " "echo Running fea_stats to make 5 output files.echo "fea_stats -I -nLSF -fspec_param_b $TEST_MULT - > $RESULT_B"fea_stats -I -nLSF -fspec_param_b $TEST_MULT - > $RESULT_Becho "fea_stats -I -nLSF -fspec_param_s $TEST_MULT - > $RESULT_S"fea_stats -I -nLSF -fspec_param_s $TEST_MULT - > $RESULT_Secho "fea_stats -I -nLSF -fspec_param_l $TEST_MULT - > $RESULT_L"fea_stats -I -nLSF -fspec_param_l $TEST_MULT - > $RESULT_Lecho "fea_stats -I -nLSF -fspec_param_f $TEST_MULT - > $RESULT_F"fea_stats -I -nLSF -fspec_param_f $TEST_MULT - > $RESULT_Fecho "fea_stats -I -nLSF -fspec_param_d $TEST_MULT - > $RESULT_D"fea_stats -I -nLSF -fspec_param_d $TEST_MULT - > $RESULT_Decho " " # Make ascii file for comparing with fea_stats output.echo Making Ascii file $RESULT_ASC for comparing with fea_stats output.cat >$RESULT_ASC <<aArDvArK2Record 1: class:  LSF nsamp:  4 mean:    0:        310.25         552.5 covar:    0:     985.58331    -192.50002    -192.50002     174.33333 invcovar:    0:  0.0012936217  0.0014284257  0.0014284257  0.0073134149 aArDvArK2# Compare ascii file with fea_stats output.echo "Comparing output from byte input with correct result."echo "psps -H $RESULT_B | diff $RESULT_ASC -"psps -H $RESULT_B | diff $RESULT_ASC -echo "Comparing output from short input with correct result."echo "psps -H $RESULT_S | diff $RESULT_ASC -"psps -H $RESULT_S | diff $RESULT_ASC -echo "Comparing output from long input with correct result."echo "psps -H $RESULT_L | diff $RESULT_ASC -"psps -H $RESULT_L | diff $RESULT_ASC -echo "Comparing output from float input with correct result."echo "psps -H $RESULT_F | diff $RESULT_ASC -"psps -H $RESULT_F | diff $RESULT_ASC -echo "Comparing output from double input with correct result."echo "psps -H $RESULT_D | diff $RESULT_ASC -"psps -H $RESULT_D | diff $RESULT_ASC -echo ""echo "Now try non-stat-file output for 5 input data types."echo "Running fea_stats on the same file."echo "The results for all 5 fields should be identical."echo ""fea_stats -nLSF -fspec_param_b -fspec_param_s -fspec_param_l -fspec_param_f -fspec_param_d $TEST_MULTecho ""## Clean up!#rm -f $ASCII_FILE $ANSWER $FEA_FILE $TEST_FILE $RESULT $ASCII_TEST $TEST_STATrm -f $I_ASCII $I_RESULT $F_RESULT $ASCII_RESULT $ASCII_MULTrm -f $TEST_MULT $RESULT_B $RESULT_S $RESULT_L $RESULT_F $RESULT_D $RESULT_ASCecho TEST SCRIPT IS DONE

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?