⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_waves

📁 speech signal process tools
💻
📖 第 1 页 / 共 2 页
字号:
#!/bin/csh -f# 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) 1993  Entropic Research Laboratory, Inc. #                   All rights reserved"## The copyright notice above does not evidence any actual or intended # publication of this source code.     ## @(#)test_waves	1.10 10/4/93 ERL# # Written by:   David Talkin# # Brief description: The beginnings of a test suite for waves+#alias sx send_xwavesalias pau 'echo Hit "CONTINUE" in the xwaves Control Panel to proceed. ; echo " " ; sx pause'cd /tmp# This creates a little script that echoes its command-line arguments by# printing them out one per line.  This allows multi-word arguments to# be clearly separated.echo \#\!/bin/sh > /tmp/myecho$$echo 'while test "$1" != ""' >> /tmp/myecho$$echo do >> /tmp/myecho$$echo 'echo $1' >> /tmp/myecho$$echo shift >> /tmp/myecho$$echo done >> /tmp/myecho$$chmod +x /tmp/myecho$$echo If xwaves is running, it should quit.echo If it\'s not, you should see an error message.echo " "# Tell xwaves, if it exists, to exit.sx -D 0 quit# Now start xwaves with a known profile (the default master version).xwaves -w $ESPS_BASE/lib/waves/.wave_pro &# Use one of the speech files in the timitdemo.  The analysis# parameters, etc. are somewhat different for the male and female voices.# Enable the definition of "bn" that you prefer and make the# corresponding male/female adjustments later in the script.# Female voice#set bn = si648# Male voiceset bn = sa2# Remove any old files that may be around to avoid possible confusion.rm -f $bn.* >& /dev/null# Female voice#ln -s $ESPS_BASE/newdemos/timitdemo/files/cjf/$bn.wav .# Male voiceln -s $ESPS_BASE/newdemos/timitdemo/files/rws/$bn.wav .sx set colormap $ESPS_BASE/lib/waves/colormaps/TImapclearecho " "echo " "echo " "echo " "echo " "echo " "echo " "echo " "echo " "echo " "echo " "echo "===================================================="echo This script is designed to demonstrate some ways in which xwavesecho may be used.  It also serves as a quick test of xwaves and relatedecho programs.  As this script is operating, it will print variousecho informational messages to the terminal, so you should try to keep theecho terminal window visible.echo ""echo Sometimes this script will suggest that you hit mouse buttons orecho keyboard keys.  In these cases, you should have the pointer inecho one of the data view windows.echo "===================================================="echo " "echo The program \"formant\" is now computing formant estimates.echo Please wait.# Use a lower LPC order and search for fewer formants in the female# voice, since the vocal tract is smaller.# Female voice#formant -f8000 -n3 -o10 $bn.wav# Male voiceformant -f8000 $bn.wav# Assign names for the downsampled and highpassed speech file, the# spectrogam file, the F0 file and the formant estimates.set fi = $bn.hpset sg = /tmp/$fi.fspecset fb = $bn.fbset f0 = $bn.f0set oname = dtsx make name $oname file $fi loc_x 0 loc_y 160 width 1000 height 150echo Creating a spectrogram.sx $oname spectrogram loc_y 350 output $sg start 0 end 2sx $oname align file $sgecho " "echo You should see a time aligned spectrogram and waveform.echo The spectrogram scale should remain fixed after window resize.pau# Note that the auto-rescale is set here on a view-specific basis.sx $oname set file $sg h_rescale 1 v_rescale 1echo The spectrogram should now auto-rescale.pau# The colormap setting must be global to all views.sx set colormap greymapecho The colormap should now be greyscale.pau# The colormap range and threshold settings are also settable only globally.sx $oname colormap range 40 threshold 50echo The spectrogram display range and threshold should now be 40 and 50.pau# Overlay the formant file on the spectrogram.  Enable display of only# the first three formants.  Allow formant modification by drawing with# the left button pressed.sx $oname overlay file $fb on_file $sgsx $oname activate file $fb numbers 0 1 2sx $oname set file $sg left_op mark formantsecho You should now see formant trajectory estimates overlaid on theecho spectrogram.  You may draw on the spectrogram with the left mouseecho button depressed to modify the trajectories.pau# This shows how to map a key to an xwaves operator.  This operator# (play between marks) just happens to be a built-in menu item.# Operators defined with add_op may also be bound to keys.sx key_map key _ op play between marksecho The space-bar should now be bound to \"play between marks\".pau# Set up the F0 display scaling appropriately for the male or female voice.# Display only the F0 and rms.# Female voice#sx make name $oname file $f0 loc_y 560 height 320 f0_min 75 f0_range 250 f0_size .8 numbers 0 2# Male voicesx make name $oname file $f0 loc_y 560 height 320 f0_min 50 f0_range 150 f0_size .8 numbers 0 2sx $oname align file $sgecho You should now see a plot of the speech fundamental \(pitch\).echo It, and the speech waveforms should be time aligned with theecho spectrogram.  Only the first and third elements of the .f0 file should beecho visible.pau# This is how an overlay may be removed without destroying the host view.# This also shows how to retrieve the names of all overlays on a given# view.  Note that the success of this example depends on the fact that# only one overlay is present.  If more than one existed, it would be# necessary to issue a "kill" command for each.sx kill name $oname file `sx $oname get file $sg aname overlays`echo The overlay on the spectrogram should have disappeared.pausx kill name $oname file $f0echo The f0 display should have disappeared.pau# With Version 5.0, waveforms may be overlaid on other waveforms using# the same syntax as for overlays on spectrograms.sx $oname overlay file $bn.wav on_file $fiecho You should now see the original 16kHz file speech file overlaidecho on the 8kHz file.  You may want to zoom in to look at details.pau# This makes the middle button toggle the reticle in the channel under# the cursor on/off.# Note that the command created with the add_op changes the state of the# reticle AND redefines the meaning of the middle mouse button, thus# implementing a toggle function.sx add_op name ron command \#_name set file _file chann _cursor_channel reticle_on 1 middle_op roffsx add_op name roff command \#_name set file _file chann _cursor_channel reticle_on 0 middle_op ron# Note that the values for the button operators may be optionally# quoted.  Here both forms are used.  The quoted form need only be used# if the definition is not the last item on the line.sx set all t middle_op \"roff\"sx set all t spec_middle_op roffecho There should now be a multi-trace signal present \(formant andecho bandwidth estimates\).echo The middle button should now toggle the reticle on and off in all views.sx make file $fb loc_y 560 height 300pau# Note that the "all t" keyword-value pair causes all views to adopt# the new attribute settings.sx set all t reticle_grid 0echo The reticles should now be OFF in all views.pausx set all t reticle_grid 1echo The reticles should now be ON in all views.pau

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -