How to set the length of fft

“Setting the length” in Matlab’s fft function just corresponds to zero-padding or truncating the data, which you can easily do manually:

newdata = zeros(newlength)
newdata[1:length(olddata)] = olddata
5 Likes