Fast-Fourier Transform (fft)

fft is a command line utility that calculates the Fast Fourier Transform of a dataset.

The settings allow to select the size of the transform, the choice of the apodization window, the overlapping between consecutive windows.
The output text file contains two colums: frequency and spectrum. Spectrum or Spectral density are calculated and can be expressed as amplitude, power or dB.

Example

$ fft -i test.txt -o out.txt -vvv -n 512 -O 2 -t dbs
Reading file test.txt ...
Read 4096 entries.
14 FFT will be averaged.
Input data sample rate: 10.00 Hz
FFT SETTINGS:
fft size 512 (frequency resolution 0.0195 Hz)
Apodization window: Hann, Overlap 50%
Effective Noise Bandwidth 0.0293 Hz
FFT output: Spectrum in dB 
Aberrant Limit 1.80e+308.
Saving data to out.txt
Done.

Download

fft has been developped in C ANSI. It has been tested on Linux platforms (gcc) as well as on Windows (Visual Studio C++)

Current version is 1.0.0.
fft binary and source can be downloaded through anonymous SVN at the following address:
https://anonsvn.loudet.org/fft/tags/

Change Log

Installation

Under Windows, the binary runs directly without installation.
Under Linux, the library fftw (http://www.fftw.org/) must be installed. For instance:
$ sudo apt-get install fftw3 fftw3-dev
Then, the classic installation steps are used: ./configure, make, make install. Please read the INSTALL file from the package for details.

Help

]
      [-i , --input=]
      [-o , --output=]
      [-n {128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,
       262144,524288}, --fft={...}]
      [-w {none,rectangular,hann,hamming,gauss,blackman,nuttall,blackman-harris,
           blackman-nuttall,flat-top}, --window={...}]
      [-O {1,2,4,8,16}, --overlap={...}]
      [-t {ps,psd,ls,lsd,dbs,dbsd}, --type={...}]
      [-a , --aberrant=]

Options:
    -h, --help
      display this help and exit.

    -v[v...], --verbose=
      increase/set verbosity level.

    -i , --input=
      Input filename. Defaults to stdin.
      File must contain two columns (x and y) of real data.

    -o , --output=
      Output filename. Defaults to stdout.
      Output file contains the following columns:
       

    -n {128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288}
    --fft={...}
      Set the size of the FFT.   Default is 16384.

    -w {none or rectangular,hann,hamming,gauss,blackman,nuttall,blackman-harris,
        blackman-nuttall,flat-top},
    --window= {...}
      Set the apodization window. Default is hann.

    -O {1,2,4,8,16}, --overlap={...}
      Set the samples overlap: 1 (0%), 2 (50%), 4 (75%), 8 (87.5%), 16 (93.75%)
      Default value is 2 (overlap = 50%).

    -t {ps,psw,psd,psdw,ls,lsw,lsd}, --type={...}
      Indicate the type of plot to calculate.
      ps     Power Spectrum                     V^2
      psd    Power Spectral Density             V^2/Hz
      ls     Linear Spectrum                    V
      lsd    Linear Spectral Density            V/sqrtHz
      dbs    Spectrum in dB                     dB [V]
      dbsd   Spectral Density in dB             dB [V/sqrtHz]

      Default is 'dbs' (spectrum in dB)

    -a , --aberrant=
      Threshold for aberrant values suppression. Difference between two
      consecutive data must not exceed the specified value.
      Aberrant values suppression is not enabled by default.

EXAMPLE:
    fft -i test.txt -o out.txt -n 2048 -t dbs
      Generate a spectrum in dB (-t) of data in file test.txt (-c), store it in
      file out.txt, using a FFT width of 2048 (-n).
]]>
Creative Commons License SID monitoring station by Lionel LOUDET is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Disclaimer
Last Update: 16 Dec 2010
Apache Web Server PHP
Apache/2.4.62 (Debian)
Valid XHTML + RDFa Valid CSS!
Page generated in 0.016 seconds.