You can label signals with the Signal Labeler app in four different ways:
Bulk Manual Labeling — Apply a label to one or more signals by specifying its value and, when necessary, its location.
Interactive Manual Labeling — Plot one or more signals from the Labeled Signal Set browser and interactively apply a label only to the plotted signals.
Bulk Autolabeling — Automatically apply labels to one or more signals using Peak Labeler or Custom Labeling Functions.
Autolabeling Mode — Plot one or more signals from the Labeled Signal Set browser and automatically label them using Peak Labeler or Custom Labeling Functions. Inspect the labeling, debug the autolabeling function, modify parameters, edit labels, and save the labeling when it is satisfactory.
Sometimes an attribute applies to several signals, or an event occurs at the same time
for several signals in your dataset. To label a set of signals quickly, first select the
label definition you want to apply on the Label Definitions browser.
On the Labeler tab, in the Set Value section,
specify the value that you want to assign to the label. Click Label
▼ and select Label Signals
. In the dialog box:
Specify the signals you want to label by selecting the check boxes next to their names.
Edit the label value if necessary.
For ROI labels, specify the region endpoints using the Location fields.
For point labels, specify the point location using the Location field.
This action is equivalent to using setLabelValue
at the command line.
Bulk manual labeling is not supported for sublabels.
To label one or more signals interactively, first choose the signals that you want to
plot by selecting the check boxes next to their names in the Labeled Signal
Set browser. Select the label definition you want to apply on the
Label Definitions browser. On the Labeler tab,
in the Set Value section, specify the value that you want to assign
to the label. Click Label ▼ and select Label
Plotted
.
For ROI labels, a shaded region appears, framed by an animated dashed line. (The animated frame indicates that the region is active.) Move and resize the active region until it encloses the region you want.
For point labels, an animated dashed (active) line appears for the point being labeled. Move the active line until it crosses the signal at the point of your choice.
To accept a label, click the Accept check mark next to the Label button, press Enter, or double-click the active region or line.
For better label placement, you can go to the Display tab and choose a zoom action or activate the panner.
For an example of interactive manual labeling, see Label Signal Attributes, Regions of Interest, and Points.
To edit an existing signal label, you can do any of these:
In the Labeled Signal Set browser, select the label, right-click, and select Edit. Input the new values in the dialog box.
To edit an attribute label, click in a cell of the label viewer attribute table.
To edit an ROI or point label, select the label in the Labeled Signal Set browser, the time plot, or the label viewer. The chosen label is highlighted in all three regions. Click the label in the time plot or the label viewer to make it active. You can then edit its value and location on the time plot or on the label viewer. To accept the changes, click the Accept check mark next to the Label button, press Enter, or double-click.
This action is equivalent to using setLabelValue
at the command line.
You must select a parent label before you can label an ROI or point sublabel manually.
To label an attribute sublabel manually, use the Labeled Signal Set browser or the label viewer.
To autolabel a set of signals using Peak Labeler or a custom
function, start by creating a signal label definition that you want to apply or selecting
one from the Label Definitions browser. The Automate
Value gallery shows the Custom Labeling Functions that you can use with
the definition. Choose a function from the gallery, click
Auto-Label ▼, and select Auto-Label
Signals
. Signal Labeler prompts you to select the members you
want to label and specify any optional input arguments to the labeling function.
See Custom Labeling Functions for examples of autolabeling functions.
You can undo the last automated custom labeling you performed. However, you lose this ability once you add, modify, or delete any labels or label definitions.
For examples of bulk autolabeling, see Label QRS Complexes and R Peaks of ECG Signals Using Deep Network and Label Spoken Words in Audio Signals Using External API.
To label one or more signals interactively, first choose the signals that you want to
plot by selecting the check boxes next to their names in the Labeled Signal
Set browser. Create a definition for the label you want to apply or select
one from the Label Definitions browser. The Automate
Value gallery shows the Custom Labeling Functions that you can use with
the definition. Choose a function from the gallery, click
Auto-Label ▼, and select Auto-Label and Inspect
Plotted
. This action takes you to the Signal Labeler
autolabeling mode.
When in the autolabeling mode, you can run the selected function on the whole signal or run it in a time range of your choice.
The Run Time Limits section of the Autolabel tab shows the time range used by the autolabeling function and defaults to the whole signal. The range values change if you zoom in or specify values before running the autolabeling function. To reset the range to the whole signal, press the spacebar or click the Fit to View button on the Display tab.
After running the function, you can inspect the labeling results. If the results are not satisfactory, you can undo the labeling action, modify the autolabeling function, and label the signal again. After a function run, you can edit label values and locations, either on the time plot or on the label viewer. You can also remove labels, but if you remove labels you lose the ability to undo the previous labeling action. When you are satisfied with the results, click Save Labels to save the labeling and exit the autolabeling mode.
For easier label inspection, the autolabeling mode displays only the labels generated during the current function call.
To autolabel signal peaks using Peak Labeler, start by selecting or
creating a numeric point label definition. In the Automate Value
gallery, select Peak Labeler and click
Auto-Label. You can label peaks in bulk or interactively.
Signal Labeler uses the MATLAB® functions islocalmax
and
islocalmin
to
find and label local maxima and minima. Peak Labeler returns the
location of each peak and the numeric value of its amplitude.
You can select multiple members for peak labeling, but you can label only one channel of each member at a time. By default, Signal Labeler chooses the first channel of each selected member, but you can select which signal of the member you want to use for labeling.
You can undo the last automated peak labeling you performed. However, you lose this ability once you add, modify, or delete any labels or label definitions.
You can choose to label all the peaks or valleys in the selected signal that satisfy the specified conditions. Alternatively, you can label a specific number of peaks or valleys that satisfy the specified conditions, sorted in order of descending prominence. See Prominence for more information about peak prominence. The default value is three peaks.
If a local maximum or minimum value is repeated consecutively, the peak or valley belongs to a flat region. For a signal with flat peak or valley regions, you can choose to label the center of the region, the first point of the region, the last point of the region, or all points in the region.
You can choose to label only those peaks or valleys with prominence larger than a specified value. You can also specify the width of the window centered on a peak or valley that is used to measure its prominence.
If you do not specify a window width, the Peak Labeler algorithm uses the whole signal as the window.
For a flat peak or valley region, the window is centered at the midpoint of the region.
You can select to label only those peaks separated by a specified distance. The Peak Labeler algorithm:
Chooses the most prominent peak in the signal and ignores all peaks within the specified distance.
Repeats the procedure for the most prominent remaining peak.
Iterates until it runs out of peaks to consider.
If you label peaks in a signal using Peak Labeler and then move one of the labels, Signal Labeler still shows the amplitude value returned by Peak Labeler. To update the amplitude:
Read the new value on the data cursor you used to move the point label.
Edit the label.
Enter the new value in the Value field of the dialog box that appears.
For an example that uses Peak Labeler, see Example: Label Points and Regions of Interest in Signal.