1 function [Y,N,N2] = nanfft(X,N,DIM);
2 % NANFFT calculates the Fourier-Transform of X for data with missing values.
3 % NANFFT is the same as FFT but X can contain missing values encoded with NaN.
4 % NaN's are skipped, NaN do not result in a NaN output.
11 % returns the number of valid samples N
14 % WARNING: missing values can introduce aliasing - causing unintended results.
15 % Moreover, the behavior of bandpass and highpass filters in case of missing values
16 % is not fully understood, and might contain some pitfalls.
18 % see also: FFT, XCORR, NANCONV, NANFILTER
21 % Copyright (C) 2005,2011 by Alois Schloegl <alois.schloegl@gmail.com>
22 % This function is part of the NaN-toolbox available at
23 % http://pub.ist.ac.at/~schloegl/matlab/NaN/ and
24 % http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/NaN/inst/
26 % This program is free software; you can redistribute it and/or modify
27 % it under the terms of the GNU General Public License as published by
28 % the Free Software Foundation; either version 3 of the License, or
29 % (at your option) any later version.
31 % This program is distributed in the hope that it will be useful,
32 % but WITHOUT ANY WARRANTY; without even the implied warranty of
33 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 % GNU General Public License for more details.
36 % You should have received a copy of the GNU General Public License
37 % along with this program; if not, write to the Free Software
38 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
40 warning('NANFFT is experimental. For more details see HELP NANFFT');