C# Class GAudio.FFTModule

A Monobehaviour component that enables inspecotr friendly configuration of FFT processing, including windowing of the original data and formatting of the output.
Inheritance: UnityEngine.MonoBehaviour
显示文件 Open project: gregzo/G-Audio

Public Properties

Property Type Description
customFftSize int
fftSize FFTSize
fromFrequency int
output FFTOutput
toFrequency int
useWindowFunction bool
window WindowFunction

Public Methods

Method Description
Awake ( ) : void
ComputeDB ( float data ) : void
ComputeMagnitudes ( float data ) : void
ComputeSquareMagnitudes ( float data ) : void
RealFFT ( float data ) : void

Performs windowed in place real FFT of the passed data array, reusing a cached array for the imaginary part. Formats the specified frequency bins according to FFTOutput.

SetWindow ( WindowFunction windowFunction ) : void

Sets and pre-computes the specified WindowFunction for faster processing.

Method Details

Awake() public method

public Awake ( ) : void
return void

ComputeDB() public method

public ComputeDB ( float data ) : void
data float
return void

ComputeMagnitudes() public method

public ComputeMagnitudes ( float data ) : void
data float
return void

ComputeSquareMagnitudes() public method

public ComputeSquareMagnitudes ( float data ) : void
data float
return void

RealFFT() public method

Performs windowed in place real FFT of the passed data array, reusing a cached array for the imaginary part. Formats the specified frequency bins according to FFTOutput.
public RealFFT ( float data ) : void
data float
return void

SetWindow() public method

Sets and pre-computes the specified WindowFunction for faster processing.
public SetWindow ( WindowFunction windowFunction ) : void
windowFunction WindowFunction
return void

Property Details

customFftSize public_oe property

If fftSize is set to FFTSize.Custom this value will be used instead of the audio buffer's size. Note that only power of 2 values are valid.
public int customFftSize
return int

fftSize public_oe property

public FFTSize fftSize
return FFTSize

fromFrequency public_oe property

The lowest frequency we are interested in. The lowest relevant value is SampleRate / FFT size, but higher values can be specified.
public int fromFrequency
return int

output public_oe property

public FFTOutput output
return FFTOutput

toFrequency public_oe property

The highest frequency we are interested in. The highest relevant frequency is SampleRate/2 ( Nyquist frequency ). but lower values can be specified.
public int toFrequency
return int

useWindowFunction public_oe property

public bool useWindowFunction
return bool

window public_oe property

public WindowFunction window
return WindowFunction