samer@32: function [y,f] = realfft(x,nfft) samer@32: % realfft - Do FFT assuming real data, returning complex half spectrum samer@32: % samer@32: % realfft :: samer@32: % [[L,T]->real] ~'sequence of T L-point frames', samer@32: % N:natural ~'FFT size' samer@32: % -> [[M,T]->complex] ~'sequence of T M-point complex spectra', samer@32: % [[M]] ~'normalised centre frequency for each bin'. samer@32: % samer@32: % Note that M=dftbins(N). samer@32: samer@32: % apply the window and do FFT on each column, then samer@32: % assume it's a real signal and discard half the bins samer@32: y = fft(x,nfft); samer@32: select=1:dftbins(nfft); samer@32: y = y(select,:); samer@32: % compute the normalised frequency for each bin samer@32: f=(select-1)/nfft;