getSpectrumData
Save spectrum data shown in spectrum analyzer
Description
returns the spectrum and spectrogram displayed on the spectrum analyzer along with
additional statistics about the spectrum.spectrumTable
= getSpectrumData(scope
)
Examples
Save Spectrum Data
Create a Spectrum Analyzer object and generate data.
scope = spectrumAnalyzer; scope(randn(6000,3))
Save data from the last spectrum shown in the Spectrum Analyzer to a table.
specTable = getSpectrumData(scope)
specTable = 1x3 table SimulationTime Spectrum FrequencyVector ______________ _______________ _______________ {[0.5999]} {1024x3 double} {1024x1 double}
Input Arguments
scope
— Spectrum analyzer
object name | block configuration
Spectrum Analyzer you want to query, specified as one of the following:
spectrumAnalyzer
objectSpectrumAnalyzerBlockConfiguration
object for a Spectrum Analyzer block
Output Arguments
spectrumTable
— Data about current spectrum estimation
table
A spectrum table is returned containing the following fields:
Field | Description |
---|---|
SimulationTime | Simulation time |
Spectrum | Power, power density, or RMS spectrum data |
Spectrogram | Spectrogram data |
MinHoldTrace | Minimum hold trace data |
MaxHoldTrace | Maximum hold trace data |
FrequencyVector | Frequency vector |
Version History
Introduced in R2017bR2024a: dsp.SpectrumAnalyzer
System object warns
The dsp.SpectrumAnalyzer
System object™ warns in R2024a. Use the spectrumAnalyzer
object instead.
Update Code
No updates to your code are required except replacing instances of
dsp.SpectrumAnalyzer
with
spectrumAnalyzer
.
This table shows how the getSpectrumData
function typically
uses the dsp.SpectrumAnalyzer
System object and explains how to update existing code to use the
spectrumAnalyzer
object.
Discouraged Usage | Recommended Replacement |
---|---|
scope = dsp.SpectrumAnalyzer; scope(randn(100000,1)) specTable = getSpectrumData(scope) |
scope = spectrumAnalyzer; scope(randn(100000,1)) specTable = getSpectrumData(scope) |
R2022a: Support for dsp.SpectrumAnalyzer
object will be removed
The getSpectrumData
function will stop supporting the
dsp.SpectrumAnalyzer
object in a future release. Use the
spectrumAnalyzer
object instead.
See Also
Functions
Objects
Blocks
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)