Error using pwelch - Expected x to be finite.

55 次查看(过去 30 天)
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?

采纳的回答

dpb
dpb 2022-10-24
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Spectral Estimation 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by