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 six 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.
Time-Frequency ROI labels define spectrogram characteristics over regions of interest that have start and end points for both time and frequency.
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 Feature Extractor generates attribute feature labels and ROI feature labels automatically when you extract features. For more information, see Feature Extraction Using Signal Feature Extractor.
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
,Point
, orTime-Frequency ROI
.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.Time-Frequency Transform: Spectrogram — This section appears if you specify Label Type as
Time-Frequency ROI
. Use this section to specify options for the spectrogram used for time-frequency labeling.
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.
Specify Spectrogram Options for Time-Frequency ROI Label Definitions
When you create a time-frequency ROI label definition, you must specify options
for Signal Labeler to compute the spectrogram from which to label.
Signal Labeler uses default options. To change spectrogram options,
select the Time-Frequency ROI
dropdown item under
Label Type, then click Options under
Time-frequency Transform.
There are three ways in which you can divide a signal into segments for spectrogram computation: by controlling leakage, by controlling resolution bandwidth, or by controlling window length. For more information, see Spectrogram Computation in Signal Labeler. This table lists the parameters that you can specify depending on the method you choose.
Options | Specifications |
---|---|
Resolution Type | Resolution Type — Spectrogram resolution type, returned as one of these:
|
Leakage Parameters | Leakage — Spectral leakage, specified as a nonnegative scalar less than or equal to 40. Time Resolution — Mode to set the time resolution in the spectrogram computation, specified as one of these:
Resolution — Time resolution of the spectrogram, in samples, specified as a positive scalar. Overlap (%) — Percentage of overlapped samples between adjoining segments, specified as a nonnegative scalar less than 100. Reassign — Option to reassign spectrogram values. If you enable this option, Signal Labeler sets the spectrogram computation to sharpen the localization of spectral estimates by performing time and frequency reassignment. The reassignment technique produces periodograms and spectrograms that are easier to read and interpret. This technique reassigns each spectral estimate to the center of energy of its bin instead of the bin's geometric center. The technique provides exact localization for chirps and impulses. |
RBW Parameters | RBW — Mode to set the resolution bandwidth in the spectrogram computation, specified as one of these:
Window —
Window, specified as
Sidelobe Attenuation (dB) — Sidelobe attenuation of Chebyshev or Kaiser window, specified in decibels as a scalar greater than or equal to 20 (Chebyshev window) or 45 (Kaiser window). Overlap (%) — Percentage of overlapped samples between adjoining segments, specified as a nonnegative scalar less than 100. |
Window Length Parameters | Window Length — Mode to set the window length in the spectrogram computation, specified as one of these:
Window —
Window, specified as
Sidelobe Attenuation (dB) — Sidelobe attenuation of Chebyshev or Kaiser window, specified in decibels as a scalar greater than or equal to 20 (Chebyshev window) or 45 (Kaiser window). Overlap (%) — Percentage of overlapped samples between adjoining segments, specified as a nonnegative scalar less than 100. NFFT — Mode to set the number of discrete Fourier transform (DFT) points in the spectrogram computation, specified as one of these:
|
Power Parameters | Minimum Power Limit (dB) — Mode to set the minimum power threshold of the spectrogram, specified as one of these:
Spectrum in dB — Option to use decibels in the spectrogram's magnitude. If disabled, Signal Labeler sets the option to use one of these time-frequency representations:
|
Once you create a time-frequency ROI label definition with spectrogram options, Signal Labeler locks the specified spectrogram options for time-frequency labeling. You will not be able to draw labels while spectrogram options are unlocked.
To unlock the spectrogram options for further modification before labeling, edit the label definition or unlock the spectrogram display settings.
To modify the spectrogram options by editing the label definition, select the time-frequency ROI label definition, click the Edit button in the Label Definition section under the Labeler tab or right-click the label definition and select
Edit
, click on the lock icon under Time-frequency Transform, and click Options.To modify the spectrogram options by unlocking the spectrogram display settings, toggle the Spectrogram button in the Display tab, and click the lock icon under the Spectrogram tab.
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. Time-frequency ROI label definitions do not support 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.
Time-Frequency Transform: Spectrogram — This section appears if you specify Label Type as
Time-Frequency ROI
. Use this section to specify options for the spectrogram used for time-frequency labeling. If you already specified spectrogram options, the options can show as locked. You can unlock and edit the options, but note that editing the options can make existing time-frequency labels incompatible.
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
Topics
- 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
- 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
- Dashboard
- Export Data and Create Data Sets
- Signal Labeler Usage Tips