Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

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

Asked by asd zxc on 26 May 2013

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.

The "SpectrumAnalyzer" object webpage is: http://www.mathworks.co.uk/help/dsp/ref/dsp.spectrumanalyzerclass.html

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.

0 Comments

asd zxc

1 Answer

Answer by 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.

0 Comments

Honglei Chen

Contact us