Week 9: Manipulation and resynthesis
1 Manipulating pitch contours
Sounds can be manipulated, which is useful when it comes to creation of stimuli for perceptual experiments. Today we will see a couple of things that we can do with sounds (though these are not the only things you can do!) We will download from ILIAS (or here) the Sounds nominated.wav and nominated2.wav. Open them in Praat.
The Sound nominated.wav has a statement: he was nominated. On the other hand, Sound nominated2.wav is a question/exclamation, with a different pitch contour: he was nominated?!. We will extract the contour pitch in nominated2.wav and transpose it to nominated.wav.
1.1 Time scaling
Since these are two different utterances made by different people, it will be very unlikely that the timing will be exactly the same. If we look at the total durations, we will see that Sound nominated is 1.105 s, while Sound nominated2 is 1.039. We will scale Sound nominated2 so that both sounds are the same length.
If you select the object Sound nominated2 and then go to Modify Modify times Scale times to... You will have a dialogue window asking for the new start and end times. We put 1.105 as the new end time. Or, which is the same, we can create this script:
selectObject: "Sound nominated2"
Scale times to: 0, 1.105
If you look at Sound nominated2, you’ll see that it’s now 1.105 s long.
1.2 Creating a Manipulation object
The Manipulation object will allow you to get a Praat Object called PitchTier. These are points along the pitch contour which you can modify in whatever way you like (remove/add points, move only certain points, make them all go higher by, say, 20 Hz, etc.) First, let’s create a Manipulation object from Sound nominated: We go to Manipulate To Manipulation... and we leave the default settings as they are. Or, you can also script it:
selectObject: "Sound nominated"
manipnom1=To Manipulation: 0.01, 75, 600
Now, we do the same with Sound nominated2.
selectObject: "Sound nominated2"
manipnom2=To Manipulation: 0.01, 75, 600
If you select one of these Manipulation objects and then click on View & Edit, you will be able to see the pulses, the PitchTier, and the DurationTier, one below the other.
1.3 Extracting the PitchTier
Now we want to extract the PitchTier from the Manipulation object that we created from Sound nominated2. That can be done by simply selecting the Object Manipulation nominated2 and then clicking on Extract pitch tier. Or:
selectObject: "Manipulation nominated2"
pt2= Extract pitch tier
This will create a Praat object called PitchTier nominated2.
1.4 Replace the PitchTier
Finally, we want to replace the pitch contour of Sound nominated with the one from Sound nominated2. In order to do so, we simply select BOTH PitchTier nominated2 AND Manipulation nominated. When doing so, you will see in the Objects window the option Replace pitch tier. Click on that, and then check the object Manipulation nominated. You will see that instead of the original pitch contour, it will now have the rising one from Sound nominated2. The following chunk does that:
selectObject: "PitchTier nominated2"
plusObject: "Manipulation nominated"
Replace pitch tier
1.5 Create a new PitchTier
What we have done is a somewhat crude approach to pitch manipulation. You can make better manipulations by creating an empty PitchTier: New Tiers Create PitchTier... You can use the time specifications from Sound nominated: from 0 to 1.105 s. We will call it better.
better = Create PitchTier: "better", 0, 1.105
Now we can check the times from the Manipulation nominated object so we can create a simplified PitchTier. We will create a rising pitch contour with two points:
selectObject: "PitchTier better"
Add point: 0.07, 200
Add point: 0.89, 230
The times correspond to the beginning and end of the original pitch contour. After you add all the necessary points to your new PitchTier, you can replace the PitchTier just as we did in 1.4. Of course, you can add more complexity to this new PitchTier object by adding as many points as you like.
2 Manipulate formants
You can also manipulate formants, and here we will transform a Spanish [a] into a Spanish [o]. Let’s take the carta.wav sound from Week 1 (it’s still available on ILIAS). We will manually extract the first [a] sound from it. The resynthesis process will trim the 0.025 seconds before and after the sound, so bear that in mind when you slice the sound. Also take into account the loci from the previous plosive, etc. We will called the sliced sound car.
In order to change the quality of a given vowel (that is, from [a] to [o]), we will have to run a resynthesis. This means that we will ask Praat to remove the source (which is just a funny trumpet-like noise, this equals to talking about the noise that your vocal folds do without having the rest of your head attached to them) from the signal, and then we will manipulate the filter (that is, what the rest of your vocal tract does to your glottal pulses).
2.1 Extracting the source
We run the following script:
selectObject: "Sound car"
Resample: 11000, 50
To LPC (burg): 16, 0.025, 0.005, 50
selectObject: "Sound car_11000"
plusObject: "LPC car_11000"
Filter (inverse)
Rename: "source"
Let’s see what the script does. Line 2 resamples our sound, which is needed in order to do resynthesis (Praat won’t let you resynthesize if you don’t do this first). This can also be achieved by going to Convert Resample... The sampling frequency is 11000 Hz for female voices and 10000 for male voices. This will create a sound called Sound car_11000.
Line 3 creates an LPC object. This is a rather obscure object and it’s essentially just coefficients that Praat calculates from the signal. You can create an LPC object by clicking on Analyze spectrum To LPC (burg). We will use the default values.
Now we do the inverse filtering: we select both the LPC object and the resampled sound, and then we click on Filter (inverse). This is done in lines 5 to 7. This will give us the source, and we will thus rename it Sound source.
2.2 Manipulating the filter
So that was the source. Now we move on to the manipulation of the filter:
selectObject: "Sound car_11000"
To Formant (burg): 0, 5, 5500, 0.025, 50
Formula (frequencies): "if row = 1 then self - 400 else self fi"
Formula (frequencies): "if row = 2 then self - 600 else self fi"
First we need to extract the formant information from the resampled sound (lines 8-9). The Formant object, as we have already seen in previous sessions, has the specifications for the female voice, 5500 Hz. Make sure to change this if your recording was made by a male speaker. You can do this via clicking if you go to Analyze spectrum To Formant (burg).
Now, the crucial bit: Lines 10 and 11 use the command Formula (frequencies): (if you select the Formant object, you will find this under Modify). These lines are rather straightforward: ”if the formant is F1 (if row = 1), then take whichever value it has at a given point in time (self ) and subtract 400 Hz to it; if the formant is not F1, then just leave it alone (else self fi). This will change the F1 values of the current sound (around 900 Hz) to ca. 500 Hz,which is a fairly acceptable value for a Spanish [o]. We will assume that for F2, (currently reaching 1800 Hz), lowering the values by 600 Hz will leave us with an F2 of 1200 Hz, which is acceptable for a Spanish [o]. With these formulas we have manipulated the formant values.
2.3 Resynthesis
selectObject: "Sound source"
plusObject: "Formant car_11000"
Filter
Finally, with lines 12 to 14 we get to feed the altered formant values to the source. In order to do this with the clicking method, we select both Sound source and Formant car_11000, and hit Filter. This will create a new sound called Sound source_filt. You will hear an [o]-like sound.
3 Homework
Choose one of these two homeworks:
- Record yourself with Praat saying something like "Who is responsible here?" as if you were an angry costumer and are already talking to the manager (so you're trying to imply "dude, you are not doing your work"). Then record yourself asking the same but as if you don't know the answer. Make sure that when you use View and Edit the "show pitch" option is on. Check the pitch contour -is it a raising curve, a falling one? Now create a Praat script that (a) creates a Manipulation and PitchTier objects, and (b) replaces the pitch contours.
- Record yourself saying "I say bat once". Create a script that modifies the vowel so the word becomes "bot" instead of "bat".
Upload a pdf file with the script and a screenshot of the View and Edit screen before and after the manipulation. Don't forget to add your name to the file name (e.g. praathomework_mylastname.pdf).