Skip to content

A Speech Perception Task

Written by Mandy Withall

Mandy Withall is a volunteer Research Scientist at FindingFive. They are currently pursuing their PhD degree at Northwestern University.

Introduction

Speech perception tasks ask participants to listen to a set of audio clips and make a judgment about each clip.

speech-perception-task-graphic.png

An example of a common speech perception task structure.

This kind of stimulus-response presentation is common in fields such as linguistics and psychology. Researchers may be concerned with the specific responses chosen by participants and/or response times (which are collected automatically by FindingFive).

In this article, we will demonstrate how to create a simple speech perception task using FindingFive. In this task, we will determine how well the participant can discriminate between words starting with either the /l/ or /r/ sounds. This task is particularly interesting considering that some languages (such as Korean) do not make a phonemic distinction between /l/ and /r/.

Although this article will demonstrate how to accomplish this task with audio stimuli, FindingFive can present a wide range of stimuli to participants, including text, images, and videos. A wide range of responses can also be taken from participants, such as forced choice responses or ratings.

Additionally, this study guide has an affiliated video on our YouTube channel. Take a look to learn more about this task and about FindingFive in general!

The Phonemic Discrimination 2AFC Speech Perception Task

Our goal is to present participants with a series of audio clips that contain a word beginning with either the /l/ sound ("load") or /r/ sound ("road"). Participants will listen to each clip once before selecting either the letter L or R to indicate which sound they heard at the beginning of the word in the audio clip. For this task, we will therefore need audio stimuli and a forced choice response, organized into trials and blocks.

Creating Stimuli

To start, we need to create the audio stimuli that will be used. In this case, we will create a .csv file and upload that to FindingFive. Use your favorite spreadsheet editor to create a .csv file that looks like this:

name type content visible
rack audio rack.wav FALSE
lack audio lack.wav FALSE
raw audio raw.wav FALSE
law audio law.wav FALSE
red audio red.wav FALSE
led audio led.wav FALSE
read audio read.wav FALSE
lead audio lead.wav FALSE
road audio road.wav FALSE
load audio load.wav FALSE
rock audio rock.wav FALSE
lock audio lock.wav FALSE
room audio room.wav FALSE
loom audio loom.wav FALSE
rust audio rust.wav FALSE
lust audio lust.wav FALSE

How to set up your .csv file to upload to FindingFive.

Make sure you save as .csv

Make sure that you save your file in Comma Separate Values format (with the .csv extension) and not in a proprietary format (such as .xlsx).

The name column specifies what each stimulus should be named. The type column specifies which type of stimulus should be presented (in this case, audio for each). The content column specifies the audio files to use, which we will upload next in a separate step. The visible column specifies whether the audio player should be visible to participants as the clip is playing. We have set this value to FALSE for all stimuli to hide the audio player.

After you have saved the .csv file to your device, you can upload it to the Stimuli section of the study editor. Click the upload icon () and select your .csv file. Once you have uploaded the file, your stimuli will automatically populate.

Importantly, you will also need to upload the audio files to the Resource Files of your FindingFive account. You can do this by hovering over "Research" in the upper right hand corner of the website and selecting "Files". You can find all of the files that we use in this tutorial here: Speech_Perception_Audio_Stimuli.zip

Creating Responses

Next, we will create a two-alternative forced choice (2AFC) response so that participants can respond to these audio stimuli with either L or R by clicking on associated buttons.

Let's create that response now under the Responses section of the study editor. Click the + icon to create a response and name it choice_res:

Code for choice_res (click + for code explanations)
1
2
3
4
5
6
7
8
{// (1)!
  "type": "choice",// (2)!
  "instruction": "Press either R or L.",// (3)!
  "choices": [// (4)!
    "R",
    "L"
  ]
}
  1. All response code must be encased between two curly brackets {} (required).
  2. Every response must have a recognized "type". In this case, "choice" (required).
  3. Many response types allow you to specify a custom "instruction" (optional, defaults to "Click the answer that you think is most likely correct.").
  4. The "choices" property lists the response options, encased in square brackets [] (required).
Want FindingFive to automatically mark responses as correct/incorrect?

See the section An Extra Challenge at the end of this guide.

Next, we’ll show you how you combine these components into trials of your study.

Creating Trial Templates

Trial Templates organize stimuli and responses on trials and display them to participants. A key concept of trial templates is that each template defines a group of trials of similar structure and function.

In the current study, we have only one type of trial, in which participants hear a word and respond by selecting the letter that corresponds to the sound they heard at the beginning of that word. Since every trial will have the same structue, we can tell the study grammar to generate all of the trials of our experiment from a single trial template.

