Lab #5 Using Straight to Change Word Stress

S702 4/11/02 D. Kewley-Port & W. Su

The purpose of this lab is to use Straight by Kawahara (1999) to synthesize a sentence with altered stress patterns. A brief description of this lab is: Following Lab #4, start with "We were away a year ago" in neutral intonation. Synthesize the sentence changing stress on 'year' for a + 60 Hz increment in F0, and also make local F0 contour on 'year'.

1) Use your neutral sentence of "We were away a year ago" from Lab #4, or make a recording with these instructions: Record the sentence in CoolEdit in order to head & tail edit it. You should try and record without specific stress on any word, and with fairly even and natural rhythm.

2) Use Straight to analyze the sentence following instructions in Homework #7. It will be easier if you change the analysis frame rate to 5ms for this project (changed from default of 1 ms). Synthesis this neutral sentence to make sure it sounds 'natural', and save the .wav file.

3) One parameter that signals syllable stress is changes in F0. A general discription of the use of F0 in speech synthesis for syllable stress can be found in Klatt (1987), p. 761-763. Generally, a fixed step increment of F0 is a good cue for stress. In addition, an local rising or falling F0 contour is cue to syllable stress. Straight can be used to change the F0 track by accessing the array 'f0raw' through the button 'peak variables' on the GUI. To change the stress on the word 'year' in your sentence, first increase the F0 on just 'year' in 'f0raw' by about +60 Hz following the instructions below. Synthesize with the altered F0 values and save the .wav file. Choose a different local F0 contour for 'year' and synthesis that sentence. Hand in a plot of the F0 tracks, clearly marking where 'year' occurs', and spectrograms for neutral and two altered versions (+60 Hz and other F0 contour).

4) Upload your original and 2 synthsized (+60 and local contour "year")  in the folder "Lab5" in Oncourse, class-file.

5) Listen to your Straight synthesized files. Which altered F0 contour appears to change syllable stress the most? In your report, describe what other changes could have been made to signal stress on 'year' (see Chapters 5 & 6 in Lass). Describe how they might be manipulated in Straight. Comment on whether Straight is an good tool for manipulating word stress for experimental purposes. Suggest experiments you would use with Straight.


Kawahara, H. (1999). "Restructuring speech representations using a pitch-adaptive time-frequency smoothing ..", Speech Communication 27, 187-207.

Klatt, D.H. (1987). Review of text-to-speech conversion for English. J. Acoust. Soc. Am., 82, 737-793.


1. To manipulate F0, you need access to 'f0raw'. This is explained on the last page of the Getting Started manual. Click on 'peak variables' on the GUI. You will get a K>> in the Matlab command window indicating you are in the 'keyboard mode'. You can access variables on the workspace (type 'who') that otherwise will disappear when you close Straight.

2. It is recommended that you save 'f0raw' as an external text file. This is not only a record of your analysis, but you can also manipulate the files with Excel, a text editor or whatever to change f0raw. Of course, you can manipulate F0raw directly in Matlab. Matlab will save arrays with its own commands, but the format is in scientific notation. The command for saving is:
save 'f0raw1.txt' f0raw -ascii

3. If you want to manipulate f0raw in the Excel, first f0raw needs to be transposed from a row array to a column array:
f0raw = f0raw';
Save the transposed array (see above). Read it into Excel. To change the scientific notation to decimal, highlight the column, then go to menu Formant -> cells -> number, choose 5 decimals and work from there. You can alter this f0raw in Excel and plot it. Then use Excel->save as-> to save the new version as a text file (e.g. 'f0raw60.txt') in order to read into Matlab. Yes, it is a lot easier to manipulate f0raw directly in MatLab if you have decent skills with MatLab variables, especially the 'colon' operator ':'.

4. To reload the file back into Matlab with anarray name the same as the file name, enter:
load f0raw60.txt. If you do this within the keyboard mode in Straight, this manipulated f0raw60 array can be used instead of the orginal f0raw for synthesis. If your file came from Excel, you will have to transpose it back to a row array. Make sure it has exactly the same size as the original f0raw array.

5. Remember to type return before you try and use the Straight gui again.