How to run: pitchAdaptTwoWords

This study examines how speakers adapt the pitch of their voice when feedback of the pitch is perturbed. The study uses two types of stimuli: a word ("bod") during the first two sessions and a vowel ("ah") during the last two sessions.

Special circumstances: part of battery

This experiment is part of the cerebellar battery run in 2022-2023. For controls and patients, it is in the SECOND session. 

In this battery, participants come in for multiple sessions and do multiple experiments in a row. As such, this is a bare bones document on how to run the experiment. Procedures for consent, hearing screening, awareness surveys, general equipment set up, and payment are not included in this document. See the documents below for how these procedures are implemented in this multi-study session: 

  1. Protocol for cerebellar battery: controls
  2. For patients

Prepping for the participant

  • closed back headphones
  • microphone
  • Audapter
  • FocusRite

What's special about this experiment

This study examines how speakers adapt their pitch in the upward opposite direction in response to downward pitch shifting of their own voice during production of the word "bod" and the vowel "ah".

The study consists of 4 sessions that are in a fixed order:

1. pitch shifting producing the word "bod", 2. control session producing the word "bod" (unperturbed feedback), 3. pitch shifting producing the vowel "ah", 4. control session producing the vowel "ah".

Pre-experiment instructions


"In this experiment, there will be 4 sections. Brief breaks between all these sections are included while the experimenter initiates the next part. During each of the sections, you will be reading words off the computer screen and listening to your speech over the headphones."

Don’t hesitate to ask questions or raise concerns at any point."

Enter run_pitchAdaptTwoWords_expt in the command line and press "enter". 

Enter the ID of the participant and their height.


Before the start of the first session, there is a calibration phase where the f0 of the speaker is extracted and during which the correct pitch shift paradigm is selected (the pitch shift paradigm is only selected once and is not selected if this participant has already done session 1 or pitchComp ). f0 is calculated before each session.

"In this section, you will see a word appear on the screen. Read it out loud once, just like you would normally say it, only slightly longer. Try to keep the pitch of your voice constant. After you speak, there will be a short break while I calibrate our equipment

Do you have any questions?"

Calibration instructions

  1. Press "enter" to start the recording after the instructions on the screen of the participant.

  2. Calculate the f0 of the speaker: You see the waveform in a figure on the experiment computer. You will be prompted ‘Is the recorded sample good?’ at the command line. 

    • If the recording looks okay and there is no clipping visible in the figure (see below for an example), press ‘y’ and hit enter.

    • If there is clipping visible in the figure (see below), reduce the microphone gain, then press ‘n’ and hit enter. The whole process will repeat. Repeat as needed until the audio looks good and no clipping is visible in the figure.

    • If there is a problem with the audio signal (participants didn’t speak, said the wrong thing, coughed, etc.), press ‘n’ and hit enter. The whole process will repeat. Repeat as needed until the audio looks good and no clipping is visible in the figure.

     Graphical user interface, applicationDescription automatically generated

Fig 1: Two examples of speech waveforms. In the image on the left, the waveform falls between -1 and 1 (indicated by the red lines). This is an example of an appropriately set microphone gain. In the image on the right, the waveform is “clipped”—it is cut off by the -1 and 1 boundaries. In this case, the microphone gain needs to be reduced. If the microphone gain is too low (not shown), the waveform will have a very small range. Aim to use most of the range between -1 and 1 without any clipping.

  1. Enter a percentage value for upper and lower boundaries for pitch tracking: this value will be used to calculate the upper and lower boundaries for tracking the vocal pitch. The closer the boundaries are to the f0, the better the estimate of the pitch and the better the shifting algorithm works. However, there will be problems if the actual pitch goes outside these boundaries. The exact boundaries that work best depend on the speaker. The default value is 20%, and will work well for most speakers. In this next section, we will set the pitch boundaries. After inspecting 3 figures with this percentage (see below), you can change the value. In most cases, the 20% value is the right one. There might be pitch contours that are not as steady as in the given example and the green and blue lines touch the red lines ones in a while. In this case, the boundaries should be a little bit larger, such as 25% or 30%.

    • You will see a figure pop up like this: IMPORTANT: WHEN THE TOP PANEL DOESN'T SHOW UP/ IS EMPTY, RESTART MATLAB:

