Main Content

Label Signals Interactively or Automatically

You can label signals with the Signal Labeler app in four different ways:

Fast Navigation Mode

To quickly navigate through channels or label members, click Fast Navigation in the Browser section of the toolstrip. Choose the channel that you want to plot in the Signal Selection section. The Signal Selector option is available when Plot Selected is active. In the dialog box, select the check box next to the channels you want to plot in each member. Select Plot Previous or Plot Next in the Browser section to navigate through members.

Note

The Signal Selection window displays only as many channels as present in the member with the smallest number of channels.

To apply a label to plotted signals in Fast Navigation mode, proceed as described in Interactive Manual Labeling.

Label Signals Manually

Bulk Manual Labeling

Sometimes an attribute applies to several signals, or an event occurs at the same time for several signals in your data set. To label a set of signals quickly, first select the label definition you want to apply in 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 All in the Set Value section. 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 region-of-interest (ROI) labels, specify the region endpoints using the Location (Min) and Location (Max) fields.

  • For point labels, specify the point location using the Location field.

Bulk manual labeling dialog box

This action is equivalent to using setLabelValue at the command line.

Note

Bulk manual labeling is not supported for sublabels.

Interactive Manual Labeling

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 in the Label Definitions browser. Draw Labels is automatically activated when a signal and an ROI or point label are selected. Specify the label value in the Set Value section of the Labeler tab, or assign the value after the label is drawn. Click the time plot to add the label:

  • For ROI labels, a thick animated dashed line appears that expands into a shaded region when you click and drag. (The animated frame indicates that the region is active.) Move and resize the active region until it encloses the ROI.

  • 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. The app automatically accepts a label when the next label is drawn. A label is added to all channels within a member.

Tip

To improve 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.

Edit Labels

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, double-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 and in the spectrogram. Click the label in the time plot, spectrogram, or label viewer to make it active. You can then edit its value and location. To accept the changes, click the Accept check mark next to the Label button, press Enter, or double-click.

Label viewer

This action is equivalent to using setLabelValue at the command line.

Note

  • 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.

Label Signals Automatically

Bulk Autolabeling

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 by 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.

For examples of autolabeling functions, see Custom Labeling Functions.

Bulk autolabeling dialog box

Note

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 Learning Network and Label Spoken Words in Audio Signals Using External API.

Autolabeling Mode

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.

Autolabeling mode

When in the autolabeling mode, you can run the selected function on the whole signal or run it within a time range of your choice.

Tip

The Run Time Limits section of the Autolabel tab shows the time range used by the autolabeling function and defaults to the entire signal. The range values change if you zoom in or specify values before running the autolabeling function. To reset the range to the entire 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. 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.

Note

For easier label inspection, the autolabeling mode displays only the labels generated during the current function call.

Label Signal Peaks Automatically Using Peak Labeler

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.

Note

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.

Peak Finder dialog box

Note

You can undo the last automated peak labeling action. 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. Peak Labeler by default labels 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 entire 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:

    1. Chooses the most prominent peak in the signal and ignores all peaks within the specified distance.

    2. Repeats the procedure for the most prominent remaining peak.

    3. Iterates until it runs out of peaks to consider.

Tip

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:

  1. Read the new value on the data cursor you used to move the point label.

  2. Edit the label.

  3. 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.

See Also

Apps

Functions

Related Examples

More About