Return to: [Software] [Speech]

EDW -- EDit Waveform program

This document describes the program EDW for Unix and MSDOS systems. There is a separate page of documentation for WEDW which you may want to look at if you are interested in the Windows version of this program.

Table of Contents

1. Description

EDW is a waveform display and graphic editing program. It can be used to edit speech files in much the same way that a text editor is used on text files. That is, portions of arbitrarily large waveform files may be displayed on the CRT screen, regions of the displayed waveform can be cut, pasted, saved to a separate waveform file, and other waveform files can be inserted into the file being edited. The waveform data can be displayed in several formats. A spectrogram based on the waveform can be displayed along with the waveform itself. Pitch information (specifying pitch period locations and voiceless regions) can be inserted manually, read from a data file, edited, and written to a data file. Up to eight ancillary waveforms can be displayed for reference along with the waveform being edited. Finally, given appropriate hardware, the displayed waveform can be played through a D/A converted. EDW has no built-in capability to digitize speech and relies on other programs to create the waveform files which it is used to edit. EDW can be used with waveform files in either RIFF format (equivalent to Microsoft .wav format) or a locally designed .wav format. A program called TOWAV is available that can convert many standard digital waveform storage formats to the local .wav format, and much software already exists to acquire or convert to RIFF format. Some aspects of the program vary depending on the kind of computer and extra hardware (e.g., DSP boards and D/A converters) that is available. Hardware specific issues are discussed in Appendix II. This document describes EDW primarily as it functions for IBM PC compatible computers.

Figure 1 illustrates the basic waveform display window. Information lines at the top of the display indicate the name (and path if it was specified) of the waveform file being viewed and the starting (left edge) and ending (right edge) times for the current display window. Two additional fields show the time and waveform amplitude associated with the current cursor position when a cursor is active. A prompt ("EDW>") is displayed in the region just below the display window at times when EDW is waiting for command input from the keyboard.

2. Installing and Starting EDW

The program file (EDW.EXE) should be placed in a directory for executable programs that is searched by DOS via the PATH statement. For example, many people use a directory called BIN or UTILITY for miscellaneous executable programs and use a PATH command in their autoexec.bat file to tell DOS to search that directory for programs. Any directory specified in the PATH will work for EDW.EXE. A second file (usually called EDWINI.EDW) may be used for program initialization. It should be located in the current working directory or its location should be specified by the EDWINI environment variable. The environment variable is preferred since that allows a single copy of the EDWINI file to be found regardless of the directory from which EDW is started. To set the environment variable, place the following command in your autoexec.bat file:
	SET EDWINI=d:\path\file

(where d:\path\file is the drive letter, path, and filename of your EDWINI file). For example, the following command would instruct EDW to look for a file called EDWINI.EDW on drive C in a directory called WAVE:

Note that by default EDW looks in the current directory for a file with the name EDWINI.EDW. However, if the EDWINI environment variable is set, the full path and file name must be given, and the file need not be called EDWINI.EDW. The EDWINI file may contain any EDW commands (except BIND and MARK) and option settings the user wishes to have take effect automatically when EDW is started (details of the EDW commands are given below). Generally, this file will specify the graphic adaptor type, set display format to that preferred by the user, and contain DEFK statements to define one-stroke key commands that can make editing faster. The EDWINI file is optional, but can be extremely useful for setting up shorthand commands to be used in segment marking. See the examples below in section 8.0.

Once installed, the program is started by entering the command EDW optionally followed by the name of a waveform file to view. The screen will be painted with the display outline and the prompt ("EDW>") will appear below the display region to indicate that EDW is ready to receive commands from the keyboard.

3. Entering Commands

Commands can be entered from the keyboard to the "EDW>" prompt (and others which EDW prints for specific information) with rudimentary editing. The backspace key will delete characters one at a time starting with the last character typed. Control U (^U) will erase all characters currently on the line and allow the user to start over entering a command. Once a command has been typed, the Enter key is pressed to send it to EDW.

Multiple commands can be entered as a single command line by concatenating individual commands with the '&' character. This is particularly useful when each of the commands in a sequence will cause the display to be updated. For instance, the commands "WIN 60", "STEP 40", "SCA 8", and "SET DIS BAR" would each require EDW to redraw the display before accepting the next command. If the same sequence were entered as "WIN 60&STEP 40&SCA 8&SET DIS BAR", EDW would execute all four commands 'internally' before updating the display. Because the '&' entails not updating the screen, commands that require an updated screen (HPR, for example) and interactive command (MARK, for example) should not be included in a concatenated command string.

Any command, simple or multiple, that is used very frequently may be executed via a single keystroke if the command is bound to a single key using the BIND command or the DEFK command within the EDWINI file.

4. Commands for Viewing a Waveform File and Moving the Display Window

