The algorithm starts by removing the average value of the signal and applying a Hanning window. Next, the signal is FFT’d and the frequency at which the maximum FFT amplitude occurs is found. This is taken as the starting frequency for a numerical optimization of the “overlap” between the signal and eiωt, which allows determining ω to resolution greater than the frequency spacing of the FFT. Once ω is determined, the overlap is subtracted from the original signal and the process is repeated, if desired.
sddsnaff par.bpm par.naff -column=Time,’P?P?x’ -terminateSearch=frequencies=1
sddsnaff [inputfile] [outputfile] [-pipe=[input][,output]] [-columns=indep-variable[,depen-quantity[,...]]] [-pair=<column1>,<column2>] [-exclude=depen-quantity[,...]] [-terminateSearch=changeLimit=fraction[,maxFrequencies=number] | frequencies=number] [-iterateFrequency=[cycleLimit=number][,accuracyLimit=fraction]] [-truncate] [-noWarnings]
inputFile contains the data to be NAFF’d. One column from this file must be chosen as the independent variable. If inputFile contains multiple pages, each is treated separately and is delivered to a separate page of outputFile.
outputFile contains two columns for each selected column in inputFile. These columns have names like origColumnFrequency and origColumnAmplitude, giving the frequency and amplitude for origColumn.