Spectrogram error with multiple errors
显示 更早的评论
Hello,
I keep getting the following error when I try to do a spectrogram: Subscript indices must either be real positive integers or logicals.
Error in getSTFTColumns (line 14) xin = x(rowindices+coloffsets);
Error in pspectrogram (line 55) [xin,t] = getSTFTColumns(x,nx,nwin,noverlap,Fs);
Error in spectrogram (line 168) pspectrogram({x},'spect',varargin{:});
This is what I am doing:
% Trying to use this code: spectrogram(x,window,noverlap,f,fs) so that I can see the spectrogram in terms of frequency and time
% x is my signal
% fs = 128
% N = 15360
% The frequency range I want to look at is between 2-35Hz
figure
spectrogram(x,hanning(2*fs),0.5,[2 35],fs)
4 个评论
Rishabh Rathore
2018-10-1
From the error message shared by you, it looks like you might be accessing the out of bound array elements or value of either "rowindices" or "coloffsets" might not be real positive integer.
Moreover, please explain what is "getSTFTColumns" and what do you want to accomplish with: -
xin = x(rowindices+coloffsets);
Krithika A
2018-10-1
Rishabh Rathore
2018-10-1
编辑:Rishabh Rathore
2018-10-1
Can you please share your signal "x" and a screenshot of the error message(or messages). And is "N" number of samples?
Krithika A
2018-10-1
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Time-Frequency Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!