#!/bin/sh
#
#  This material contains proprietary software of Entropic Speech,
#  Inc.  Any reproduction, distribution, or publication without the
#  prior written permission of Entropic Speech, Inc. is strictly
#  prohibited.  Any public distribution of copies of this work
#  authorized in writing by Entropic Speech, Inc. must bear the notice
#
#   "Copyright (c) 1988 Entropic Speech, Inc.  All rights reserved."
# 				
#
# test file for cross_cor @(#)testfile	1.4 10/29/90 ESI

echo "Testing cross_cor."
echo "Diff output, if any, should show only small differences."
ESPS_VERBOSE=0
export ESPS_VERBOSE
#
# MAKE TEST FILE test1.sd.
#
testsd -a - test1.sd <<aArDvArK1
130000
5 0 0 0 0
0 0 0 0 5
1 2 3 4 5
0 1 2 1 0
1 4 6 4 1
17000 230 230 230 230 230 230
aArDvArK1
#
# END OF TEST FILE test1.sd.
# MAKE TEST FILE test2.sd.
#
testsd -a - test2.sd <<aArDvArK2
-11000 900
1 2 3 4 5
1 2 3 4 5
0 0 5 0 0
0 5 10 5 0
5 20 30 20 5
1900 47 47 47 47 47 47 47 47 47 47
aArDvArK2
#
# END OF TEST FILE test2.sd.
# MAKE COMPARISON FILE test3.asc.
#
cat > test3.asc <<aArDvArK3
File: <stdin>

---Universal Part of Header---
File type: FEA (Feature File)
Number of data records: unknown (input is pipe)
Data is not tagged.
comment text:
 cross_cor -p2:26 -p3: -l5 -wRECT -o-5:5 -S5 test1.sd test2.sd - 
Source files: test1.sd
              test2.sd
There is no reference header.

Record 1: 
tag1:  2 
tag2:  3 
cross_cor:  
  0:             0             5             4             3             2 
  5:             1             0             0             0             0 
 10:             0 

Record 2: 
tag1:  7 
tag2:  8 
cross_cor:  
  0:             0             0             0             0             0 
  5:             5             4             3             2             1 
 10:             0 

Record 3: 
tag1:  12 
tag2:  13 
cross_cor:  
  0:             0             0             0             1             2 
  5:             3             4             5             0             0 
 10:             0 

Record 4: 
tag1:  17 
tag2:  18 
cross_cor:  
  0:             0             0             0             1             4 
  5:             6             4             1             0             0 
 10:             0 

Record 5: 
tag1:  22 
tag2:  23 
cross_cor:  
  0:             0             1             8            28            56 
  5:            70            56            28             8             1 
 10:             0 

aArDvArK3
#
# END OF COMPARISON FILE test3.asc.
#
#
# MAKE TEST FILE test4.sd.
#
testsd -a - test4.sd <<aArDvArK4
-3.685 2.555 -0.415 0.33 -2.81
-4.53 1.79 1.795 4.35 -1.165
0.195 3.31 -4.655 -4.47 0.295
1.71 -4.925 -1.165 -4.335 -0.825
aArDvArK4
#
# END OF TEST FILE test4.sd.
# MAKE TEST FILE test5.sd.
#
testsd -a - test5.sd <<aArDvArK5
-2.024 -1.076 3.932 2.052 1.06
-1.376 1.888 -3.624 -1.9 2.1
3.284 1.612 -0.672 1.232 -3.264
0.216 2.772 3.444 0.712 1.496
aArDvArK5
#
# END OF TEST FILE test5.sd.
# MAKE COMPARISON FILE test6.asc.
#
cat > test6.asc <<aArDvArK6
File: <stdin>

---Universal Part of Header---
File type: FEA (Feature File)
Number of data records: unknown (input is pipe)
Data is not tagged.
comment text:
 cross_cor -wHAMMING test4.sd test5.sd - 
Source files: test4.sd
              test5.sd
There is no reference header.

Record 1: 
tag1:  1 
tag2:  1 
cross_cor:  
  0:    0.18664849    0.38721377 0.00018877033   -0.10687287   -0.73311222 
  5:   -0.17793171   -0.29978645    0.72298729     1.4550378   -0.18085395 
 10:   -0.39795011   -0.33923748   -0.13488886    -1.5640171  -0.040140126 
 15:     1.2916383   0.021839939   -0.36981642   0.037311364    0.14907318 
 20:   -0.30963653 

aArDvArK6
#
# END OF COMPARISON FILE test6.asc.
#
#
# RUN PROGRAM, CHECK OUTPUT, AND CLEAN UP.
#
cross_cor -p2:26 -p3: -l5 -wRECT -o-5:5 -S5 test1.sd test2.sd - \
	| psps - \
	| egrep -v '^File header date:|^Produced by:|^Hostname:path:|^Machine type:' \
	| diff test3.asc -
cross_cor -wHAMMING test4.sd test5.sd - \
	| psps - \
	| egrep -v '^File header date:|^Produced by:|^Hostname:path:|^Machine type:' \
	| diff test6.asc -
rm test1.sd test2.sd test3.asc test4.sd test5.sd test6.asc
echo "Done testing cross_cor."
