📄 xspecav
字号:
#!/bin/sh # @(#)xspecav 1.5 5/8/98 ERL# this script assumes that the input file is a FEA_SPEC file; it # produces another FEA_SPEC file with average spectra -- each output spectrum# is a block average, i.e., the average of the block_size spectra prior# to the corresponding record in the input. # $1 = range# $2 = input file# $3 = output file# set -x range=$1infile=$2outfile=$3#!!!!!!!!!!!!! Switch to below if there is a space between -r and ranges#range=$1 $2#infile=$3#outfile=$4if test x$ESPS_TEMP_PATH = xthen av_temp=/usr/tmpelse av_temp=$ESPS_TEMP_PATHfictmp=$av_temp/specav$$.coefftmp=$av_temp/specav$$.filtstmp=$av_temp/specav$$.sdptmp=$av_temp/Pxspecav$$ttmp=$av_temp/ttemp$$exprompt -P$ESPS_BASE/lib/params/Pxspecav $ptmpn=`getparam -P $ptmp -p block_size` filter_type=`getparam -P $ptmp -p filter_type` sf=`hditem -i sf $infile`delay=`echo "scale=1;n=$n; n/2" | bc`case $filter_type in WT_RECT) num_file=`echo "scale=18; n=$n; n; for(i=0; i<n; i++) 1.0/n" | bc` echo $num_file >> $ctmp atofilt -c comment $ctmp $ftmp ;; WT_HAMMING) num_file=`echo "scale=18; a=0; n=$n; m=n-1; n; for(i=0; i<n; i++) \ a=a+0.54-0.46*c(2*3.14159*i/m); for(i=0; i<n; i++) \ (0.54-0.46*c(2*3.14159*i/m))/a" | bc -l` echo $num_file >> $ctmp atofilt -c comment $ctmp $ftmp ;; WT_HANNING) num_file=`echo "scale=18; a=0; n=$n; m=n-1; n; for(i=0; i<n; i++) \ a=a+0.5-0.5*c(2*3.14159*i/m); for(i=0; i<n; i++) \ (0.5-0.5*c(2*3.14159*i/m))/a" | bc -l` echo $num_file >> $ctmp atofilt -c comment $ctmp $ftmp ;;esaccase "`fea_element -f re_spec_val -n $infile | awk '{print $2}'`"inBYTE)tofeasd $range -fre_spec_val $infile - \ | feafunc -f samples -f- -tFLOAT -g 0.2302585092994045 - - \ | feafunc -f samples -f- -Fexp - - \ | addgen -g delay_samples -v $delay -t DOUBLE - -\ | filter2 -F $ftmp -z - - \ | feafunc -fsamples -f- -Flog10 -g 10.0 -d -64 - $stmp;;FLOAT)tofeasd $range -fre_spec_val $infile - \ | feafunc -f samples -f- -tFLOAT -g 0.2302585092994045 - - \ | feafunc -f samples -f- -Fexp - - \ | addgen -g delay_samples -v $delay -t DOUBLE - -\ | filter2 -F $ftmp -z - - \ | feafunc -fsamples -f- -Flog10 -g 10.0 - $stmp;;*)echo "FEA_SPEC file is of a non-supported data type."echo "Please convert to BYTE or FLOAT and try again"exit 1;;esactofspec -S -f samples -s $sf $stmp $outfilerm $ftmp $stmp $ptmp $ctmp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -