Main Content

Customize Labeling View

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.

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.

Note

You can plot the spectrogram of only one signal per display.

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.

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 signal using the spectrogram view, select the check box next to the signal name 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 the dialog box.

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

The oscillating chirp dominates the signal and obscures the atoms in the time plot.

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.

Label the atoms:

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

  2. Specify the label value as true in the Set 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.

See Also

Apps

Functions

Related Examples

More About