Static Public Member Functions | |
static void | SetMeterFrequencies (int[] meterFrequencies) |
Changes the Frequency Bands to analyze. Affects the other static methods. | |
static double[] | Spectrum (ref double[] x, int method=Raw) |
static UInt32 | NumberOfBitsNeeded (UInt32 PowerOfTwo) |
Get Number of bits needed for a power of two. | |
static UInt32 | ReverseBits (UInt32 index, UInt32 NumBits) |
Reverse bits. | |
static Double | IndexToFrequency (UInt32 Index, UInt32 NumSamples) |
Return index to frequency based on number of samples. | |
static void | Compute (UInt32 NumSamples, Double[] pRealIn, Double[] pImagIn, Double[] pRealOut, Double[] pImagOut, Boolean bInverseTransform) |
Compute FFT. | |
static void | Norm (UInt32 NumSamples, Double[] pReal, Double[] pImag, Double[] pAmpl) |
Calculate normal (power spectrum) | |
static double | normalizeFFTValue (double value) |
static void | Compute2D (UInt32 width, UInt32 height, ref Double[] pRealIn, Double[] pImagIn, ref Double[] pRealOut, ref Double[] pImagOut, Boolean bInverseTransform=false) |
static Double | PeakFrequency (UInt32 NumSamples, Double[] pAmpl, Double samplingRate, ref UInt32 index) |
Find Peak frequency in Hz. | |
static byte[] | GetPeaks (double[] leftChannel, double[] rightChannel, int sampleFrequency) |
Public Attributes | |
const int | Raw = 1 |
const int | Decibel = 2 |
const int | FREQUENCYSLOTCOUNT = 21 |
static void DSP.FourierTransform.Compute | ( | UInt32 | NumSamples, |
Double[] | pRealIn, | ||
Double[] | pImagIn, | ||
Double[] | pRealOut, | ||
Double[] | pImagOut, | ||
Boolean | bInverseTransform | ||
) | [static] |
Compute FFT.
NumSamples | NumSamples Number of samples (must be power two) |
pRealIn | Real samples |
pImagIn | Imaginary (optional, may be null) |
pRealOut | Real coefficient output |
pImagOut | Imaginary coefficient output |
bInverseTransform | bInverseTransform when true, compute Inverse FFT |
static void DSP.FourierTransform.Compute2D | ( | UInt32 | width, |
UInt32 | height, | ||
ref Double[] | pRealIn, | ||
Double[] | pImagIn, | ||
ref Double[] | pRealOut, | ||
ref Double[] | pImagOut, | ||
Boolean | bInverseTransform = false |
||
) | [static] |
Compute 2D FFT
width | Width of the Matrix (must be power two) |
height | Height of the Matrix (must be power two) |
pRealIn | Real samples |
pImagIn | Imaginary (optional, may be null) |
pRealOut | Real coefficient output |
pImagOut | Imaginary coefficient output |
bInverseTransform | bInverseTransform when true, compute Inverse FFT |
static Double DSP.FourierTransform.IndexToFrequency | ( | UInt32 | Index, |
UInt32 | NumSamples | ||
) | [static] |
Return index to frequency based on number of samples.
Index | sample index |
NumSamples | number of samples |
static void DSP.FourierTransform.Norm | ( | UInt32 | NumSamples, |
Double[] | pReal, | ||
Double[] | pImag, | ||
Double[] | pAmpl | ||
) | [static] |
Calculate normal (power spectrum)
NumSamples | Number of sample |
pReal | Real coefficient buffer |
pImag | Imaginary coefficient buffer |
pAmpl | Working buffer to hold amplitude Xps(m) = | X(m)^2 | = Xreal(m)^2 + Ximag(m)^2 |
static UInt32 DSP.FourierTransform.NumberOfBitsNeeded | ( | UInt32 | PowerOfTwo | ) | [static] |
Get Number of bits needed for a power of two.
PowerOfTwo | Power of two number |
static Double DSP.FourierTransform.PeakFrequency | ( | UInt32 | NumSamples, |
Double[] | pAmpl, | ||
Double | samplingRate, | ||
ref UInt32 | index | ||
) | [static] |
Find Peak frequency in Hz.
NumSamples | Number of samples |
pAmpl | Current amplitude |
samplingRate | Sampling rate in samples/second (Hz) |
index | Frequency index |
static UInt32 DSP.FourierTransform.ReverseBits | ( | UInt32 | index, |
UInt32 | NumBits | ||
) | [static] |
Reverse bits.
index | Bits |
NumBits | Number of bits to reverse |
static void DSP.FourierTransform.SetMeterFrequencies | ( | int[] | meterFrequencies | ) | [static] |
Changes the Frequency Bands to analyze. Affects the other static methods.
meterFrequencies |