Hello,
I would like to make dynamic spectra of two columns data. 1st column has frequency and other column has power from spectrum analyzer in dBm units.
Dynamic spectra is defined as intensity as a function of time and frequency. Here time is two and half hours of observation. I have 1000 .txt files then how
to create dynamic spectra ?

 Akzeptierte Antwort

Bjorn Gustavsson
Bjorn Gustavsson am 6 Mär. 2020
Bearbeitet: Bjorn Gustavsson am 6 Mär. 2020

0 Stimmen

It is unclear what data you have in your files. Is it frquency and power-spectra from spectrum analyzer? If so then you can simply merge them together in order-of-time:
dFiles = dir('*.txt');
for i1 = numel(dFiles):-1:1
curr_data = load(dFiles(i1).name);
P(1:numel(curr_data)/2,i1) = curr_data(:,2);
F(1:numel(curr_data)/2,i1) = curr_data(:,1);
T(i1) = 2.5*3600*(i1-1);
end
If you on the other hand have the actual signal samples saved for a time-span of 2.5 hours split into 1000 files then just merge them together and calculate the spectrogram with for example the spectrogram function.
HTH

1 Kommentar

Pritpal Kaur
Pritpal Kaur am 7 Mär. 2020
Thanks for a kind message. Yes, data in files are frequency and power-spectra from spectrum analyzer. The above mention code run successfully. F = 401 x 1000, P = 401 x 1000, T = 1 x 1000 are displayed on the workspace. 401 are data points in each file. Each file having 5 seconds of interval. To construct dynamic spectra, we need to calculate the spectrogram. Simply, write spectrogram (P,F,T) on the editor. The blank figure window comes out. Kindly, help me for calculation of spectrogram.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by