How Can I extract the Spectrum data from the "Spectrum Analyzer" in Matlab Simulink?

48 ビュー (過去 30 日間)
XuesuTeng
XuesuTeng 2020 年 1 月 6 日
回答済み: Anand Kumar 2022 年 4 月 27 日
As shown in the title, I want to extract the power density data displayed in the "Spectrum Analyzer" into a matrix or a .mat file.
I have tried to print it in figure and use the brush tool, but it does not work, could anybody help me? Thank you!

回答 (2 件)

Khodour Al Kadry
Khodour Al Kadry 2021 年 7 月 14 日
Hi Xuesu
You can the method getSpectrumData to extract the data from the scope. Please refer to the following documentation pages for more info and examples:
dsp.SpectrumAnalyzer getSpectrumData
Spectrum Analyzer Bloxk getSpectrumData
-Khodour

Anand Kumar
Anand Kumar 2022 年 4 月 27 日
Hope this works.
model = 'filename.slx';
open_system(model)
sablock = 'filename/Spectrum Analyzer';
cfg = get_param(sablock,'ScopeConfiguration');
cfg.CursorMeasurements.Enable = true;
cfg.ChannelMeasurements.Enable = true;
cfg.PeakFinder.Enable = true;
cfg.DistortionMeasurements.Enable = true;
sim(model)
data = getMeasurementsData(cfg)
specTable = getSpectrumData(cfg)

カテゴリ

Help Center および File ExchangeScopes and Data Logging についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by