capturing the output of the "SpectrumAnalyzer" object in matlab?

2 views (last 30 days)
Hello all
I would like to use the object "SpectrumAnalyzer", but rather than the graphical output, I don't know how to save the output of this object in matlab, after "step"ing it!
I have successfully achieved this simulink by recording the out of the Spectrum Scope and sending it back to Matlab, but I still have not figured out how to do this completely in matlab.
Any help? can anyone do the following (the last step):
Fs = 100e6; % Sampling frequency
fSz = 5000; % Frame size
hsin = dsp.SineWave(1e0, 5e6, 0, 'SamplesPerFrame', fSz, 'SampleRate', Fs);
hsb = dsp.SpectrumAnalyzer;
hsb.SampleRate = Fs;
hsb.SpectralAverages = 1;
hsb.PlotAsTwoSidedSpectrum = false;
hsb.RBWSource = 'Auto';
hsb.PowerUnits = 'dBW';
hsb.Position = [749 227 976 721];
y1 = step(hsin);
output= step(hsb,y1);
I would be very grateful for an answer from some Matlab engineer.

Answers (1)

Honglei Chen
Honglei Chen on 29 May 2013
Currently there is no way to get the graphics output so if you really need it, you may just have to do it yourself using fft. The algorithm is documented in the algorithm section of the documentation.

Community Treasure Hunt

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

Start Hunting!