Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Using Signal Analyzer App

The Signal Analyzer app is an interactive tool for visualizing, measuring, analyzing, and comparing signals in the time domain, in the frequency domain, and in the time-frequency domain. The app provides a way to work with many signals of varying durations at the same time and in the same view.

Start the app by choosing it from the Apps tab on the MATLAB® Toolstrip. You can also start the app by typing signalAnalyzer at the MATLAB command prompt.

A typical workflow for inspecting and comparing signals using the Signal Analyzer app is:

  1. Select Signals to Analyze — Select any signal available in the MATLAB workspace. The app accepts numeric arrays and signals with inherent time information, such as MATLAB timetables and timeseries objects. See Data Types Supported by Signal Analyzer for more information.

  2. Explore Signals — Add time information to signals using sample rates, numeric vectors, duration arrays, or MATLAB expressions. Plot, measure, and compare data, their spectra, or their spectrograms. Look for features and patterns in the time domain, in the frequency domain, and in the time-frequency domain. Compute persistence spectra to analyze sporadic signals and sharpen spectrogram estimates using reassignment. Extract regions of interest from signals.

  3. Share Analysis — Copy displays from the app to the clipboard as images. Export signals to the MATLAB workspace or save them to MAT-files. Generate MATLAB scripts to automate the computation of power spectrum, spectrogram, or persistence spectrum estimates and the extraction of regions of interest. Save Signal Analyzer sessions to resume your analysis later or in another machine.

Select Signals to Analyze

The Signal Analyzer app works with vectors, matrices, MATLAB timetables, or timeseries objects in the MATLAB workspace. When you start the app, all usable signals in the workspace appear in the Workspace browser at the bottom-left corner. See Data Types Supported by Signal Analyzer for more information.

Select Signals from the Workspace Browser

Select signals from the Workspace browser by clicking their names and dragging them to the Signal table at the top-left corner. To plot a signal, drag it to a display. If you select the check box next to the name of a signal in the Signal table, the signal is plotted in the selected display. You can also drag signals directly from the Workspace browser to a display. The dragged signals are plotted in the display and listed in the Signal table.

Each column of a matrix is treated as an independent signal. For example, a 100-by-3 matrix called sig appears in the Signal table as three 100-sample signals, sig(:,1), sig(:,2), and sig(:,3).

Note

If you attempt to import signals with more than 100 columns, the app displays a warning.

It is possible that the matrix you are trying to import is the transpose of a multichannel signal that you want to analyze. In that case, click No and transpose the matrix in the workspace. If you do want to import the columns as separate signals, click Yes. If you drag the matrix to a display and click Yes in the dialog box, then the app plots only the first 10 columns of the matrix but imports all the columns. To plot signal columns beyond the tenth, drag them to the display.

If you modify a signal in the MATLAB workspace, the Workspace browser updates automatically. To have the app recognize the changes, reimport the signal by dragging it again to the Signal table or to a display.

If you add or remove matrix columns, the app deletes the signals, clears any plots of them, and creates new signals with the modified matrix dimensions.

Filter Signals in the Signal Table

To help search through a large amount of data in the Signal table, you can filter signals. The filter criteria can be any text that is contained in the signal name or in other columns.

  • To show signals with a given name, enter the text you seek into the Filter Signals text box. The matches are highlighted in the filter results.

    Suppose you have three sig signals, sig01, sig02, and sig03, and three sgn signals, sgn01, sgn02, and sgn03. You can enter sg to show the three sgn signals, or enter 2 to show sig02 and sgn02.

  • You can also filter signals according to their time information. To access this functionality, click inside the search results box, and then click Advanced. For details on entering time information, see Edit Sample Rate and Other Time Information.

    Suppose that you have six signals with these sample times and start times:

    The Advanced menu lets you search signals by Name, Samples, Start Time, or Time in terms of sample rate or sample time.

    If you select the Time option and set it to 20, the app finds the four signals sampled at 200 Hz. In the second text box, if you select the Start Time option and enter 0, the app finds sgn01 and sig01.

    Note

    The filter matches values as text, not numbers. For instance, if you choose the Start Time option and enter 00, then the filter does not return any results.

  • You can save and store a filter for future use. From the Advanced menu of the search results box, click Quick Search Settings. Then enter a name in the Save Search As box, and click Save.

Explore Signals

You can use the Signal Analyzer app to perform several tasks that help you explore your data.

Plot Signals

Select a signal by clicking its name in the Workspace browser or the Signal table. Then plot your selection by dragging it to a display. This action also selects the check box to the left of the signal Name on the Signal table. You can also plot a signal by selecting this check box. The app displays a set of axes with the time-domain waveform and a Time tab with options to control the view.

If you drag a matrix from the Workspace browser to a display, the app automatically plots each column as a separate signal, up to a maximum of 10 columns. The app creates signals in the Signal table for the remaining columns, but you must drag the additional signals to the display.

Note

Signals with no time information are plotted in units of samples on the x-axis. Signals with time information are plotted in units of time on the x-axis. To plot several signals on the same display, ensure that they all have time information or are all in samples. Otherwise, you get a warning.

View Signals on Multiple Plots

Click Display Grid to create or remove displays.

Move Signals Between Displays

To move a signal from one display to another, click the plotted line or select its name on its Legend, for example, . Click the resulting thicker line and drag it to the target display.

Visualize Signal Spectra

Use the Signal Analyzer app to analyze signals in the frequency domain. To activate the frequency-domain view of a signal, click Spectrum ▼ on the Display tab and select Spectrum. The app displays a set of axes with the signal spectrum, and a Spectrum tab with options to control the view.

  • If the panner is activated and is zoomed in on a particular region of interest, the spectrum in the display corresponds to the region of interest, not the whole 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 spectrum in the display corresponds to the region of interest, not the whole signal.

  • To see a time plot and a spectrum plot of the same signal side-by-side, use different displays. Drag the signal to two displays. Click Time or Spectrum on the Display tab to control what is plotted on each display.

For more information on how Signal Analyzer computes spectra, see Spectrum Computation in Signal Analyzer.

If a signal is nonuniformly sampled, then Signal Analyzer 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.

Visualize Persistence Spectra

Use the Signal Analyzer app to visualize the persistence spectrum of a signal: The persistence spectrum contains time-dependent probabilities of occurrence of signals at given frequency locations and power levels. This type of spectrum is useful for detecting brief events.

To activate the persistence spectrum, click Spectrum ▼ on the Display tab and select Persistence Spectrum. The app displays a set of axes with the persistence spectrum, and a Persistence Spectrum tab with options to control the view.

Note

You can plot the persistence spectrum of only one signal per display.

For more information on how Signal Analyzer computes persistence spectra, see Persistence Spectrum in Signal Analyzer.

Visualize Signal Spectrograms

Use the Signal Analyzer app to analyze a signal in the time-frequency domain. To activate the time-frequency view of a signal, click Spectrogram on the Display tab. The app displays a set of axes with the signal spectrogram, and a Spectrogram tab with options to control the view.

Note

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

  • If the panner is activated and is zoomed in on a particular region of interest, the spectrogram in the display corresponds to the region of interest, not the whole 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 spectrogram in the display corresponds to the region of interest, not the whole signal.

  • To see a time plot and a spectrogram plot of the same signal side-by-side, use different displays. Drag the signal to two displays. Click Time or Spectrogram on the Display tab to control what is plotted on each display.

For more information on how Signal Analyzer computes spectrograms, see Spectrogram Computation in Signal Analyzer.

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. To apply reassignment to a spectrogram, check Reassign in the Spectrogram tab.

If a signal is nonuniformly sampled, then Signal Analyzer 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.

Zoom and Pan Through Signals

The Signal Analyzer app features a panner that enables you to zoom in on and navigate through signals to see how they change in frequency and time. To activate the panner, on the Display tab, click Panner .

The panner renders signals in their entire duration. To select a region of interest, click the panner and drag to create a zoom window. Use the mouse to resize or slide the zoom window along the length of the signal.

Edit Time Information and Link Displays in Time

Use the Signal Analyzer app to add time information to signals. In the Signal table, select the signals whose time information you want to add or modify. Add time information to the signals by clicking Time Values.

You can express the time information in terms of a sample rate or sample time, and a start time. You can also add explicit time values using a numeric vector, a duration array, or a MATLAB expression. Time values must be unique and cannot be NaN, but they need not be uniformly spaced. The app derives a sample rate from the time values and displays it in the Time column of the Signal table. See Edit Sample Rate and Other Time Information for more details.

  • If a signal is nonuniformly sampled, then Signal Analyzer 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. The derived sample rate in the Signal table has an asterisk to indicate that the signal is nonuniformly sampled. 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.

    Note

    The interpolation is used only to compute spectral estimates. Time plots are not resampled.

  • You can link display time spans so that plots respond in sync when you pan and zoom horizontally. The signals in the displays you want to link must contain time information. To link the time span of a display to those of the displays linked already, select the display and, on the Display tab, select Link Time. To unlink a display, select it and clear Link Time.

    Note

    Selecting Link Time links the selected display to the complete collection of displays that have already been linked.

    Displays with linked time spans have the following operations synchronized:

    • Panning by selecting and dragging the plot or by using the display panner.

    • Zooming in, zooming out, or zooming on the time axis. Zooming in or out on one display affects only the time axis in the remaining linked displays.

    • Fitting data to view. The app stretches the common time axis so that it shows the span from the earliest to the latest time among all signals in the linked displays.

    • If the axes of two displays are linked in time, then the time cursors in the displays are linked.

    The time axis of a linked display might update as you add or remove signals.

Note

Frequency axes are never linked between displays.

Measure Signal and Spectrum Data

Measure your data using data cursors:

  1. On the Display tab, click Data Cursors ▼ to add one or two data cursors to all the displays. Time-domain and frequency-domain cursors are not linked and can be moved independently.

  2. To move a data cursor, drag it left or right to a point of interest. To move the cursor sample-by-sample, click the time or frequency field and use the arrow keys.

  3. You can move a data cursor to a specific point without dragging it. Click the data cursor time or frequency field and enter a value.

    If the signal was not sampled at a point of interest, then the app linearly interpolates the value. If the value is interpolated, an asterisk appears in the data cursor label.

  4. To hide the cursors, click Data Cursors ▼ and select Hide.

Extract Signal Regions of Interest

The Signal Analyzer app enables you to extract regions of interest from the signals you are studying. To extract regions of interest, select the display that has them. On the Display tab, click Extract Signals, or right-click the display and select Extract Signals

  • Select Between Time Limits to extract a region of interest defined by the time limits of the selected display. To change the time limits, you can use the panner, select one of the zoom actions on the Display tab, or change the limit values on the Display, Time, or Spectrogram tabs.

  • Select Between Time Cursors to extract a region of interest defined by the locations of the time-domain cursors in the selected display.

  • If a signal has time information, you can preserve the start time of the region of interest by checking Preserve Start Time.

The extracted regions of interest are added at the bottom of the Signal table.

Share Analysis

Copy Displays

You can share the plots that you have produced using the Signal Analyzer app by copying one or more displays to the clipboard as images and pasting them into another application.

To copy displays to the clipboard, on the Display tab, click Copy All Displays ▼. You can then copy either the selected display or the complete display layout.

To copy a single display to the clipboard, you can also right-click the display and select Copy Display.

Export Signals

You can export any signals in the Signal Analyzer Signal table to the MATLAB workspace or to a MAT-file.

To export signals:

  1. Select one or more signals from the Signal table.

  2. On the Analyzer tab, click Export .

  3. Choose whether you want to export the selected signals to the MATLAB workspace or save them to a MAT-file. If you choose to save the signals, browse to where you want to save the file, name the file, and click Save.

You can also select the signals, right-click, and select Export.

Signals are exported differently, depending on their type:

  • Signals with no time information are exported or saved as numeric vectors.

  • Signals stored as timetables are exported or saved as timetables.

  • Signals that have time information but are not stored as timetables are exported or saved as numeric vectors. If you want to preserve the time information, you can save the signals as timetables. On the Analyzer tab, click Preferences and check Always use timetables when signals have time information.

Generate MATLAB Scripts

You can generate MATLAB scripts to extract signal regions of interest or automate the computation of power spectrum, persistence spectrum, or spectrogram estimates obtained with the Signal Analyzer app.

