Main Content

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 or false.

  • 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

    lblRMS = signalLabelDefinition("MeanRMSattr", ...
    'LabelType','attribute','LabelDataType','numeric');
    save('MeanRMSdef','lblRMS')
    creates a file, MeanRMSdef.mat, that you can load into Signal Labeler to import a label definition called MeanRMSattr.

  • In Signal Labeler, click Add Definition on the Labeler tab and select Add label definition. In the dialog box, specify Label Name as MeanRMS, Label Type as Attribute, and Data Type as numeric.

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

    ldf = signalLabelDefinition("Crosses",'LabelType','point', ...
    'LabelDataType','categorical','Categories',["rising","falling"]);
    save('CrossDef','ldf')
    creates a file, CrossDef.mat, that you can load into Signal Labeler to import a label definition called Crosses.

  • In Signal Labeler, click Add Definition on the Labeler tab and select Add label definition. In the dialog box, specify Label Name as crossings, Label Type as Point, Data Type as categorical, and categories as rising and falling, 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, or Point.

  • Label Description (optional) — Specify the description in the text box.

  • Data Type — Select one of string, numeric, logical (the default), or categorical.

  • 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 either true or false. For categorical labels, select any of the categories you specified.

Add label definition dialog box

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 either true or false. For categorical 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

More About