Dynamic spectra for 1000 files

조회 수: 2 (최근 30일)
Pritpal Kaur
Pritpal Kaur 2020년 3월 6일
댓글: Pritpal Kaur 2020년 3월 7일
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 ?

채택된 답변

Bjorn Gustavsson
Bjorn Gustavsson 2020년 3월 6일
편집: Bjorn Gustavsson 2020년 3월 6일
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
Pritpal Kaur
Pritpal Kaur 2020년 3월 7일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by