Main Content

Use Signal Labeler App

App Workflow

A typical workflow for labeling signals using the Signal Labeler app is:

  1. Import Data into Signal Labeler — Select any real or complex signal available in the MATLAB® Workspace. The app accepts numeric arrays, MATLAB timetables, and labeledSignalSet objects. Read data from files or use signalDatastore objects as input. With an Audio Toolbox™ license you can Import and Play Audio File Data in Signal Labeler and read labeled signal sets from audioDatastore (Audio Toolbox) objects.

  2. Create or Import Signal Label Definitions — Define labels quickly and consistently to annotate attributes, regions, or points of interest of signals or to annotate spectrogram time-frequency regions of interest. Use logical, categorical, numerical, or string values. You can also import signal label definitions stored in MAT files.

  3. Label Signals Interactively or Automatically — Label signals interactively. Automatically label signal peaks or use your own Custom Labeling Functions. Label several signals at once or use the autolabeling mode of the app to inspect labeling results before committing them.

  4. Customize Labeling View — Use spectrum and spectrogram to aid labeling in time domain and use time to aid labeling in time-frequency domain. Show or hide the label viewer. For more information about how Signal Labeler computes spectrograms, see Spectrogram Computation in Signal Labeler.

  5. Dashboard — Monitor labeling progress and inspect label value distributions.

  6. Export Data and Create Data Sets — Save your labeling by exporting the labeled signal set and label definitions to the MATLAB Workspace or to MAT files. When labeling is complete, create data set files for training.

Example: Automatically Label Signal Points and Regions of Interest

Define a vector with two acute peaks and one flat peak. Use Signal Labeler to label the peaks and a region of interest below a certain threshold.

data = [25 8 15 5 6 10 10 3 1 20 7];

Open Signal Labeler. Import the data vector. On the Labeler tab, click Import, select From Workspace in the Members list, select the data signal in the dialog box that appears, and click Import and Close. Select the check box next to the signal name in the Labeled Signal Set Members browser to display the signal in the time plot.

Label the signal peaks. Start by creating a signal label definition. Click Add Label Definition. In the dialog box, specify Label Name as Peak, Label Type as Point, and Data Type as numeric.

With the Peak definition highlighted in the Label Definitions browser, select Peak Labeler in the Automate Value gallery. Click Auto-Label and select Auto-Label All Signals. Click OK in the dialog box that appears. Signal Labeler labels the three peaks and annotates their locations.

Signal Labeler showing a signal with three labeled peaks.

Create another label for regions below a certain threshold. Click Add Label Definition. In the dialog box, specify Label Name as BelowThreshold, Label Type as ROI, and Data Type as logical.

With the BelowThreshold definition highlighted in the Label Definitions browser, select Threshold Labeler in the Automate Value gallery. Click Auto-Label and select Auto-Label All Signals. Set the Threshold to 5, Relationship to Below, and Interval Type to Open, then click OK.

Signal Labeler showing the signal with three labeled peaks and one thresholded region-of-interest label.

Export the labeled signal. Click Export and select Labeled Signal Set To File. Name the file peaks.mat. Click Export.

Inspect the labeled signal set you created. Load peaks.mat into the MATLAB® Workspace. The labeledSignalSet object is called ls. Verify that the data source is the vector you created at the beginning. Inspect the signal label definitions.

load peaks
src = getSignal(ls,1)'
src = 1×11

    25     8    15     5     6    10    10     3     1    20     7

lbl = getLabelDefinitions(ls);
lbl(1)
ans = 
  signalLabelDefinition with properties:

                      Name: "Peak"
                 LabelType: "point"
             LabelDataType: "numeric"
        ValidationFunction: []
    PointLocationsDataType: "double"
              DefaultValue: []
                 Sublabels: [0×0 signalLabelDefinition]
                       Tag: ""
               Description: ""

 Use labeledSignalSet to create a labeled signal set.

lbl(2)
ans = 
  signalLabelDefinition with properties:

                  Name: "BelowThreshold"
             LabelType: "roi"
         LabelDataType: "logical"
    ValidationFunction: []
     ROILimitsDataType: "double"
          DefaultValue: []
             Sublabels: [0×0 signalLabelDefinition]
                   Tag: ""
           Description: ""

 Use labeledSignalSet to create a labeled signal set.

See Also

Apps

Functions

Topics