To generate a MATLAB script, on the Display tab, click Generate Script:

  • Select ROI Script Between Time Limits to generate a MATLAB script that extracts a region of interest defined by the time limits of the selected display. Depending on the preferences, the regions of interest are saved as numeric vectors or as a timetable.

  • Select ROI Script Between Time Cursors to generate a MATLAB script that extracts a region of interest defined by the locations of the time-domain cursors in the selected display. Depending on the preferences, the regions of interest are saved as numeric vectors or as a timetable.

  • Select Spectrum Script to generate a MATLAB script that computes the power spectrum appearing in the spectrum view of the selected display, including all current settings.

  • Select Persistence Spectrum Script to generate a MATLAB script that computes the persistence spectrum appearing in the spectrum view of the selected display, including all current settings.

  • Select Spectrogram Script to generate a MATLAB script that computes the spectrogram appearing in the spectrogram view of the selected display, including all current settings.

The generated scripts open in the Editor.

Save and Load Signal Analyzer Sessions

If you want to share session snapshots or archive them to view later, save the Signal Analyzer session to a MAT-file or MLDATX-file. Using MLDATX-files results in faster save and load times.

To save a session to a MAT-File or MLDATX-File:

  1. On the Analyzer tab, click Save ▼ and select Save.

  2. Browse to where you want to save the file, name the file, choose the format, and click Save.

If you want to update the file, click Save. If you want to save the session to a different file, click Save ▼ and select Save as.

To load a saved session:

  1. On the Analyzer tab, click Open.

  2. Browse to the MAT-file or MLDATX-file saved from a previous session, select it, and click Open. The signal data and properties appear as they were when the file was last saved.

To start a new session, on the Analyzer tab, click New.

Customize Signal Analyzer

Specify Line Color and Style

To specify the line style and color, click in the Line column of a signal. If the line column is not shown, add the column using the column selector button . Select a color from the palette and a line style. Click Custom to choose custom colors for your signals. You can specify custom colors as RGB triplets or as hexadecimal codes.

Add or Remove Columns in the Signal Table

Columns in the Signal table display the plot configuration and signal properties. To add or remove a column, click the column selector button . From the list, select the columns that you want to display and click OK. After you select a column, the new column is added to the table in the order that it appears in the column selection list.

Modify Signal Analyzer Displays

GoalAction
Hide the Workspace browser or the Signal table to enlarge the display area.

On the Analyzer tab, click one of the layout buttons.

Zoom and pan to inspect the data.

On the Display tab, select one of the zoom actions.

Alternatively, activate the panner by clicking Panner .

Fit spectrogram or persistence spectrum colormap to current power or density limits.

On the Display tab, click the Fit Colormap button .

Set the minimum and maximum values of the plot axes.

On the Time, Spectrum, or Spectrogram tab, enter the axes limit values. You can also change the minimum and maximum time values on the Display tab.

When setting axes for a display, you can specify time or frequency units before specifying limit values. Several engineering units are available:

QuantityUnits
Timeps, ns, μs, ms, seconds, minutes, hours, days, years
Frequencycycles/year, cycles/day, cycles/hour, cycles/minute, mHz, Hz, kHz, MHz, GHz, THz

Note

Selecting different time or frequency units for axes limit values does not change any plots.

Show or hide legends identifying plotted signals.

On the Display tab, click Legend .

Each display gets its own legend. The legends appear either at the top of the display or to the right of the display.

Link or unlink a display.

Select a display. On the Display tab, select Link Time. Link Time is enabled only when there are two or more displays and at least one signal contains time information.

To unlink a display, select it and clear Link Time.

Frequency axes are never linked between displays.

Normalize the data for each signal from 0 to 1 along the y-axis of a time plot.

On the Time tab, select Normalize Y Axis.

Show markers at each sample point in a time plot of a signal.On the Time tab, select Show Markers.

Signal Analyzer Preferences

  • If you export or save signals that have time information but are not stored as timetables, the time information by default is not saved. If you want to preserve the time information by saving the signals as timetables, on the Analyzer tab, click Preferences and check Always use timetables when signals have time information.

  • If you generate scripts involving signals that have time information but are not stored as timetables, the time information by default is not saved. If you want to preserve the time information by generating scripts that treat signals as timetables, on the Analyzer tab, click Preferences and check Always use timetables when signals have time information.

See Also

Related Examples

More About

Was this topic helpful?