Basic fdata structure

Understanding the data structure called "fdata".

Uses and prerequisites for generating fdata

fdata is based on dataVals, so you can only generate fdata if you already have a dataVals file. Basic dataVals structure has some info about this, but basically, you need to have gone through the basic data cleaning process.

fdata is a different organization of the same kind of info that's in dataVals. It can be useful if you want to group together all the trials related to one vowel, or one condition in the experiment.

Generating fdata

In MATLAB, navigate to the folder that contains the dataVals.mat file you want to use as the source data file. If the dataVals file you're using as your source is called exactly "dataVals.mat", then just run gen_fdata. If the dataVals file has a different name, for example, "dataVals_words.mat", then the third input argument to gen_fdata will need to specify that, for example, gen_fdata([], [], 'dataVals_words').

Data structure of fdata

After running gen_fdata in one form or another, there will be a file saved to your directory called "fdata_vowel.mat." When you load that file in MATLAB, it will load in several variables into your workspace, each of which contains specific info about:

  • amplitude. "ampldata"
  • duration. "durdata"
  • pitch. "f0data"
  • formants. "fmtdata"
  • reaction time. "RTdata"
  • And lastly "trialinds," which is described later.

Each of these variables has a variable type of MATLAB struct, which means it contains one or more fields which themselves contain data. You can index into specific fields of a struct by doing struct.field. For example, f0data.hz looks at the field named "hz" in the struct "f0data".

In this document, I'm going to write as if you care about pitch (f0), so I'll be describing things related to the f0data variable. For SMNG folks, I'm using the experiment varModMEG as my example.

The fields in f0data will be 'hz' or 'mels', two ways of measuring pitch. Under 'hz' and 'mels' are fields correspond to the vowels that were included in different trials in the experiment. For example if the experiment had the stimulus words "ease" "add" and "odd", the field names will be the ARPABET transcriptions "iy", "ae" and "aa". Once you go into the "iy" field, all the sub-fields and data within that will only be related to trials where the participant said "ease".

Under f0data.hz.iy, there are fields for
  • traces. This is a 2d matrix where each column represents one trial (there were 270 trials with the 'iy' vowel), and the row represents the f0 value over time. So if you look at column 1 (trial 1), that's all the f0 data for that trial over time.
  • first 50ms. This is data related to the first 50 milliseconds of the vowel. (Since we're using dataVals as our source, we've already selected a specific portion of the trial which we consider the "vowel" portion of the trial.
  • mid50ms. The middle 50 milliseconds of the vowel.
  • mid50p. Data related to the middle 50% of the vowel, ie, the 25-75% window. Since people speak for a different duration on different trials, the length of each vowel will be different for these "relative" readings.
Within each of the above fields, there are many more subfields. Some are self-explanatory.
  • rawavg. Raw average of the f0 values within the specified period. So if you're in f0data.hz.iy.first50ms.rawavg.f0, and you look at column 1 which has a value of 258.3489, it's saying that the average F0 during the first 50ms of the first "iy" trial is 258.
  • med. Median.
  • center50, periph50, center 33, etc. These are trial numbers for the "center" and "peripheral" trials. These are basically the "iy" trials that are closest to the overall average of all 'iy' trials, or the trials that are furthest from the average.

Trial numbers, tokens, and indices

One thing to note is that the tenth "iy" trial is NOT trial #10 of the experiment. It is the tenth trial where the vowel was "iy". (To clarify this distinction, we sometimes use the term "token" or "token number" to refer to the overall trial number. So the 10th overall trial for the experiment is "token number 10." In an experiment with three equally-occurring vowels, the 10th 'iy' trial will probably be around token 30.)

In our experiments, during the data cleaning process, some trials get marked as "bad" if, for example, the participant flubs the word or doesn't talk at all. These trials will NOT appear in fdata at all. Therefore, even though there are a maximum of 270 trials of 'iy', 'ae', and 'aa' for each visit, if any trials are marked as bad, there will be fewer than 270 trials in fdata. If you want to know, "what is the real token number of the 10th 'iy' vowel?" you need to look at the variable trialinds that's included when you load in the fdata_vowel.mat file. In trialinds ("trial indices"), the 10th element of trialinds.iy trialinds.iy(10) will give you the true token number.



Keywords:
fdata, data, expt 
Doc ID:
121672
Owned by:
Anneke S. in SMNG Lab Manual
Created:
2022-10-04
Updated:
2026-09-09
Sites:
Speech Motor Neuroscience Group