Graphical user interface, text, applicationDescription automatically generated

  • Click “enter” for the next figure that shows the pitch contour, shifted up (green line). Press ENTER again

  • The next slide is the pitch contour, shifted down.

  • Press “enter” again.

  • Confirm percentage: Both the green and blue lines should be contained within the red horizontal borders in all the three figures. if the participant said 'bod,' it's OK if a portion at the end is outside the red borders. If this is the case, enter ‘y’ in the command line, after prompted: 'Is the percentage good?', {'y', 'n'}.

  • Examples of boundaries: In the figures below, you see two bars: one bar shows the pitch shifting output of Audapter; the lower bar shows the extracted pitch from the waveform. These can differ slightly but should not differ to a large extent. The default boundary value is 20% (example pitch shifted up first figure); the 10% boundaries in the example below are too narrow. In case the speaker has an unstable pitch and 20% is too narrow, the boundaries must be adjusted to a larger value, e.g., 25% or 30%. In general, 20 % is the lowest value, and boundaries need only be adjusted to a larger value. The 10% figure is for demonstrating how a too-narrow band looks like. The final disturbances are caused by the ‘d’ in the word “bod” and can be ignored.

Graphical user interface, application, table, ExcelDescription automatically generated

  1. Select pitch shifting manner: Next, the AlgorithmSelect window opens. Here, you select one of three algorithms that Audapter can use to shift the pitch of the voice. There are nine buttons on the left of the screen. When you click on one of these buttons, it will play back an audio sample demonstrating how the participant’s voice will sound with that combination of pitch shifting direction (up, down, none) and pitch shifting algorithm on the right (pp_none, pp_peaks, or pp_valleys). It’s not important to understand the differences in the pitch shifting algorithms; they just indicate certain ways to shift a pitch up and down. Listen to the different algorithms to see which one sounds the most natural. In most cases, this will be pp_none. Then click the radio button on the right corresponding to the best algorithm and click “Select Algorithm”.

Graphical user interface, applicationDescription automatically generated


Main experiment

Check if the speaker is wearing the headphones. If not wearing:

"Please put the headphones on now." [make sure they are on correctly]

First two sessions, producing "bod":

"When you see the word "bod" appear on the screen, read it out loud, just like you would normally say it. Keep the pitch of your voice as constant as possible, so it sounds monotone."

Experimenter can show this by saying "bod" with no pitch fluctuations/monotone.

You will be speaking into the microphone, and you will hear your own voice played back to you through the headphones. There will be a break every 14 trials. If you need to take a break at some other time, like to cough or take a drink of water, you can press "p" on the keyboard. You will get some trials to practice."

"Do you have any questions before we start?"

Last two sections, producing "ah":

"On each trial, you will see the vowel "ah" appear on the screen, just like before. When you see the word on the screen, start reading the word out loud. Keep the pitch of your voice as constant as possible, so it sounds monotone. Keep producing the vowel until the word disappears from the screen. You will get prompted when the vowel is too short, you start too late or when your voice is not loud enough."

Experimenter can show this by saying "ah" with no pitch fluctuations/monotone.

Things to keep an eye on:

  • Monitor the amplitude level. You may need to adjust the microphone gain if the participant starts talking too loudly or too quietly. You or the participant can press "p" to pause the study and talk to the participant or take an extra break.
  • Monitor the upper and lower boundaries indicated by the red horizontal lines: The boundaries can be adjusted mid-session by pressing the button (b) on the display and entering a new percentage (right arrow in the figure below).
  • Monitor if speakers starts the vowel consistently too late.  You can check this by monitoring the length of the vowel, indicated by the green vertical lines in the display figure. If the right line is frequently at the utmost right side of the figure, the production starts too late and you can adjust the length of the trial by pressing the button (e) on the display (left arrow in the figure). This way, it is avoided that the speaker hears their own actual voice without the feedback.
  • If the speaker has difficulty producing the correct vowel length, you can adjust the time that the stimulus is shown on the screen. Make the stimulus presentation on the screen longer if the speaker makes the vowel consistently too short, so the speaker is forced to lengthen the vowel.

If Matlab crashes during the experiment

As of 10/24/2022 there is no restart script for this experiment. 


KeywordsPitch Adaptation, two words, control and perturbed session   Doc ID123933
OwnerAnneke S.GroupSMNG Lab Manual
Created2023-02-08 14:26:17Updated2024-05-22 14:21:09
SitesSpeech Motor Neuroscience Group
Feedback  0   0