Load a labeled signal set containing recordings of whale songs.
load whales
lss
lss =
labeledSignalSet with properties:
Source: {2×1 cell}
NumMembers: 2
TimeInformation: "sampleRate"
SampleRate: 4000
Labels: [2×3 table]
Description: "Characterize wave song regions"
Use labelDefinitionsHierarchy to see a list of labels and sublabels.
Use setLabelValue to add data to the set.
Create a label definition that specifies whether a signal corresponds to a calf or to an adult whale.
calf = signalLabelDefinition("Calf", ...
LabeldataType="logical",DefaultValue=false, ...
Description="Is the specimen a calf, or an adult?")
calf =
signalLabelDefinition with properties:
Name: "Calf"
LabelType: "attribute"
LabelDataType: "logical"
ValidationFunction: []
DefaultValue: 0
Sublabels: [0×0 signalLabelDefinition]
Tag: ""
Description: "Is the specimen a calf, or an adult?"
Use labeledSignalSet to create a labeled signal set.
Add the definition to the labeled signal set. Retrieve the names of the labels.
addLabelDefinitions(lss,calf)
getLabelNames(lss)
ans = 4×1 string
"WhaleType"
"MoanRegions"
"TrillRegions"
"Calf"
Create a label definition that specifies the sex of the whale. Add the label to the set as a sublabel of 'WhaleType'.
Example: labeledSignalSet({randn(100,1)
randn(10,1)},signalLabelDefinition("female")) specifies a two-member set of random
signals containing the attribute "female".
Signal label definitions, specified as a signalLabelDefinition object or
a vector of signalLabelDefinition objects.
Example: signalLabelDefinition("Asleep",'LabelType','roi','LabelDataType','logical')
can label a region of a signal in which a patient is asleep.
Label name, specified as a character vector or a string scalar.
Example: signalLabelDefinition("Asleep",'LabelType','roi')
specifies a label of name "Asleep" for a region of a signal in which
a patient is asleep during a clinical trial.