To do this, we will add code to the Trial Templates section of the study editor. We will create a trial template called "Main":

The "Main" trial template (click + for code explanations)
{// (1)!
  "Main": {// (2)!
    "type": "basic",// (3)!
    "stimuli": [// (4)!
      "rack", "lack",
      "raw", "law",
      "red", "led",
      "read", "lead",
      "road", "load",
      "rock", "lock",
      "room", "loom",
      "rust", "lust"
    ],
    "stimulus_pattern": {"order": "random"},// (5)!
    "responses": ["choice_res"]// (6)!
  }
}
  1. The Trial Templates section of the study editor must begin with an opening curly brace ({) and end with a closing curly brace (}), with all trial templates defined between them (required).
  2. Each trial template is defined with its name (user-defined) as the property and its definition as the value, encased between two curly brackets {} (required).
  3. Every trial template must have a recognized "type". In this case, "basic" (required).
  4. Trial templates use the "stimuli" definition to determine how many trials to generate and which stimuli to display on each trial. The value is always a list (enclosed in square brackets []), with the number of items equalling the number of trials to generate. This format will generate 16 trials with 1 stimulus per trial (optional).
  5. The “stimulus_pattern" property controls various presentation settings for the trials generated by this template. In this case, setting “order" to “random" ensures a random presentation order of the trials (optional, defaults to “fixed").
  6. The "responses" property lists responses to apply to the trials generated by this template. When only one response is given, it is applied to every trial (optional).

This trial template will generate one trial for each of our audio stimuli, each paired with the same "choice_res" response. These trials will be presented in a random order per participant.

As a challenge, how would you change this trial template to present the trials in the same order for every participant?

Spoiler! Presenting trials in a fixed order
Fixed order version of "Main" (click + for code explanations)
{// (1)!
  "Main": {
    "type": "basic",
    "stimuli": [
      "rack", "lack",
      "raw", "law",
      "red", "led",
      "read", "lead",
      "road", "load",
      "rock", "lock",
      "room", "loom",
      "rust", "lust"
    ],
    "stimulus_pattern": {"order": "fixed"},// (2)!
    "responses": ["choice_res"]
  }
}
  1. The code in this example is the same as in the "Main" trial template defined above, except for line 14.
  2. The "stimulus_pattern" property controls various presentation settings for the trials generated by this template. In this case, setting "order" to "fixed" ensures the same presentation order of trials for all participants (optional, this line can be removed as "fixed" is the default value).

And just like that, you have created the only trial template you need to conduct this task. Now, let's assign those trials to a block in the Procedure.

Creating the Procedure

The Procedure allows us to organize trial templates into Blocks and define the order in which to show those blocks using the Block Sequence.

In this experiment, all we need to do is build a single block, add our "Main" trial template to it, and place that block into the block sequence.

A simple experimental procedure (click + for code explanations)
1
2
3
4
5
6
7
8
9
{
  "type": "blocking",// (1)!
  "blocks":{// (2)!
    "Main_Block": {// (3)!
      "trial_templates": ["Main"]// (4)!
    }
  },
  "block_sequence": ["Main_Block"]// (5)!
}
  1. All procedures in FindingFive currently must be "type": “blocking" (required).
  2. This "blocks" property takes a set of curly brackets {} as its value, with each block defined within the brackets (required).
  3. Each block is defined with its name (user-defined) as the property and its definition as the value, encased between two curly brackets {} (required).
  4. Lists the trial templates which will be used to generate trials for this block. Notice that we included our sole trial template, encased in square brackets [] (required).
  5. All blocking procedures must define a "block_sequence". In its most basic form, this is a list of blocks to present in order (required).

When we put this all together, we end up with our speech perception task. Congratulations!

Preview the Experiment

You can now preview the experiment by clicking on the “Preview" button above the stimuli section of the study editor. You can then choose to preview the entire experiment, or select individual blocks to preview in isolation. You can even download your own data at the end of the preview. If you notice anything that needs adjusting, make the changes to your study code and preview again—FindingFive gives you unlimited free previews of all your studies!

An Extra Challenge

In this guide, we built a single response that we applied to all trials to collect participant responses. However, participants are responding to whether the word they heard started with the /l/ or /r/ sound, which has an objective truth value depending on the particular audio file used on each trial.

In cases like this, we can use the "target" property to have FindingFive automatically identify "correct" response choices for us. To do this, we will need to make two separate choice responses, one for when the "target" value is R and another for when the "target" value is L. Then we will need to ensure that the appropriate response is assigned to the appropriate stimuli in our trial template.

