Effacer les filtres
Effacer les filtres

Error using pwelch - Expected x to be finite.

47 vues (au cours des 30 derniers jours)
Felicia DE CAPUA
Felicia DE CAPUA le 24 Oct 2022
Hi everyone,
x=load('\\fs01.hpc.unipr.it\bonini01\WIRELESS_Wifi_Router_Impianti2021\Acquisizioni Deuteron\ProvaHyper_20220915_M1\LFP1.mat');
input=x.LFP1;
y=fft(x.LFP1);
M1_LFP1=rmmissing(input);
N=64;
window=hamming(N);
noverlap=N/2;
nfft=length(M1_LFP1);
new_fs=542.4;
time_1=(1:length(M1_LFP1))/new_fs;
[s,f,t]=spectrogram(M1_LFP1,window,noverlap,nfft,new_fs);
colormap('jet');
This is my code to compute the spectrogram but when I'm running it appears this error:
Error using pwelch - Expected x to be finite.
My x, namely M1_LFP1, is a vector 1358x1, what is the problem?

Réponse acceptée

dpb
dpb le 24 Oct 2022
x=load('\\fs01.hpc.unipr.it\bonini01\WIRELESS_Wifi_Router_Impianti2021\Acquisizioni Deuteron\ProvaHyper_20220915_M1\LFP1.mat');
input=x.LFP1;
M1_LFP1=rmmissing(input);
sum(~isfinite(M1_LFP1))
will show you how many elements are NOT finite in your input data -- some clearly are.
isBad=~isfinite(M1_LFP1);
will return the actual locations in logical addressing vector that you can see whether are nan or inf; you can, of course, count/find each of those with the appropriate functions isnan, isinf

Plus de réponses (0)

Catégories

En savoir plus sur Time-Frequency Analysis dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by