C# Class SoundFingerprinting.FFT.LomontFFT

Inheritance: IFFTService
Mostrar archivo Open project: AddictedCS/soundfingerprinting

Public Methods

Method Description
FFTForward ( float data, int startIndex, int length, float window ) : float[]
LomontFFT ( ) : System
RealFFT ( float data, bool forward ) : void

Compute the forward or inverse Fourier Transform of data, with data containing real valued data only. The output is complex valued after the first two entries, stored in alternating real and imaginary parts. The first two returned entries are the real parts of the first and last value from the conjugate symmetric output, which are necessarily real. The length must be a power of 2.

TableFFT ( float data, bool forward ) : void

Compute the forward or inverse Fourier Transform of data, with data containing complex valued data as alternating real and imaginary parts. The length must be a power of 2. This method caches values and should be slightly faster on than the FFT method for repeated uses. It is also slightly more accurate. Data is transformed in place.

Private Methods

Method Description
Initialize ( int size ) : void

Call this with the size before using the TableFFT version Fills in tables for speed. Done automatically in TableFFT

Reverse ( float data, int n ) : void

Swap data indices whenever index i has binary digits reversed from index j, where data is two doubles per index.

Scale ( float data, int n, bool forward ) : void

Scale data using n samples for forward and inverse transforms as needed

Window ( float toTransform, float window ) : void

Method Details

FFTForward() public method

public FFTForward ( float data, int startIndex, int length, float window ) : float[]
data float
startIndex int
length int
window float
return float[]

LomontFFT() public method

public LomontFFT ( ) : System
return System

RealFFT() public method

Compute the forward or inverse Fourier Transform of data, with data containing real valued data only. The output is complex valued after the first two entries, stored in alternating real and imaginary parts. The first two returned entries are the real parts of the first and last value from the conjugate symmetric output, which are necessarily real. The length must be a power of 2.
public RealFFT ( float data, bool forward ) : void
data float The complex data stored as alternating real /// and imaginary parts
forward bool true for a forward transform, false for /// inverse transform
return void

TableFFT() public method

Compute the forward or inverse Fourier Transform of data, with data containing complex valued data as alternating real and imaginary parts. The length must be a power of 2. This method caches values and should be slightly faster on than the FFT method for repeated uses. It is also slightly more accurate. Data is transformed in place.
public TableFFT ( float data, bool forward ) : void
data float The complex data stored as alternating real /// and imaginary parts
forward bool true for a forward transform, false for /// inverse transform
return void