Updating Responses

First, we need to turn our single choice response into two choice responses, each with a different value for the "target" property. We encourage you to try this on your own—take a look at the documentation for the "target" property and try making the two versions of the choice response yourself.

Spoiler! Code for the two new choice responses

We have opted to call these new responses choice_res_R and choice_res_L, but you can name them anything you want.

Code for "choice_res_R" (click + for code explanations)
1
2
3
4
5
6
7
8
9
{// (1)!
  "type": "choice",
  "instruction": "Press either R or L.",
  "choices": [
    "R",
    "L"
  ],
  "target": "R"// (2)!
}
  1. The code in this example is the same as in the "choice_res" response defined above, except for line 8.
  2. The "target" property indicates the expected response choice, which will be automatically marked as correct if selected. The value must match one of the values in the "choices" list (optional).
Code for "choice_res_L" (click + for code explanations)
1
2
3
4
5
6
7
8
9
{// (1)!
  "type": "choice",
  "instruction": "Press either R or L.",
  "choices": [
    "R",
    "L"
  ],
  "target": "L"// (2)!
}
  1. The code in this example is the same as in the "choice_res" response defined above, except for line 8.
  2. The "target" property indicates the expected response choice, which will be automatically marked as correct if selected. The value must match one of the values in the "choices" list (optional).

Notice that the only differences between these and the original choice_res defined earlier in this guide are their names and the addition of the "target" property, with a value of "R" for the first and "L" for the second.

Updating Trial Templates

Second, we will need to adapt our trial template to apply choice_res_R to trials where the audio stimulus starts with an /r/ sound and choice_res_L to trials where the audio stiumulus starts with an /l/ sound. To do this, we can take advantage of the "response_pairing" property to systematically apply the appropriate response to each trial. We encourage you to try this on your own—take a look at the documentation for the "response_pairing" property and try updating the trial template yourself.

Spoiler! Updated code for the ''Main'' trial template
Code for "Main" (click + for code explanations)
{// (1)!
  "Main": {
    "type": "basic",
    "stimuli": [
      "rack", "lack",
      "raw", "law",
      "red", "led",
      "read", "lead",
      "road", "load",
      "rock", "lock",
      "room", "loom",
      "rust", "lust"
    ],
    "stimulus_pattern": {"order": "random"},
    "responses": ["choice_res_R", "choice_res_L"],// (2)!
    "response_pairing": "alternate"// (3)!
  }
}
  1. The code in this example is the same as in our "Main" trial template except for lines 15–16.
  2. The "responses" property lists responses to apply to the trials generated by this template. When multiple responses are listed, they will be applied to trials according to the "response_pairing" property (optional).
  3. The "response_pairing" property defines how responses should be assigned to trials generated by this template. This pairing happens before the "stimulus_pattern" is applied (optional, defaults to "alternate").
Double check that your stimuli are ordered correctly!

In the "spoiler" code above, notice how the "alternate" value of the "response_pairing" property will alternate between choice_res_R and choice_res_L, assigning one response to each trial starting with R. Critically, our stimuli also alternate between R and L in the same order, ensuring that the appropriate response is applied to the appropriate stimulus on each trial. Double check that this is the case for your experiment, too!

And that's it! FindingFive will now automatically mark each participant response as correct or incorrect in your data.

Preview the Experiment again

It's important to verify that we did not make any mistakes while tweaking the experiment. The only way to know for sure is to download data, so preview the experiment again all the way through to the end and download your own preview data. Pay special attention to whether the column for "target" matches the stimulus that was presented on that trial, and that the "response_correct" value is accurate. If any trials have the incorrect values for any of this, check your code to make sure that the appropriate response was applied to the appropriate stimuli.

Conclusion

With this base, you can adapt your experiment to include all kinds of things. For example, you may want to include instructions, demographics, or practice trials. All of these options are possible to incorporate using FindingFive’s Study Grammar.

Next Steps

Have you finished creating your study? Do you feel stuck on what to do next? FindingFive is here to help!

At FindingFive, we have all kinds of resources at your disposal to help you launch your study, find and pay participants, and collect data. Although FindingFive has its own participant base, we also have integrations with Mechanical Turk, Prolific, and your own institutional pool to help you utilize whatever participant pool fits your needs.

After you’ve collected data, FindingFive compiles it for you into an easy-to-read ..csv file that can be opened in R, Python, Excel, Numbers, and more to facilitate easy analysis.