runtestv
上传用户:touchwatch
上传日期:2007-01-06
资源大小:168k
文件大小:3k
- #!/usr/local.1122/bin/ksh
- # @(#)tv.run 1.7 4/27/92
- #
- # This is a shell script to do test vector verifiication for the CCITT G.728
- # 16 kb/s LD-CELP coder.
- #
- tv=/usr/kroon/w/standards/g728/testv # directory where test vectors are
- BIN=. # directory where executables are
- TOOLS=/usr/kroon/w/standards/g728/verify #tools directory
- #
- # check if testvectors are available
- #
- if [ -d "$tv" ]
- then
- #
- # PASS TEST VECTORS THROUGH ENCODER
- #
- for j in $tv/in?.bn # ? is 1, 2, 3, 4, 5, or 6
- do
- rm -f INPUT
- cp $j INPUT
- xd=${j##*/} # xd=in?.bn
- x=${xd%%.bn} # x=in?
- y=${j%%.bn} # y=$tv/in?
- z=${x##in} # z=?
- print Floating-point encoder encoding $xd
- $BIN/ccelp INPUT BIT-STREAM
- $BIN/dcelpnpf BIT-STREAM OUTPUT
- mv BIT-STREAM $tv/incw$z.tx
- mv OUTPUT ${y}tx.d
- done
- #
- # PASS TEST VECTORS THROUGH DECODER
- #
- for j in $tv/cw?.bn
- do
- rm -f BIT-STREAM
- cp $j BIT-STREAM
- xd=${j##*/} # xd=cw?.bn
- x=${xd%%.bn} # x=cw?
- y=${j%%.bn} # y=$tv/cw?
- z=${x##cw} # z=?
- print Floating-point decoder decoding $xd
- $BIN/dcelpnpf BIT-STREAM OUTPUT
- mv OUTPUT $tv/outa$z.rx
- done
- rm -f BIT-STREAM
- cp $tv/cw4.bn BIT-STREAM
- print Floating-point decoder + postfilter decoding cw4.bn
- $BIN/dcelp BIT-STREAM OUTPUT
- mv OUTPUT $tv/outb4.rpf
- #
- # VERIFY FLOATING-POINT ENCODER OUTPUTS
- #
- rm -f tv.out
- echo ============================================================== >> tv.out
- echo Test vector verification results for Floating-Point Encoder: >> tv.out
- date >>tv.out
- echo ============================================================== >> tv.out
- for j in $tv/incw[1-4].bn $tv/incw6.bn
- do
- xd=${j##*/} # xd=incw?.bn
- x=${xd%%.bn} # x=incw?
- echo -------------------------------------------------------------- >> tv.out
- echo Comparing bit stream files $xd and $x.tx ... >> tv.out
- $TOOLS/cwcomp $tv/$xd $tv/$x.tx >> tv.out
- done
- #
- # VERIFY FLOATING-POINT DECODER OUTPUTS
- #
- echo ============================================================== >> tv.out
- echo Test vector verification results for Floating-Point Decoder: >> tv.out
- for j in $tv/outa?.bn
- do
- xd=${j##*/} # xd=outa?.bn
- x=${xd%%.bn} # x=outa?
- echo -------------------------------------------------------------- >> tv.out
- echo SNR of file $x.rx ... >> tv.out
- $TOOLS/snr $tv/$xd $tv/$x.rx >> tv.out
- done
- echo --------------------------------------------------------- >> tv.out
- echo Floating-point decoder + postfilter test: >> tv.out
- echo SNR of file outb4.rpf ... >> tv.out
- $TOOLS/snr $tv/outb4.bn $tv/outb4.rpf >> tv.out
- rm -f *.tmp INPUT BIT-STREAM
- rm -f $tv/*.d $tv/*.tx $tv/*.rx $tv/*.rpf
- print Results have been written to file: tv.out
- else
- print Testvector directory $tv not found
- fi