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.
Tip
To toggle the label viewer, click the Display tab and select Label Viewer in the Views section.
Visualize Signal Spectra and Spectrograms
Spectrum View
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.
Signal Labeler computes spectra using the same steps as Signal Analyzer. For more information, see Spectrum Computation in Signal Analyzer.
Note
When displaying a spectrum, Signal Labeler converts the power to dB using 10 log10(Power).
Spectrogram View
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.
For more information on how Signal Labeler computes spectrograms, see Spectrogram Computation in Signal Labeler.
Tip
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.
Settings
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.
To change the frequency scale, select
Linear
orLog
in the Frequency Scale list. The app does not support a logarithmic scale when a complex-valued signal is plotted.By default, the app displays the spectrum or spectrogram in decibels. To toggle between decibels and linear scale, select or deselect the Spectrum in dB check box.
To plot spectrograms, Signal Labeler uses a color bar with the default MATLAB® colormap. The color bar comprises the full power range of the spectrogram and does not change if you zoom or pan.
You can change the magnitude levels represented by a given color range. On the Spectrogram tab, change the minimum and maximum power values to display.
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 Members 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.
Tip
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 Workspace
in the Members list, and select thes
variable in the dialog box that appears.Set the time information. Select
Time
from the Working in drop-down list, selectSample Rate
, and specify the sample rate as1.4
kHz
.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.
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 asROI
, and Data Type aslogical
.Click OK.
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 120
ms
and an Overlap of 99%
.
The locations of the atoms are visible in the spectrogram.
Label the atoms:
On the Labeler tab, select the label definition in the Label Definitions browser.
Specify the label value as
true
in 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.
See Also
Apps
Functions
Related Examples
- 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
More About
- Use Signal Labeler App
- Import Data into Signal Labeler
- Create or Import Signal Label Definitions
- Label Signals Interactively or Automatically
- Custom Labeling Functions
- Spectrogram Computation in Signal Labeler
- Feature Extraction Using Signal Labeler
- Dashboard
- Export Labeled Signal Sets and Signal Label Definitions
- Signal Labeler Usage Tips