Create or Import Signal Label Definitions
In Signal Labeler, you can import already existing signalLabelDefinition
objects stored in MAT-files, or you can add signal label definitions to your labeledSignalSet
directly in the app.
Use signal label definitions to define labels for signals. Labels can be of five types:
Attribute labels define characteristics of the signal as a whole.
Region-of-interest (ROI) labels define signal characteristics over regions of interest that have start and end times.
Point labels define signal characteristics at one point of interest in time.
Feature Attribute labels define characteristics of the signal as a whole that correspond to features.
Feature ROI labels define signal characteristics over regions of interest that correspond to features.
Note
Signal Labeler generates attribute feature labels and ROI feature labels automatically when you extract features. For more information, see Feature Extraction Using Signal Labeler.
Each label can have one of four data types:
Logical labels can be either
true
orfalse
.Categorical labels can belong to any one of a set of categories that you specify.
Numeric labels can have any numeric value.
String labels can have any value represented by a string.
Example: Create a definition to label a signal with its mean RMS value as a numeric attribute.
At the command line, the code
creates a file,lblRMS = signalLabelDefinition("MeanRMSattr", ... 'LabelType','attribute','LabelDataType','numeric'); save('MeanRMSdef','lblRMS')
MeanRMSdef.mat
, that you can load into Signal Labeler to import a label definition calledMeanRMSattr
.In Signal Labeler, click Add Definition on the Labeler tab and select
Add label definition
. In the dialog box, specify Label Name asMeanRMS
, Label Type asAttribute
, and Data Type asnumeric
.
Example: Create a definition to label the zero crossings
of a signal as "rising"
for positive-going transitions and
"falling"
for negative-going transitions.
At the command line, the code
creates a file,ldf = signalLabelDefinition("Crosses",'LabelType','point', ... 'LabelDataType','categorical','Categories',["rising","falling"]); save('CrossDef','ldf')
CrossDef.mat
, that you can load into Signal Labeler to import a label definition calledCrosses
.In Signal Labeler, click Add Definition on the Labeler tab and select
Add label definition
. In the dialog box, specify Label Name ascrossings
, Label Type asPoint
, Data Type ascategorical
, and categories asrising
andfalling
, with each category on a new line.
Import Signal Label Definitions
To import existing signal label definitions, click Import on the
Labeler tab and select Label
Definitions
From file
. In the dialog box, specify the name of the
MAT-file that contains the label definitions you want to import. The MAT-file must
contain only one vector of signalLabelDefinition
objects.
Create Label Definitions
To add a signal label definition to your labeled signal set, click Add
Definition on the Labeler tab and select
Add label definition
. In the dialog box, specify the
following fields:
Label Name — Specify the name in the text box.
Label Type — Select one of
Attribute
,ROI
, orPoint
.Label Description (optional) — Specify the description in the text box.
Data Type — Select one of
string
,numeric
,logical
(the default), orcategorical
.Categories — This field appears if you specify Data Type as
categorical
. Enter each category on a new line.Default (optional) — Specify a default value for the signal label. For
logical
labels, select eithertrue
orfalse
. Forcategorical
labels, select any of the categories you specified.
This action is equivalent to using addLabelDefinitions
at the command line.
Note
If you want to reuse the signal label definitions that you created during a Signal Labeler session, you must export the definitions to a MAT-file and import them in a subsequent session.
Create Sublabel Definitions
To add a sublabel definition, select the definition in the Label
Definitions browser, click Add Definition on the
Labeler tab, and select Add sublabel
definition
. The top of the dialog box shows, as Parent
Name, the name of the label to which you are adding the sublabel.
This action is equivalent to using addLabelDefinitions
at the command line.
Note
A label can have any number of sublabels. Sublabels themselves cannot have sublabels.
Edit Label or Sublabel Definitions
To edit a label or sublabel definition, select the definition in the Label Definitions browser and click the Edit button. In the dialog box, specify the following fields:
Label Name — Specify the value in the text box.
Label Description — Specify the value in the text box.
Categories — This field appears if you specify Data Type as
categorical
. You can add categories, but you cannot remove any existing categories. Enter each new category on a new line.Default — Specify a default value for the signal label. For
logical
labels, select eithertrue
orfalse
. Forcategorical
labels, select any of the categories you specified.Editing the default value does not affect existing labels. The new default value applies only to new members, new regions, or new points.
You cannot modify the Label Type or Data Type fields. To change the label type or the data type of a label definition, remove the definition and add a definition with the desired properties.
This action is equivalent to using editLabelDefinition
at the command line.
Delete Label or Sublabel Definitions
To delete a label or sublabel definition, select the definition in the Label Definitions browser and click the Delete button on the toolstrip.
This action is equivalent to using removeLabelDefinition
at the command line.
See Also
Apps
Objects
Related Examples
- Label Signal Attributes, Regions of Interest, and Points
- Label ECG Signals and Track Progress
- Examine Labeled Signal Set
- Automate Signal Labeling with Custom Functions
- Label Spoken Words in Audio Signals
More About
- Use Signal Labeler App
- Import Data into Signal Labeler
- Label Signals Interactively or Automatically
- Custom Labeling Functions
- Customize Labeling View
- Spectrogram Computation in Signal Labeler
- Feature Extraction Using Signal Labeler
- Dashboard
- Export Labeled Signal Sets and Signal Label Definitions
- Signal Labeler Usage Tips