DSP TOOL BOX NOT WORKING Spectrum Analyzer For Two-Sided Power Spectrum

1 回表示 (過去 30 日間)
Lino
Lino 2019 年 4 月 10 日
コメント済み: Lino 2019 年 4 月 11 日
I have DSP TOOL BOX with MATLAB Version 9.0 (R2016a)
The following MATLAB EXAMPLE results in an error. There is a note that states For versions earlier than R2016b, use the step function to run the System object algorithm. The arguments to step are the object you created, followed by the arguments shown in this section.
For example, y = step(obj,x) and y = obj(x) perform equivalent operations.
But I am not sure how to do this. Can someone show me how to incorporate this step function? Thanks
sin = dsp.SineWave('Frequency',100,'SampleRate',1000);
sin.SamplesPerFrame = 1000;
scope = dsp.SpectrumAnalyzer('SampleRate',sin.SampleRate);
for ii = 1:250
x = sin() + 0.05*randn(1000,1);
scope(x);
end

採用された回答

Greg Dionne
Greg Dionne 2019 年 4 月 11 日
This worked for me:
sin = dsp.SineWave('Frequency',100,'SampleRate',1000);
sin.SamplesPerFrame = 1000;
scope = dsp.SpectrumAnalyzer('SampleRate',sin.SampleRate);
for ii = 1:250
x = step(sin) + 0.05*randn(1000,1);
step(scope,x);
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpectral Analysis についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by