#!/bin/sh
# This material contains unpublished, proprietary software of 
# Entropic Research Laboratory, Inc. Any reproduction, distribution, 
# or publication of this work must be authorized in writing by Entropic 
# Research Laboratory, Inc., and must bear the notice: 
#
#    "Copyright (c) 1990-1992  Entropic Research Laboratory, Inc. 
#                   All rights reserved"
#
# The copyright notice above does not evidence any actual or intended 
# publication of this source code.     
#
# @(#)testfile	3.6	11/24/92	ERL
# 
# Written by:  Rod Johnson
# Checked by:
# Revised by:
# 
# Brief description:
# 

echo "Testing impulse_resp."
echo "There should be no diff output."
#
# MAKE TEST FILE test.filt
#
atofilt  - - test.filt << aArDvArK1
2
3.0 2.0
3
1.0 0.5 0.1
aArDvArK1
#
# END OF TEST FILE test.filt
# MAKE COMPARISON FILE test.asc
# 
cat > test.asc << aArDvArK2
Record 1: num_size: 30, denom_size: 0

re_num_coeff:
  0:          3        0.5      -0.55      0.225    -0.0575 
  5:    0.00625   0.002625 -0.0019375 0.00070625 -0.00015937 
 10: 9.0625e-06 1.1406e-05 -6.6094e-06 2.1641e-06 -4.2109e-07 
 15: -5.8594e-09 4.5039e-08 -2.1934e-08 6.4629e-09 -1.0381e-09 
 20: -1.2725e-10 1.6743e-10 -7.0991e-11 1.8752e-11 -2.2771e-12 
 25: -7.3669e-13 5.9606e-13 -2.2436e-13 5.2574e-14 -3.851e-15 


aArDvArK2
#
# END OF COMPARISON FILE test.asc
# RUN impulse_resp, CHECK OUTPUT, AND CLEAN UP.
#
impulse_resp -n30  test.filt - | psps -H - | diff test.asc -
echo " "
echo "Testing inversion option -i"
echo "There should be no diff output."
atofilt  - - test.filt << aArDvArK1
3
1.0 0.5 0.1
4
3.0 2.0 0.0 0.0
aArDvArK1
impulse_resp -n30 -i test.filt - \
	| psps -H - \
	| diff test.asc -
rm test.filt test.asc
echo "Done testing impulse_resp."