In general, EDW commands consist of a keyword (e.g., a verb) followed by one or more modifiers followed by one or more parameters. The keyword and modifiers can generally be abbreviated to their first few characters. In the descriptions of the commands given below, the necessary characters are given in upper case. Information which must be supplied along with the command is presented between angle brackets. For example, "<file name>" means that an actual file name should be substituted for the bracketed expression. Optional information is presented in square brackets, for example, "TIMe [+-]<msec>" implies that a + or - could be placed in front of a value in msec, but neither is required.

4.1. VIEw <file_description>

If a waveform file is currently being viewed, it will be closed and, in any event, the waveform file specified by <file_description> will be opened for display. The file description can include a full pathname, filename, extension, segmentname, and channel number in the format recognized by libcwav routines (e.g., /path/file.wav$seg#0). If the file is not in the current directory, it must contain a complete path description for the location of the file. When terminated with the special "$<segment>" flag, only the segment named <segment> is to be viewed in EDW. When a file plus segment is given in this way, EDW will treat the segment as though it was an entire file; it will not be possible to move into parts of the waveform file that are outside the segment. This approach is not recommended if the CUT, PASTE, or INSERT options for waveform editing are to be used. If no channel number is given for a multichannel file, EDW will display channel 0.

When the initial display is drawn, the beginning of the file (TIME 0.0) will be aligned to the left edge of the display. The right end of the display will be determined by the window size in effect at the time, or by the actual length of the file to be viewed, whichever is shorter.

When switching from a file that was altered using CUT, PASTE, or INCLUDE or in which segment definitions have been altered, EDW will pause to ask if you want to make those changes to the present file before viewing the new file. If you answer by pressing 'N' for 'no' then all changes to the file will be discarded.

4.2. VPR <file_description>

This is a special form of the view command that applies to Unix systems only, to allow EDW to view a file with read permissions only. A file opened with VPR is protected from any attempts to write to the file.

4.3. VIEw $<segment_name>

This form of the view command will align the beginning of <segment_name> (a segment defined within the current waveform) to the left edge of the display window. The window length will be changed to correspond to the actual length of the segment being viewed. Note that this differs from the VIE file_description$segment_name form in that access is not restricted to the segment; you are simply "windowing" a particular segment in the file.


These commands are used for sequentially STEPPING forward or backward in time to reach new or previously displayed regions. For NEXT, EDW advances a preset number of msec forward in the time course of the signal being viewed and redraws the display starting at the new point in time. Conversely, the LAST command causes EDW to step backward in time (toward the start of the waveform) before redrawing the display. The NEXT command is "bound" to an empty command so that pressing the ENTER key without entering any command is equivalent to the command NEXT. Setting the step size for NEXT and LAST is done with the STEP command described below.

4.5. TIME [+-]<msec>

As an alternative to sequentially stepping through the waveform, EDW allows the user to enter the time (in msec) for the left edge of the display window. In the absence of a + or - sign, the time given is taken as an absolute offset from the beginning of the waveform file (time 0). If a + or - sign precedes the msec time, it is taken as a relative offset from the current left edge of the display.

4.6. Cursor Alignment.

Finally, both the display time and window length can be adjusted via the marking cursor (See Marking below). Pressing the R key when the marking cursor is displayed will cause EDW to shift the display so that the sample at the cursor is aligned to the Right edge of the display. Similarly, the L key will align the sample at the cursor to the left edge of the display and shift the waveform within the display.

For the regular R and L functions, the display window length normally does not change; the whole waveform shifts with respect to the display window. If the control key is held down while pressing either the R or L, however, a portion of the currently displayed waveform is "stretched" or blown up to take up the entire display window. The ^R function aligns the sample at the cursor to the right edge of the display, stretching the remaining waveform to fill the display. This is equivalent to changing the window length to the number of msec between the left edge of the display and the cursor location while the display time (at the left edge) remains unchanged. The ^L function fills the display window with the portion of waveform displayed to the right of the cursor. It is equivalent to both redefining the display window length and changing the display time.

4.7. Active Region

In addition to standard segment markers, EDW maintains two temporary markers which delimit what is called the "active region," a region which becomes the default operand for many of the commands below. The active region markers can be inserted and moved with mouse buttons and/or with the keys [ and ]. For mouse control, the left region marker is inserted at the location of a LeftPress (i.e., pressing and holding the left mouse button) and the right marker is positioned by a subsequent LeftRelease. Using the keyboard, the left marker is placed by pressing '[' and the right marker is placed by pressing ']' with the cursor appropriately positioned. Several commands (notably SEG, CUT, & COPY) now refer by default to the active region. Thus, a segment can be defined by using the mouse to select an active region and then using the SEG command to name the region.

4.8. ZOOm

When an active region has been defined, the ZOOM command will fill the display window with the region. That is, the left active region marker will be aligned to the left edge of the window and the window duration will be set to correspond to the active region duration.

4.9. UNZoom

Restores the previous view (window start time and length) following a ZOOM command.

4.10. Supplemental waveform displays.

Only one waveform at a time may be displayed for editing, marking, playback, etc. However, up to 8 additional waveforms may be plotted within the display window for reference purposes. These supplemental waveforms are time-aligned with respect to the primary waveform and the entire vertical display axis is rescaled to allow multiple simultaneous curves. Figure 2 shows a display in which two supplemental curves have been plotted along with the primary curve. Note that the file name for each supplemental curve is printed at the upper left corner of the display area allocated to that curve. EDW will correctly maintain the temporal alignment between the supplemental and primary waveforms over changes in the display window duration and position. Again, however, no operations can be performed on these supplemental waveforms; they are for display and reference purposes only.

Two commands are provided for the display and removal of supplemental waveforms.

4.10.1. DISplay <filename> [%<proportion>] [^<align_time>].

The specified file, which must be a .WAV file, is added to the display. Each new display waveform is added to the bottom of the display window, pushing up any previously displayed waveforms. By default, 10% of the total display area (in the Y dimension) is allocated for each supplemental waveform. The allocation for the primary waveform is simply the residual display area after accounting for all supplemental files. For instance, if two supplemental waveforms are displayed with each given 10% of the Y axis, the primary waveform would be allocated the remaining 80% of the Y axis.

Two optional parameters may also be specified. One indicates the proportion of the Y axis to allocate for this display. For example, "%25" would indicate that 25% of the display be allocated. The second parameter, prefixed with a carat specifies a time offset for the display of the supplemental waveform. This is a time in msec for the start of the supplemental waveform relative to the onset of the primary waveform. For example, if the starting time of a supplemental waveform is known to be 100 msec behind the start of the primary waveform, the parameter "^100" could be used to compensate for the onset disparity. Negative values are also possible (^-100) when the supplemental waveform started before the primary waveform. Here is an example command that would cause the display of a waveform using 25% of the y axis and starting 75 msec after the start of the primary display:

		DIS file.wav %25 ^75

The file name must be the first parameter following the command, however, the order of the % and ^ qualifiers is not important. The ^ may be used without a % argument, and the % argument may follow the ^ argument if desired.

4.10.2. REMove <display_number>.

Removes supplemental waveform display_number from the display. The screen is repainted and the freed portion of the axis is reallocated to the primary waveform. The display numbers apply only to the supplemental display waveforms. The numbers are assigned from 1 up to 8 corresponding to supplemental waveforms from the top toward the bottom of the display. This command is somewhat complicated because the display numbers can change for waveforms after one has been deleted. For example, if three supplemental are displayed, the command "REM 2" would remove the middle waveform. Since only two supplemental waveforms would remain, the command "REM 2" issued again would then remove the bottom supplemental waveform.

5. Setting Display and Operational Characteristics.

5.1. WINdow <msec>

This sets the display window duration (in msec) to the specified duration. The maximum length of the display window is limited by the amount of memory available for the display (which varies with different systems) and, since size is measured in msec, by the sampling rate of the signal to be displayed. For example, on an AT with limited memory and at a 10 kHz sampling rate, the max display length may be about 7.5 seconds. For 20 kHz, about 3.725 seconds, etc. Note that these limits do not apply to the waveform file itself. EDW will edit files of any length up to the DOS limit, but there is a limit to the length of signal which can be displayed at one time on the screen.

5.2. STEp <msec>

Sets the step size for NEXT and LAST commands to msec. This is the amount of time by which the display window will shift when a NEXT or LAST command or one of their equivalents is given (e.g. simply hitting the enter key will cause a NEXT command to be executed. Note that several frequently used step sizes, perhaps along with associated window lengths, can be preassigned to a single keystroke via the DEFK command in the EDWINI file.

5.3. SCAle <n>

Sets the scale magnifier for the waveform display to factor 'n', a value between 1 and 8. At SCAle 1, a full scale waveform will just fill the vertical display area. At SCAle 8, the smallest real digital difference will be resolved in the display, i.e., all real differences in sample values will be visible. Intermediate values give intermediate scaling.

5.4. SET <parameter/option> <value>

Many features are controlled via SET commands. Generally, the parameter or option specifies which feature of EDW is being set and the value following the parameter or option name is the quantity set for that feature.

5.4.1. SET DISplay <type>

Set the way waveforms are displayed. The three display types are:

5.4.2. SET EGA

Set the graphics display coordinates and hardware for EGA operation. The display will be sized to 640x350 pixels and spectrograms will be plotted in a pseudo-grayscale using shades of blue and black. This is the default graphics mode for PC versions of EDW; the mode that EDW will use unless a SET VGA command (see below) is given.

5.4.3. SET HGA

Set the graphics display coordinates for HGA (Hercules Graphics) operation. The display will be sized to 720x348 pixels and spectrograms will be clipped to just two levels (pixels on or off). Note that a special version of EDW must be used to actually work with a Hercules display adaptor, the standard version is compatible with EGA/VGA graphics only.

5.4.4. SET LEVEL <n>

Set the waveform reference level (in dB) for use by programmable attenuator. This feature is currently unused.

5.4.5. SET PALette <number>, <color>

Sets Palette registers on the EGA or VGA display. The 16 palette registers can each be assigned a different color from the set of possible colors. By default, the 16 EGA colors chosen approximate a gray scale with intermediate shades in blue. Palette number 1 is used as the background color of the display (default color value = 63), and palette number 16 is used by EDW as the text and waveform display color and as the darkest shade in the spectrogram. The VGA palette used by EDW gives a true gray scale with 1 being white and 16 being black. However, this palette can also be changed as desired.

5.4.6. SET SPEctrogram ON

Enables the split-screen spectrogram display as illustrated in Figure 3. The waveform display window is split into two windows, the upper displaying a waveform (and any supplemental waveforms) and the lower a spectrogram. Each spectrogram time slice is based on a 256-point FFT of a Hamming windowed, and possibly preemphasized, portion of the primary waveform. Slices are computed to the precision of the graphic display, e.g., 640 frames or slices of the spectrogram would be computed for an EGA display. Slices are time-aligned with the waveform sample located at the center of the Hamming window from which they are computed. Thus, features in the spectrogram should be time-aligned with their corresponding waveform features (allowing for some spread or blurring due to the width of the Hamming window). Because of the alignment with the center of the Hamming window, no spectrogram slices are displayed within 1/2 a window length from either edge of the display window. When the length of the display window is not significantly greater than the length of the Hamming analysis window, the gaps at the edges of the display window become noticeable.

5.4.7. SET SPEctrogram OFF

Disables the split-screen spectrogram display.

5.4.8. SET SPEctrogram DB <range_in_dB>

Sets display range for the spectrogram. The range value is the spectrum level associated with the highest (darkest) gray shade. This range is then divided by the number of gray shades (or colors) to determine the spectrum level cutoff for each shade. Note that with the number of gray shades held constant, small range values will provide darker spectrograms in which lower amplitude spectral features can be seen. The default range used by EDW is 67 dB.

5.4.9. SET SPEctrogram FRequency <min_Hz> <max_Hz>

Sets the range of frequencies that are plotted for the spectrogram. At most, a digital spectrogram can cover the range of frequencies from 0 Hz to half the sampling frequency. By default, EDW displays the spectrogram from 0 to 5 kHz. However, with this command, one can set EDW to show any desired portion of the maximum range expanded to the size of the display area. For instance, for speech sampled at 20 kHz, the maximum range would be 0 - 10 kHz. However, the display can be expanded to cover just the range from 0 - 4 kHz with the command "SET SP FR 0,4000."

5.4.10. SET SPEctrogram GRAy <n_grayshades>

Sets the number of discrete shades of gray or colors into which spectrum amplitude will be coded. By default, EDW uses a 16 level pseudo gray scale formed from several hues of blue as well as black, grays, and white that works well with EGA displays. The individual shades/hues in this scale can be changed with the SET PAL command described below. When EDW is set to VGA mode, special hardware in the VGA adaptor is reprogrammed by EDW to allow a true 16-level gray scale to be used for the spectrogram. In this mode, the SET PAL command can override one or more levels of gray and replace the shade with another color. Unix versions of EDW using X11 graphics for color monitors can allocate up to 256 levels of gray shades, but by default also use just 16. For Unix monochrome monitors, the maximum number of grayshades is 4, based on a 2 by 2 pixel dithering scheme.

5.4.11. SET SPEctrogram SIZe <number_of_pixels>

This command allows the portion of the display that shows spectrogram (as opposed to waveform) to be increased or decreased. It sets the number of pixels (in the vertical direction) devoted to the spectrogram plot when it is enabled. By default, 128 spectral points are plotted (taking 128 pixels on a color display screen or 256 pixels on a monochrome display screen because of dithering). On EGA display hardware, this is roughly half the usable display area, but considerably less than half on a VGA screen. Note that on PCs the display subroutine is highly optimized for displays of exactly 128 pixels. While you may choose any other value, it will lead to significantly longer plotting times on most hardware. Note also that resizing the total EDW display area (with the SET XY command below) does not change the absolute number of spectrogram pixels.

5.4.12. SET SPEctrogram PEmphasis <factor>

Sets the high frequency preemphasis filter coefficient. A value of 1.0 for <factor> yields a +6dB per octave preemphasis. A value of 0.0 provides no preemphasis. Intermediate values provide intermediate degrees of preemphasis. Values should always be in the range 0.0 to 1.0.

5.4.13. SET SPEctrogram WINdow <msec>

Sets the length (in msec) of the Hamming analysis window used for FFTs in computing the spectrogram. Short windows result in a broadband spectrogram, while long windows lead to narrow band spectrograms. In EDW, FFTs are always computed on 256 points of data. When the window length results in less than 256 points of real speech data being used, the remainder of the 256 point sequence for transform is padded with zeroes. This means that very short windows tend to result in lower amplitude (less darkness) in the display. Also, because the transform sequence is fixed, the window length must never result in a need to transform more than 256 points. The formula for deciding how many real data points are needed is:
	n_points = window_in_msec * (sample_rate / 1000.0)

For a 10 kHz sampling rate, the maximum window length is 25.6 msec. EDW uses a default of 8.0 msec for the analysis window. Because of the tapered shape of the window, its effective length (for computing spectrum bandwidth) is roughly half its nominal length. Consequently, an 8.0 msec window is effectively 4 msec and provides an analysis bandwidth of about 250 Hz. This is near the 300 Hz bandwidth of a standard broadband spectrogram.

5.4.14. SET SR <n>

Sets the playback sampling rate to n Hz. This does not change the sampling rate that is stored in the waveform file, but does effect the rate used for listening to the waveform with the PLAY command from within EDW.

5.4.15. SET VGA

Set the graphics display coordinates and hardware for VGA operation. The display will be sized to 640x480 pixels and spectrograms will be plotted in a true grayscale.

5.4.16. SET XY <x_size>, <y_size>

Sets the size of the total EDW display in absolute screen coordinates. This command is mostly for use on X11-based systems where it resizes the window used for EDW, but can also be used on PCs. On a PC, running under DesqView this could be useful, but it is untested.

6. Commands for manipulating segments.

EDW maintains a table of segment names and locations as part of the header of every waveform file. A means is provided to define segments (MARK), rename them, delete the segment definition (DEL), remove the segment from the waveform (CUT), combine segments to form new ones (SEG), write them to separate files (WRI), and copy them to other parts of the waveform file (CUT/COPY with PASTE).

There is one intentional feature (not quite a bug) in several of the commands that remove, or rename segment labels: the label information in the display is not necessarily updated, or updated correctly when a segment label changes. This was introduced to reduce the frequency of screen updates when marking segments. If a spectrogram display is enabled when marking segments, each screen update can take from 8 seconds to a minute depending on the computer and hardware available. This delay time was more disruptive than having to wait to see the correct effect of segment deletion or renaming.

6.1. DEL <segment>|<*>

Deletes the segment definition from the segment name table. This has no effect on the waveform: it simply removes the segment marks. The special name '*' means all segments defined in the current file.

6.2. REN <oldname> <newname>

Changes the name of a segment from oldname to newname.

6.3. SEG <name> [<start>[/e] <end>[/b]]|[beg_msec,end_msec]

Defines a new segment called "name." If no additional information is given, the region markers are used as the begin and end points for the new segment. This allows segments to be defined easily with the mouse. For instance, the command "SEG FOO" will assign the name FOO to the last region assigned by the mouse (or [ and ] keys). If start and end names are also given, the segment begins with the first sample of the segment given as <start> and ends with the last sample of the segment given as <end>. Optionally, the start and end points can be modified to be the ending sample of <start> (using /e) or the beginning sample of <end> (using /b). The third form of the SEG command uses the beginning and ending times (in msec) offset from the start of the waveform as the begin and end mark locations respectively. For this format, the times must be literally enclosed in [ and ], e.g., SEG newseg [250, 500].

6.4. CUT [<segment>]

Cuts (i.e. removes) a portion of the waveform being edited. If the optional <segment> is not given, the last activated region of the waveform is cut. If <segment> is given, the region of the waveform associated with <segment> is removed. The cut portion of the waveform is placed in a PASTE buffer from which it can be pasted into the file at another location. This information will remain in the paste buffer until it is replaced as a result of another CUT or COPY command, or until an EXIT, QUIT, or VIEW command.

6.5. COPY [<segment>]

Copies a portion of the waveform file into the PASTE buffer without cutting the segment. If no segment name is given, the active region is copied. This information will remain in the paste buffer until it is replaced as a result of another CUT or COPY command, or until an EXIT, QUIT, or VIEW command. Note that the PASTE buffer does not contain any real waveform data: it is implemented as a set of location pointers to data in the current waveform file. Thus, the contents of the PASTE buffer are valid only as long as the same waveform is being viewed.

6.6. WRIte <segment> [filename]

Copies the segment to a separate waveform file. If the optional output file name is not provided, the newly created waveform file will have the segment name as its file name and the extension .WAV. The original waveform file is not altered. NEVER write a segment to a file with the same name as the file you are editing! This command may be used at any time during an editing session on a given file; i.e., it is not necessary for all or part of the segment to be displayed when the WRIte command is given. Marks specified for segments that are proper subsets of the segment being WRItten will be retained in the newly created waveform file. Marks delimiting the segment itself, and marks for segments which either begin or end outside the segment are not retained.

6.7. LENgth

Lists the segment definitions for the current file. Segments are displayed in a table which gives the locations of the segment beginning and end marks and the length of the segments in both samples and msec.

6.8. MARK

The mark command places EDW in a special mode which is used for defining segments, editing pitch markers, PASTEing the contents of the paste buffer to a particular location within the waveform file, INSERTing waveform data from other files, and for display repositioning.

After entering MARK mode, the EDW> command prompt is replaced with a short list of options and a cursor (vertical line) is displayed. The cursor can be moved left and right via a mouse of the left and right arrow keys on the numeric keypad (keypad 4 and 6 keys). Two speeds are available for keyboard cursor movement. Normally the cursor moves across the display pixel-by-pixel, however, in numlock mode or with the shift key pressed, the cursor jumps 10 pixels at a time. If a mouse is present, the mouse may also be used to position the cursor. On PCs, a Microsoft compatible mouse driver (this includes the Logitech driver) must be loaded before starting EDW or it will not notice that a mouse is present. Note that the keyboard arrow keys remain active whether or not a mouse is detected and can thus be used in conjunction with the mouse, e.g., to provide fine grained control over the cursor position.

While the cursor is displayed, an indicator at the top of the display shows the position in time of the cursor and the value of the sample at that position in time. Note that cursor positions and samples correspond on a one-to-one basis only when the number of samples in the display window is exactly equal to the number of dots or pixels that can be resolved in the display. For an EGA display, for example, the horizontal resolution is 640 pixels. For speech sampled at 10 kHz that means that a window length of 64.0 msec would map to exactly one display dot per sample. When marking waveforms to exact sample precision, be sure the display window is narrow enough to resolve every sample. It is also helpful to use the DOT or BAR display format so that exact sample locations can be seen.

Several single key press functions are available in MARK mode, and reference the current cursor position. Functions pertaining to pitch markers are active only when pitch editing is enabled (see the PITch command below):

7. Additional Commands

7.1. PLAy

The portion of the waveform currently in the display window is played through the DAC. For this command to function on a PC, a Dalanco Spry, Ariel, Data Translation, or SoundBlaster card must be installed in the computer, and the version of EDW on the computer must be compiled for use with the installed hardware. Sparc and SGI workstations have built-in A/D and EDW will attempt to use this hardware.

7.2. SYS <command line>

EDW is suspended and the operating system is called to execute the command line. This includes the ability to run any program for which sufficient memory is available above the memory used by EDW. Care must be taken with programs which manipulate the same files being used by EDW since EDW does not close its files before calling the system. This also means that segment definitions and file edits made with EDW will NOT be available to the spawned programs. EDW uses very large memory buffers to hold as much waveform and pitch data as possible in the main computer memory. Because of this, many external commands will fail on a PC due to insufficient memory. On a PC or AT the SYS command is not recommended.

7.3. SAVe

Updates the file being edited without exiting. This will cause all new segment definitions and all waveform edits to actually be written to the output file so that work in progress will not be lost. SAVing causes the cut/paste buffer to be flushed so be sure its contents will not be needed after the SAVe.

7.4. EXit

Exit EDW and make any file changes permanent. To maintain relatively fast operation, EDW does not actually make any changes to the waveform file while it is being edited. Instead, EDW keeps track of changes indicated (segment markings, cut and paste operations, etc.) and actually applies them to the waveform file when you exit. The danger in this approach is that if the system crashes after you have made extensive changes to a file, those changes will be lost. When doing extensive editing that involves cut and paste operations it is advisable to do the editing in several stages, exiting or saving (see above) edits between each stage. When only marking segments, this precaution is less often important.

7.5. QUIT

Exit EDW and discard all changes (segment definitions, cuts, pastes, and includes) made since the last SAVe command. If the waveform has actually been changed, EDW will ask if this is really what you want to do.

7.6. BIND

"Binds" an EDW command string to a single keystroke. EDW first asks for the key being defined. You must choose a key that you do not use for anything else, because it will no longer function as a regular key; control keys are especially useful here, as are function keys, shifted function keys, etc. EDW next asks that the key definition be entered. This may be any single EDW command or concatenated command string terminated by the enter key. If you want the command itself to be terminated by a return when the key is pressed, use "\r" to indicate a return. EDW handles bound keys by replacing the bound key in the input stream with exactly what you have entered as the key definition. Thus, if you actually want EDW to respond to a key press as though you had entered a command it is generally necessary to terminate the definition with a "\r". For instance, in defining the F10 key as the EDW command "EXIT" you must enter EXIT\r as the key definition. Without the "\r", EDW will print the letters EXIT, exhaust the key definition, and wait for you to actually press the enter key on the keyboard before the command is executed.

Two EDW commands, NEXT and MARK are normally bound to single keystrokes when EDW is started. EDW translates and empty command line into a NEXT command, and the escape key into a MARK command. On very slow PCs you may actually see the MARK command appear as the ESC key is pressed.

7.7. DEFK <key_number> <"definition">

DEFK is a form of the BIND command that can be used in the EDWINI file (BIND should not be since it is interactive). The key to be defined is indicated as a numeric code value, and the definition should be enclosed in quotes. A separate program, EDWKEY, is used to determine the key codes used by EDW. Just run EDWKEY and press any key; the code value for that key will be displayed. EDWKEY is stopped by pressing ^C. See the example EDWINI files for several examples of the DEFK command usage.

7.8. HPRint

This command will cause EDW to dump the current screen image for an EGA or VGA display to an HP Laser-Jet+, Series II, or compatible printer via the parallel printer port. It will not function with any other display types or printers. The image is printed with a "dithered" gray scale that uses a 3-by-3 pixel matrix to represent each display dot.

7.9. HP2

Equivalent to the HPR command, but can only be used with an HP Laserjet compatible printer that has memory expanded to at least 1 Mbyte. This command dumps the screen image in a larger, "landscape" orientation using a 4-by-4 pixel gray scale dithering routine.

7.10. HELp/?

Displays a brief command summary.

7.11. DO <filename[.EDW]>

EDW will open the specified file and execute all commands from that file. The default file extension is '.EDW'. This "indirect command" file may itself contain DO commands with a maximum nesting level of 8. When setting up indirect command files for EDW it is important to realize that some commands are inherently interactive and these should not be placed in indirect command files. In particular, the MARK and BIND commands should not be placed in an indirect command file. Some other commands, notably LENGTH and HELP will pause and wait for an ENTER before restoring the graphics screen and thus should also be avoided. The SYS command, which normally pauses before returning to the EDW display will sense that an indirect command file is in operation and will not pause. However, when using the SYS command remember that some external programs may also pause and wait for input directly from the keyboard. Further, these external programs run via the SYS command will not see input from the.EDW command file. For example, the following will NOT work:
	filea,fileb filec/gain:-3
	filed,filee filef/gain:-3
	SET SP ON & VIE filec & WIN 1000

But the same can be accomplished with:
	SYS LATTSY filea,fileb filec/gain:-3
	SYS LATTSY filed,filee filef/gain:-3
	SET SP ON & VIE filec & WIN 1000

Parenthetically, note that the HPR command in this example cannot be appended to the end of the previous line with '&' because EDW would then start the screen dump command before updating the screen.

7.12. SUSpend

Suspend 'DO' processing until a RESume command is given. Through the use of SUSpend and RESume, it is possible to set up do files to cause EDW to read a sequence of waveforms, set parameters for each new waveform, suspend DO processing to allow interactive manipulation of the waveform, and then resume processing the DO list commands. Here is an example: <file is list.edw> vie file1.wav&win 5000 suspend vie file2.wav&win 5000 suspend vie file3.wav&win 5000 suspend

From EDW, the command 'DO list' will begin a sequence in which EDW brings up a sequence of files to edit. When each file is displayed, control is passed to the user because of the suspend command. It is then possible to mark or edit the displayed waveform. When the user has completed whatever needs to be done with a sentence, he or she enters the RESume command so that EDW will continue processing the do list.

7.13. RESume

Tells EDW to resume processing a DO list of commands if (and only if) the processing had been suspended with the SUSpend command.

7.14. PITch <Read|Write|Clear|ON|OFf> [filename]

The PITch command controls pitch editing in EDW. EDW does not attempt to determine pitch period locations itself, but it does allow pitch data determined by other programs to be displayed and edited, and can be used to manually create pitch data files if desired. Four "actions" can be specified with the PITch command in EDW: Read, Write, ON, and OFf. Optionally, Read and Write can be followed by a file name for the pitch data to be read or written. If no file name is given, Read defaults to the basename of the current waveform with.PPS as the extension and Write defaults to the name used for the previous Read or to the same convention that Read would have used (e.g., if there had been no previous Read). For example, when viewing a file called "speech.wav", the command PIT R will look for a file called "speech.pps" and read data from that file. The PIT W command (with no file name given) will then attempt to write a new version of speech.pps. If pitch data was stored in a file called "pitch.dat" the command "PIT R PITCH.DAT" must be used to read the file but a subsequent PIT W command (again with no file name) would write to pitch.dat.

Both Read and ON enable a pitch marker display which consists of a narrow region above the waveform display area in which vertical lines demark the time of waveform events. A line with an arrow or "v" at its base is used to mark the onset of a pitch period and a line without the "v" indicates the start of a voiceless interval. The MARK command allows pitch editing when the pitch display is enabled. Via cursor movement and single keystrokes it is possible to (A)dd, (M)ove, and (D)elete pitch markers, and to set markers to indicate a (V)oiced or (U)nvoiced segment.

The PIT Clear command erases all the currently defined pitch markers without turning off pitch editing. This can be useful when doing manual pitch labeling and tracking. Finally, the command "PIT OFF" removes the pitch display if one was enabled.

The pitch files read and written by EDW are simple ASCII (i.e. plain text) files which are intended for use with speech synthesis software. The files contain at least three columns of data. The first column indicates the time (in msec) of each pitch event (either the start of a pitch period or of a voiceless interval). The second column indicates the fundamental frequency (F0) for voiced events and is normally set to 0.0 for voiceless events. The third column is a flag with a value of 1 to indicate a voiced event (i.e. a pitch period) and a 0 otherwise. Some programs that create.PPS files (the default file type for pitch data) include additional columns of data for each event. However, EDW does not interpret those additional data columns, nor does it write them when it writes a .PPS file. This is not very desirable behavior, but it saves considerable amounts of memory.

7.15. MEA <sub_command>

The MEA command is used to start, end, and control execution of the MEA spectrum measurement program in conjunction with EDW. It is available only in Unix versions of EDW to allow time-linked versions of EDW and MEA to run simultaneously. Two special subcommands, CONNECT and DISCONNECT start MEA on a Unix pipe connected to EDW, and stop MEA, closing the connection, respectively. All other subcommands are sent to MEA for interpretation and execution. See the MEA documentation for information on MEA commands.

When MEA is connected and EDW is in Mark mode (i.e., the cursor is present), pressing the S key will cause MEA to display the spectrum of the waveform for a window centered at the cursor.

8. Miscellaneous

8.1. Example EDWINI file statements

These commands just set up some initial scale and style factors
step 150 *Sets the initial step size to 150 msec
wind 200 *Sets the initial window length to 200 msec
set ega  *Ensures that EDW will scale the display for an EGA
set sp db 48 *Set the spectrogram amplitude range to 48 dB
set display line *EDW will draw lines between samples in the display

The following three statements define function keys F1, F7 and F8 so that pressing F1 will bring up the cursor for waveform marking; pressing F8 will advance the display one step and pressing F7 will shift the display one step back in time.
defk 315 mark\r *Sets F1 to the command MARK followed by a RETURN
defk 322 next\r *Sets F8 to the NEXT command
defk 321 last\r *Sets F7 to the LAST command

The following commands provide functions for keys F3, F4, F5, and F6 respectively. As a result, pressing F3 will cause EDW to change the display to amplitude bars, shift to a very narrow (10 msec) step size and window length, and use an amplitude scale of 1. F4 shifts to a 'standard' line display, 100 msec window, and 80 msec step, with the scale remaining at 1. And so forth.
defk 317 "set dis b&win 10&step 10&scal 1\r"
defk 318 "set dis l&win 100&step 80&scal 1\r"
defk 319 "set dis b&win 32&step 24&scal 4\r"
defk 320 "set dis l&win 200&step 150&scal 1\r"

Finally, the last two lines define the keystroke ^P (Control-P) as a play command and the F10 key as an exit command.
defk  16 play\r
defk 324 exit\r

8.2. Error Messages

When EDW detects an error it will print a message noting the error at the bottom of the screen. EDW then waits for a keypress before it erases the error message and restores the 'EDW>' command prompt or cursor. Thus, whenever an error occurs, you should press ENTER or the spacebar to 'acknowledge' the error before trying to redo the command that caused the error.

8.3. Auxiliary Files

Under certain conditions, EDW will create, delete, and rename files in your current directory. In particular, if and only if you have actually changed the waveform by cutting, pasting, or inserting chunks of waveform, EDW will delete an existing file named '{edwbak}.wav', create a new file named '{edw002}.edw' to contain the edited waveform, rename the old version of the file you have been editing to '{edwbak}.wav', and then rename '{edw002}.edw' to whatever the current file was named. Under normal conditions you will never see the file '{edw002}.edw' since it is created and renamed before the program exits to DOS. The file '{edwbak}.wav', however, should always contain an original version of the altered waveform file as a backup. As long as you do so before changing another waveform file in the same directory, you may restore the original version of a file you changed by deleting the new version and renaming the backup version. Another file that you may see from time to time is named '{edw001}.wav' and is used by EDW to hold portions of other waveform files that you have included with the "I" option under MARK.

Note that the braces '{}' in these names are for real. They are actually part of the filename and were chosen to reduce the chance that a similarly named file already exists. It would not be a good idea to make files of your own with similar names since EDW could delete them. Future versions of EDW may use additional files with similar names (e.g., '{edw00n}.edw' where 'n' is a number between 1 and 9).

H. T. Bunnell
Speech Processing Laboratory
Alfred I. duPont Institute

Program Version date: December, 1995
Document Version date: January, 1996

9. Acknowledgments

EDW has slowly grown for years. Significant aspects of its "user interface" design derive from a system called "Waves" that was developed for PDP-12 computers by Lloyd Rice at the UCLA Phonetics Lab. Much support and many useful comments were supplied by Jim Martin, Mac Pickett, Sally Revoile, Grace Yeni-Komshian, and many others. Several people have contributed to the program code as well. The PC graphic screen print subroutine was largely written by Yulin Chen. Shirley Peters developed the SunView interface library for the Sun version of EDW, and George Lamb adapted the SunView interface library for X11R4. Shirley Peters significantly extended the X11 interface and has completely rewritten the low level waveform I/O library used by EDW and other program. Funding from the National Institutes of Health and the Nemours Foundation has contributed to the development of this software.