Filter löschen
Filter löschen

How to use SpectrumAnalyzer for an entire signal

4 Ansichten (letzte 30 Tage)
Alejandro Ramiro Muñoz
Alejandro Ramiro Muñoz am 14 Mai 2018
Hey all! I have a file from GNU Radio containing a signal which I want to process ( image below in time domain).
I want to use the SpectrumAnalyzer function of DSP Matlab toolbox to simplify the work (instead of doing myself all the digital processing) but this function only plots me the first 1536 points.
( Spectrum Analyzer output for only the first 1536 points)
I want to process all the entire signal because I'm interested in saving a peak power value from a frecuency tone which is intermitent.
( The central peak is the one I'm interested in)
Here you can see the code I have implemented:
close all
clear all
clc
data_input = read_complex_binary('pruebaBUENAcomplex4',Inf);
Fs = 1e6; % Sampling rate
Ts = 1/Fs; % Sampling time interval
n = length(data_input); % Number of samples
t = 0:Ts:(n * Ts)-Ts; % Sampling period
plot(t,data_input); % Plot the original curve in the time domain
object = dsp.SpectrumAnalyzer('SampleRate', 1e6);
step(object, data_input)
spectrumTable = getSpectrumData(object);
power_values = spectrumTable.Spectrum;
power_values = power_values{1,1};
freq_values = spectrumTable.FrequencyVector;
freq_values = freq_values{1,1};
plot(freq_values,power_values)
Any suggestion how could I do this with all the imported signal file?
Thank you so much in advance, Regards.
Alejandro

Antworten (1)

Yoke Peng Leong
Yoke Peng Leong am 17 Mai 2018
You can adjust the output length through the Spectrum Settings panel.
To do so:
  1. Item one In the menu bar of the Spectrum Analyzer window, select "View" and then "Spectrum Settings". Then, you will see a new panel showing up.
  2. Item two Under the Main options, you can change the value of RBW (Hz) to increase the samples/update. The default value is "Auto". A smaller number gives a larger samples/update.
You can read more about the RBW settings in this page:
It is under the Properties > Advanced section.
  1 Kommentar
Alejandro Ramiro Muñoz
Alejandro Ramiro Muñoz am 7 Jun. 2018
Dear Yoke, first, thanks for your answer.
I've been looking on your comments and finally got to see the mentioned peak. But now, I'm checking that I don't get the same scale for power values as in GNU Radio.
As you can see, GNU Radio gives me a power value for the peak at around -2 dB meanwhile in Matlab's spectrum analyzer is at around 20 dB. Do you know how can I solve this? I need to have the scale on real values in Matlab, as I need the power value for the next steps on my proyect.
Thank you so much again Cheers!

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by