📄 test_waves
字号:
#!/bin/csh# 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.7 6/23/93 ERL# # Written by: David Talkin# # Brief description: The beginnings of a test suite for waves+#alias sx send_xwavesalias pau 'echo Hit "CONTINUE" to proceed. ; echo ; sx pause'echo \#\!/bin/sh > myechoecho 'while test "$1" != ""' >> myechoecho do >> myechoecho 'echo $1' >> myechoecho shift >> myechoecho done >> myechochmod +x myechoset fi = dt.hpset sg = /tmp/dt.hp.fspecset f0 = dt.f0set fb = dt.fbset ana = dt.anaecho If xwaves is running, it should quit.echo If it\'s not, you should see an error message.sx -D 0 quitecho Waiting for xwaves to load...xwaves -w ./.wave_pro_test &sx make name dt file $fi loc_x 0 loc_y 160 width 1000 height 150echo Creating a spectrogram.sx dt spectrogram loc_y 350 output $sg start 1 end 2sx dt align file $sgecho You should see a time aligned spectrogram and waveform.echo The spectrogram scale should remain fixed after window resize.pausx dt set file $sg h_rescale 1 v_rescale 1echo The spectrogram should now auto-rescale.pausx set colormap greymapecho The colormap should now be greyscale.pausx dt colormap range 40 threshold 50echo The spectrogram display range and threshold should now be 40 and 50.pausx key_map key _ op play between marksecho The space-bar should now be bound to \"play between marks\".pau# This makes the middle button toggle the reticle in the channel under# the cursor on/off.# To enable the toggle, select roff for middle-button operation from# the button modes menu.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 ronsx set all t middle_op \"roff\"sx set all t spec_middle_op roffecho The middle button should now toggle the reticle on and off in all views.sx make file $fb loc_y 700 height 300pausx 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.pausx dt set file $fb left_op "zoom in"sx dt set file $fb middle_op zoom outecho The multi-trace view should now have ZOOM IN and ZOOM OUT bound to theecho left and middle buttons.pausx dt activate file $fb num 0 1 2 3sx dt set file $fb background 121sx dt set file $fb channels \"0 1\" line_type 2sx dt set file $fb channel 2 line_type 3 plot_min 0sx dt set file $fb channel 3 line_type 4 plot_min 0sx dt bracket file $fb start 1 end 2echo The multi trace view should now show channels 0,1,2,3 on a colorecho background. Channels 0 and 1 should be displayed with line tupeecho 2\; channel 2 with line type 3\; and channel 3 with line_type 4.echo The minimum data value plotted on channels 2 and 3 should be zero.pausx set all t middle_op foo barsx set all t spec_middle_op buff carecho This should be preceded by three error messages.echo \(The middle op in all views should now be NO OP.\)pausx add_op menu wave name \"show variables\" op myecho _variables \; echosx add_op menu spect name \"show settables\" op myecho _settables \; echosx add_op menu none name \"show operators\" op myecho _operators \; echosx add_op menu none name \"show w_ops\" op myecho _waves_commands \; echosx add_op menu all name \"show object commands\" op myecho _object_commands \; echosx key_map key o op show object commandssx key_map key w op \"show w_ops\"sx dt set file $fb middle_op \"show variables\"sx dt set file $fi middle_op \"show operators\"sx dt set file $sg left_op \"show w_ops\"sx dt set file $sg middle_op show settablesecho Hit \"o\" key to see commands for display objects.echo Hit the left mouse button in the spectrogram to see waves commands.echo Hit the middle button in the single-trace view to see view operators.echo Hit the middle button in the multi-trace view to see variable names.echo Hit the middle button in the spectrogram to see view settables.pausx add_op name testit menu DT op send_xwaves save_add_ops output /tmp/ops \; cat /tmp/opssx key_map key _ op testitecho Hit the space bar to see all current add_op commands.pausx add_op name log menu wave op echo _cursor_valuessx key_map key _ menu wave op logecho Hit space bar in waveform views to log data values.pauecho ' '`send_xwaves dt get aname variables` | sed 's/ / _/g' > /tmp/varssx add_op name WORLD op myecho `cat /tmp/vars`echo Select WORLD from the view menus to see all variable values.pausx set xspectrum_datwin_x \"500\" xspectrum_datwin_y \"400\" xspectrum_datwin_width \"500\" xspectrum_datwin_height \"400\" xspectrum_window_limits \"0\" xspectrum_window_size .1sx attach function xspectrumecho Waiting for xspectrum to attach.set foundit = 255while ( $foundit != 0 ) sx save_menus menu wave output /tmp/tmp$$ grep xspectrum /tmp/tmp$$ set foundit = $statusendecho Xspectrum should now be operating. Space bar should cause newecho spectrum computation when cursor is in single-trace view.sx send function xspectrum op dt mark file $fi time 1.5sx key_map key _ op xspectrumpausx delete_all_items menu waveecho 'The waveform menu should now be empty (i.e. It should no longer appear'echo 'when the right button is pressed). The spectrogram menu should be'echo 'unchanged.'pausx @/tmp/tmp$$echo The waveform menu should now be restored to its previous state.pausx save_menus menu spect output /tmp/tmp$$sx delete_all_items menu spectecho The spectrogram menu should now be empty.pausx @/tmp/tmp$$echo The spectrogram menu should now be restored.paurm -f /tmp/tmp$$sx send set xspectrum_cep_liftering 1 xspectrum_cep_cutoff .005 xspectrum_analysis_type 10echo Xspectrum should now be operating in the cepstral smoothing mode.paurm -f dt.labsx set xlabel_ctlwin_y 800sx dt bracket start .5 end 2.5 file dt.hpsx attach function xlabelsx send function xlabel op xlabel make name dt file dt.lab signal dt.hpsx send function xlabel op dt mark time 1.5 label Hello Worldecho Xlabel should now be attached. Its control panel should be nearecho the bottom of the screen. Hello World should appear in the labelecho window.pausx detach function xlabelecho Xlabel should have gone away. Xspectrum should still be there.pausx detachecho All attachments should now be absent.pausx kill name dt file $sgecho The spectrogram should have disappeared.pauecho 'send_xwaves $1 bracket file $2 start $3 end $4' > zoom$$echo 'send_xwaves $1 set file $2 channels $5 plot_min $6 plot_max $7' >> zoom$$chmod +x zoom$$echo 'send_xwaves $1 op file $2 op zoom full out' > zout$$echo 'send_xwaves $1 set file $2 v_rescale 1' >> zout$$chmod +x zout$$sx add_op name MAGNIFY menu wave op zoom$$ _name _file _l_marker_time _r_marker_time _t_marker_chan _b_marker_yval _t_marker_yvalsx add_op name zout menu none op zout$$ _name _fileforeach f (`sx dt get aname files`) sx dt set file $f left_op \"up/down move\" middle_op zoutendecho There should now be a menu item called MAGNIFY on the waveform menus.echo Using the left mouse button, position the abscissa markers and \(withecho the shift key depressed\) the ordinate markers to bracket a region toecho magnify. Then select MAGNIFY. Press the middle button to zoom fullecho out.pauforeach f (`sx dt get aname files`) sx dt op file $f op zoutendecho All waveforms should now be zoomed full out.pausx set output_dir /tmp append_extensions 0sx add_op name SAVE menu none op send_xwaves _name save file _file start _l_marker_time end _r_marker_time outputname _out.g.testsx key_map key _ op SAVEsx set all t middle_op play between marksecho The middle button should now be bound to \"play between marks\" andecho the space bar should save the currently-marked segment in a file andecho then display the segment.pausx killecho All data views should now be absentpausx set xspectrum_window_limits 1sx attach function xspectrumsx make name dt file $fi loc_x 10 loc_y 200 width 1100 height 200sx add_op name \"mark\" menu all op \# _name mark time _cursor_timesx add_op name \"clear\" menu all op \#_name unmark all tsx add_op name \"foo\" menu all op \# _name play start _l_mark_time end _r_mark_timesx set samp_range_prefix -rsx add_op name \"eplay\" menu all op sgplay _mark_range_samp _filesx add_op name \"s\" menu all op \#send function xspectrum op _name mark signal _file rstart _l_mark_time rend _r_mark_timesx add_op name \"xspectrum\" menu all op \#send function xspectrum prognum 90245 versnum 15 command _name mark signal _file time _cursor_time rstart _l_marker_time rend _r_marker_timesx key_map key s op ssx key_map key x op eplaysx key_map key z op foosx key_map key c op clearsx key_map key _ op marksx set blowup_op marksx dt set file $fi middle_op 'blow up; function'echo The space bar should now apply marks wherever the cursor at the timeecho the bar is hit. The z and x keys should both play the regionecho delimited by the two marks closest to the cursor when the key is hit.echo Xspectrum should be attached. Hitting the s key should cause theecho region delimited by the nearest marks to have its spectrum computedecho and displayed. Hitting the c key should erase all marks.echoecho The middle mouse button should be bound to \"blow up; function\" and,echo when pressed, should expand the waveform. When the middle button isecho released, a mark should be applied.pausx quitecho Xwaves should have exited. The test is complete.rm -f zoom$$ zout$$ myecho
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -