diff --git a/perceive_raw_tf.m b/perceive_raw_tf.m index 8a1b98d..4f4cf59 100644 --- a/perceive_raw_tf.m +++ b/perceive_raw_tf.m @@ -1,6 +1,6 @@ function [tf,t,f]=perceive_raw_tf(data,fs,timewindow,timestep) -nfft = round(timewindow/fs*1000); +nfft = min(round(timewindow/fs*1000), length(data)); timestep = round(timestep/fs*1000); [~,f,t,tf]=spectrogram(data,hann(nfft), ... nfft-timestep,nfft,fs,'yaxis','power');