sfconvert.test
来自「speech signal process tools」· TEST 代码 · 共 127 行
TEST
127 行
#! /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. ## @(#)sfconvert.test 1.2 24 Mar 1997 ERL# # Written by: Derek Lin# Checked by:# Revised by:# # Brief description:# ESPS_VERBOSE=0;export ESPS_VERBOSEecho "TYPE WAVES -S BEFORE STARTING THIS SCRIPT !!!!!!"echo "A sweeping sinewave of rate 2000 Hz for 2 secs and 8000 hz sampling"echo "frquency is generated. Its waveform and spectrogram is displayed."echo "The signal is named swp2."echo " "echo "testsd -f0 -C2000 -s2 -r8000 -l10000 swp2"testsd -f0 -C2000 -s2 -r8000 -l10000 swp2#display testdata and its spectrogramsend_xwaves set objectname swp2 send_xwaves make file swp2 sgram -s0:2 -dHANNING -o8 -E0.94 -S2 -w8 swp2 swp2.fspec send_xwaves make file swp2.fspec echo " "echo hit any key to continuelineecho "Now the signal will be upsampled to 12000 sampling frequency,"echo "Its spectrogram is displayed"echo "sfconvert -s12000 swp2 -|sgram -s0:2 -dHANNING -o8 -E0.94 -S2 -w8 - swp2.u.fspec"sfconvert -s12000 swp2 -|sgram -s0:2 -dHANNING -o8 -E0.94 -S2 -w8 - swp2.u.fspec send_xwaves make file swp2.u.fspec echo " "echo "hit any key to continue"read xecho "Now the signal is downsampled to 6000 Hz sampling rate"echo "Note the original signal component with higher than 3000 Hz is"echo "filtered out, since 3000 Hz is the Nyquist of output sampling rate."echo "sfconvert -s6000 swp2 -|sgram -s0:2 -dHANNING -o8 -E0.94 -S2 -w8 - swp2.d.fspec"sfconvert -s6000 swp2 -|sgram -s0:2 -dHANNING -o8 -E0.94 -S2 -w8 - swp2.d.fspec send_xwaves make file swp2.d.fspec echo " "echo "hit any key to continue"read xecho "In the last operation, the rejection ratio for aliasing is by default 60dBs"echo "Sfconvert allows you to change this number."echo "Let's change this ratio to 30dBs, aliasing will be very severe."echo "You will see this in its spectrogram"echo "sfconvert -s6000 -R30 swp2 swp230"echo "sgram -s0:2 -dHANNING -o8 -E0.94 -S2 -w8 swp230 swp2.f.fspec"sfconvert -s6000 -R30 swp2 swp230sgram -s0:2 -dHANNING -o8 -E0.94 -S2 -w8 swp230 swp2.f.fspec send_xwaves make file swp2.f.fspec secho " "echo hit any key to continueread xecho "Note in the last operations, the downsampled data doesn't have an exact"echo "cutoff on the Nyquist rate because there is always a finite transition"echo "region for a lowpass filter to go from its pass to stop band"echo "In many cases aliasing effect introduced at around the Nyquist frequency"echo "is not desirable, sfconvert allows you to have the option of changing"echo "the corner frequency of the lowpass filter"sfconvert -s6000 -c2000 swp2 swp22sgram -s0:2 -dHANNING -o8 -E0.94 -S2 -w8 swp22 swp2.i.fspec send_xwaves make file swp2.i.fspec echo " "echo hit any key to continueread xecho "Now let's generate some complex multichannel data for testing."echo "The signal consists of 2 channels, each channel is a complex channel".echo " Below is what constitutes real and imaginary part of each channel:"echo "Channel one: [sweeping sinewave of 1000 Hz, sweeping sine of 2000 hz]"echo "Channel two: [sweeping sinewaves of 2000 Hz, sweeping sine of 4000 hz]"echo "The signal generated by testsd by default is FLOAT"echo "testsd -f0 -C1000 -s2 -r8000 -l10000 swp1"echo "testsd -f0 -C4000 -s2 -r8000 -l10000 swp4"echo "mux -J swp1 swp2 swp2 swp4 swp12_14"testsd -f0 -C1000 -s2 -r8000 -l10000 swp1 testsd -f0 -C4000 -s2 -r8000 -l10000 swp4 mux -J swp1 swp2 swp2 swp4 swp12_14 send_xwaves make file swp12_14 echo " "echo hit any key to continueread xecho "Let's extract channel 0 and downsampled it to 4000 Hz."echo "And use -d flag to signal sfconvert that all computation should"echo "be carried out in double precision."echo "sfconvert -d -s4000 -e0 swp12_14 swp12cplx"sfconvert -d -s4000 -e0 swp12_14 swp12cplx send_xwaves make file swp12cplx echo " "echo hit any key to continueread xecho "Now it is your turn to play with sfconvert, Use the param file"echo "for setting options."echo "DO THIS: sfconvert -Pparam swp2 swp2_mine"rm swp*echo "THE END OF SFCONVERT DEMO"
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?