Feature Extraction Using Signal Labeler
In Signal Labeler, you can extract features from all members of a labeled signal set including mean, standard deviation, peak, signal-to-noise ratio, mean frequency, band power, and occupied bandwidth. You can generate attribute or region-of-interest (ROI) feature labels from extracted features that can be used as predictors in machine learning models or to train a deep network.
After extraction, you can export features to the MATLAB® Workspace or to the Classification Learner app and save features as labels in your labeled signal set. For more information, see Export Features and Save Features as Labels.
The app does not support feature extraction from complex-valued signals or signals which have different sample rates.
Extract Signal Features
To enter the feature extraction mode, click Extract Features from the Dataset section of the toolstrip. Before extracting features, you must first select a member channel and define a frame policy to use for extraction. Then, you can choose to Extract Full-Signal Features or Extract Frame-Based Features.
By default, the app uses the first channel in each member to extract features. To specify a member channel for feature extraction, click Selected in the Channel Selection section and then click Channel Selector. Select a channel and click OK. The app includes the selected channel in the corresponding feature label names.
In the Frame Policy section, select Full-signal to use the full signal, or select Frame-based to use frame- or window-based regions of interest for feature extraction. Full-signal feature extraction requires no additional parameters. If you use frame-based regions of interest to extract features, you must specify these parameters.
Units — Units to specify frame options. If the imported members do not have time information, the app automatically sets units to samples.
Frame Size — Length of frame in time or samples.
Frame Overlap Length— Frame rate corresponds to the time (or number of samples) between the start of the previous frame and start of the current frame. Frame overlap length corresponds to the overlap between the end of the previous frame and the start of the current frame.
Drop incomplete framesor
Zero-pad and include incomplete frames— The last frame of a signal is incomplete if its length is less than the specified frame size. To exclude the incomplete frame when computing features, select
Drop incomplete frames. To zero-pad the incomplete frame and then include it when computing features, select
Zero-pad and include incomplete frames.
The app uses
signalFrequencyFeatureExtractor to extract time- and frequency-based
features from signals, respectively. Once you select a member channel and define a
frame policy, click the Time-Domain Features or the
Spectral Features button in the Feature
Generation gallery. Select from a list of features in the dialog box
that appears, and specify additional parameters based on your selection.
Signal Labeler does not support all features available in the feature extractor objects.
In the time domain, the app computes statistical, pulse metric, and harmonic features.
In the frequency domain, the app computes frequency, band power, and bandwidth features from Welch's power spectral density (PSD) estimate of the time-domain signal. To modify parameters for occupied bandwidth or power bandwidth, click the Parameters button next to each feature to view available options. You can also specify window type, window length, overlap length, and frequency range used to compute Welch's PSD estimate.
Extract Full-Signal Features
When you extract full-signal features, the app generates attribute feature labels from the extracted features. An attribute feature label describes a signal characteristic corresponding to an extracted feature.
To perform full-signal feature extraction, select Full-signal in the Frame Policy section. In the Feature Generation gallery, select Time-Domain Features or Spectral Features to open a dialog box with available features to extract. After selecting features, click Run. Extracted features appear in a table below the plot in the display. Attribute feature labels appear in the Feature Definitions browser and have a prefix that specifies the channel used to extract the corresponding feature.
Extract Frame-Based Features
When you extract frame-based features, the app generates ROI feature labels from the extracted features. An ROI feature label describes a signal characteristic over a region of interest corresponding to an extracted feature.
To perform frame-based feature extraction, select
Frame-based in the Frame Policy
section before generating features. You must also define a frame policy by
specifying units, frame size, frame overlap length or frame rate, and the rule to
handle an incomplete frame. In the Feature Generation gallery,
select Time-Domain Features or Spectral
Features to open a dialog box with available features to extract.
After selecting features, click Run. ROI feature labels
appear in the Feature Definitions browser and have a prefix
that specifies the channel used to extract the corresponding feature. These labels
also begin with
FP followed by a number that indicates the order
in which each ROI feature label was created.
As you generate features in this mode, you can export these features to the
MATLAB Workspace or to the Classification Learner (Statistics and Machine Learning Toolbox) app. To export any of the
features you generate along with all your labels and data, exit the mode and export the
labeled signal set using Export on the
Labeler tab. You can use the
createFeatureData function to create a table of features that you can
then import to Classification Learner.
Export to MATLAB Workspace
To export features to the MATLAB Workspace, select
Workspace from the
Export Features drop-down list. In the Export
Features to Workspace dialog box, select the response labels and
feature labels you want to export and then click Export.
Use ctrl+click to select multiple labels.
Before the app exports the selected labels, you must specify a name and format for the output. You can output the features as either a table or matrix, where each column corresponds to a feature label and each row corresponds to a member.
Export to Classification Learner App
To export features to the Classification Learner (Statistics and Machine Learning Toolbox) app, select
Classification Learner from the Export
Features drop-down list. Once you export the selected features, the
Classification Learner app opens automatically with the feature table
visible in the new session dialog box. In this workflow, Classification
Learner considers the features as predictors.
Save Features as Labels
To save generated features as labels for a labeled signal set and exit the feature extraction mode, click Save Labels. The app exits the feature extraction mode and the feature labels appear in the Label Definitions browser.
Edit Label Definition
To edit a feature label definition in this mode, select the definition in the Feature Definitions browser and click Edit. In the dialog box, you can edit:
Label Name — Specify a feature label name in the text box.
Label Description — Add, modify, or delete a description in the text box. This field is optional.
Default — Specify a default value in the text box. This field is optional.
You cannot modify the Label Type or Data Type fields.
Delete Label Definition
To delete a feature label definition in this mode, select the definition in the Feature Definitions browser and click Delete. To delete all feature label definitions, click the arrow next to the delete button and click Delete All.
- Signal Labeler | Classification Learner (Statistics and Machine Learning Toolbox)
- 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
- Import Data into Signal Labeler
- Import and Play Audio File Data in Signal Labeler
- Create or Import Signal Label Definitions
- Label Signals Interactively or Automatically
- Custom Labeling Functions
- Customize Labeling View
- Export Labeled Signal Sets and Signal Label Definitions
- Signal Labeler Usage Tips