Main Content

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 procedure as Signal Analyzer with the Resolution Type specified as Leakage. For more information, see Control Leakage.

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.

Signal Labeler computes spectrograms using the same steps as Signal Analyzer. For more information, see Spectrogram Computation in Signal Analyzer.

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

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

1100<Median time intervalMean time interval<100.

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.

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:

  1. On the Labeler tab, click Import, select From Workspace in the Members list, and select the s variable in the dialog box that appears.

  2. Set the time information. Select Time from the Working in drop-down list, select Sample Rate, and specify the sample rate as 1.4 kHz.

  3. Click Import and Close.

  4. Select the check box next to the signal name in the Labeled Signal Set Browser to display the signal in the time plot.

  5. 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.

signalLabeler_spectrogram1_22b.png

Create a signal label definition:

  1. Click Add Definition and select Add label definition.

  2. In the dialog box, specify Label Name as Atoms, Label Type as ROI, and Data Type as logical.

  3. 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.

signalLabeler_spectrogram2_22b.png

Label the atoms:

  1. On the Labeler tab, select the label definition in the Label Definitions browser.

  2. Specify the label value as true in the Set Label Value section.

  3. 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.

  4. Click the spectrogram plot again to draw the label for a different atom. The app automatically accepts the previous label.

  5. Repeat the procedure to label the other two atoms.

signalLabeler_spectrogram3_22b.png

See Also

Apps

Functions

Related Examples

More About