Customize Labeling View
In Signal Labeler you can use the spectrum or spectrogram view to inspect signals. You can also use the time-frequency view to aid labeling.
To toggle the label viewer, click the Display tab and select Label Viewer in the Views section.
Visualize Signal Spectra and Spectrograms
To activate the frequency-domain view of a signal, click the Display tab and select Spectrum in the Views section. The app displays a set of axes with the signal power spectrum and a Spectrum tab with options to control the view.
Signal Labeler scales the spectrum so that, if the frequency content of a signal falls exactly within a bin, its amplitude in that bin is the true average power of the signal. For example, the average power of a sinusoid is one-half the square of the sinusoid amplitude. For more details, see Measure Power of Deterministic Periodic Signals.
When displaying a spectrum, Signal Labeler converts the power to dB using 10 log10(Power).
To activate the time-frequency view of a signal, click the Display tab and select Spectrogram in the Views section. The app displays a set of axes with the signal spectrogram and a Spectrogram tab with options to control the view. You can plot the spectrogram of only one signal per display.
To apply reassignment to a spectrogram, check Reassign in the Spectrogram tab. The reassignment technique sharpens the time and frequency localization of spectrograms by reassigning each power spectrum estimate to the location of its center of energy. If your signal contains well-localized temporal or spectral components, then this option generates a spectrogram that is easier to read and interpret.
Use the spectrogram view of one of the signals in a multichannel member to better label the member with a region of interest seen more clearly in the time-frequency domain.
If the panner is activated and is zoomed in on a particular region of interest (ROI), the display corresponds to the region of interest, not the entire signal.
If you zoom in on a region of the signal in the time plot using one of the zoom actions on the Display tab, the display corresponds to the region of interest, not the entire signal.
You cannot zoom out in frequency beyond the Nyquist range.
If a signal is nonuniformly sampled, then Signal Labeler interpolates the signal to a uniform grid to compute spectral estimates. The app uses linear interpolation and assumes a sample time equal to the median of the differences between adjacent time points. For a nonuniformly sampled signal to be supported, the median time interval and the mean time interval must obey
Use Spectrogram to Aid Labeling
To label a member using the spectrogram view, select the check box next to the signal you want to plot in the Labeled Signal Set Browser and activate the spectrogram view. Select the label definition you want to apply on the Label Definitions browser. Draw Labels is automatically activated when the label definition is an ROI or a point. Specify the label value in the Set Value section of the Labeler tab, or assign the value after the label is drawn. Click on the spectrogram to add the label:
For ROI labels, click and drag the animated dashed line to create a shaded region. Move and resize the active region until it encloses the region of interest.
For point labels, move the animated dashed line until it crosses the signal at the point of your choice.
To accept a label, click the Accept check mark in the Options section, press Enter, or double-click the active region or line. A label is automatically accepted when a subsequent label is drawn.
The time-frequency view can be used to identify and label transient narrowband signals embedded in broadband signals. For more information, see Find Interference Using Persistence Spectrum.
Example: Label a Signal in Spectrogram View
Generate a signal composed of a voltage-controlled oscillator and four Gaussian atoms. The signal is sampled at 1.4 kHz. Use Spectrogram in Signal Labeler to label the Gaussian atoms in the signal.
fs = 1400; t = (0:1/fs:2)'; gaussFun = @(A,x,mu,f) exp(-(x-mu).^2/(2*0.01^2)).*sin(2*pi*f.*x)*A'; s = gaussFun([1 1 1 1],t,[0.2 0.5 1 1.75],[2 6 2 5]*100)/10; x = vco(chirp(t+.1,0,t(end),3).*exp(-2*(t-1).^2),[0.1 0.4]*fs,fs); s = s/10+x;
Open Signal Labeler and import the signal:
On the Labeler tab, click Import, select
From Workspacein the Members list, and select the
svariable in the dialog box that appears.
Set the time information. Select
Timefrom the Working in drop-down list, select
Sample Rate, and specify the sample rate as
Click Import and close the dialog box.
Select the check box next to the signal name in the Labeled Signal Set Browser to display the signal in the time plot.
Click the Value column to change the color of the signal.
The oscillating chirp dominates the signal and obscures the atoms in the time plot.
Create a signal label definition:
Click Add Definition and select
Add label definition.
In the dialog box, specify Label Name as
Atoms, Label Type as
ROI, and Data Type as
On the Display tab, click
Spectrogram in the Views section to activate the spectrogram view of the signal. Adjust the spectrogram settings in the Spectrogram tab. In the Time Resolution section, Specify a Resolution of
ms and an Overlap of
The locations of the atoms are visible in the spectrogram.
Label the atoms:
In the Labeler tab, select the label definition in the Label Definitions browser.
Specify the label value as
truein the Set Label Value section.
Click the spectrogram plot to draw the label. Click and drag the animated dashed line to create a shaded region. Move and resize the active region until it encloses the first atom.
Click the spectrogram plot again to draw the label for a different atom. The app automatically accepts the previous label.
Repeat the procedure to label the other two atoms.
- 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