How can I compute spectrogram for data vector containing NaN values?

6 ビュー (過去 30 日間)
Suzanne CARON--SAUTEJEAU
Suzanne CARON--SAUTEJEAU 2019 年 6 月 14 日
Dear community,
I am currently working on seismic recordings and I need to compute the spectrogram. The dataset has been cleaned in advance, and thus the original vector contains small portions of NaN values (about a few seconds each with a sample rate of 100 Hz).
However, spectrogram function cannot be applied to NaN values without compromising the entire result, and applying it to not NaN values (applied to data(~isnan(data)) would provide incorrect results (spectrogram function assumes that the sample rate is homogeneous which would no longer be the case).
I do not really know how to manage this issue, and to compute a correct power spectral density for my data, if anyone has a clue...
Thank you

採用された回答

KSSV
KSSV 2019 年 6 月 14 日
編集済み: KSSV 2019 年 6 月 14 日
Multiple options:
  1. Discard NaN's
  2. Fill the NaN's using interpolation (interp1, spline)
  3. Fill the NaN's using fillmissing
  4. Fill the NaN's using fillgaps
My favourite is 4 th option.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSeismology についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by