The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
Typedefs | |
typedef void * | mha_fft_t |
Handle for an FFT object. More... | |
Functions | |
mha_fft_t | mha_fft_new (unsigned int n) |
Create a new FFT handle. More... | |
void | mha_fft_free (mha_fft_t h) |
Destroy an FFT handle. More... | |
void | mha_fft_wave2spec (mha_fft_t h, const mha_wave_t *in, mha_spec_t *out) |
Tranform waveform segment into spectrum. More... | |
void | mha_fft_wave2spec (mha_fft_t h, const mha_wave_t *in, mha_spec_t *out, bool swaps) |
Tranform waveform segment into spectrum. More... | |
void | mha_fft_spec2wave (mha_fft_t h, const mha_spec_t *in, mha_wave_t *out) |
Tranform spectrum into waveform segment. More... | |
void | mha_fft_spec2wave (mha_fft_t h, const mha_spec_t *in, mha_wave_t *out, unsigned int offset) |
Tranform spectrum into waveform segment. out may have fewer number of frames than needed for a complete iFFT. Only as many frames are written into out as fit, starting with offset offset of the complete iFFT. More... | |
void | mha_fft_forward (mha_fft_t h, mha_spec_t *sIn, mha_spec_t *sOut) |
Complex to complex FFT (forward). More... | |
void | mha_fft_backward (mha_fft_t h, mha_spec_t *sIn, mha_spec_t *sOut) |
Complex to complex FFT (backward). More... | |
void | mha_fft_forward_scale (mha_fft_t h, mha_spec_t *sIn, mha_spec_t *sOut) |
Complex to complex FFT (forward). More... | |
void | mha_fft_backward_scale (mha_fft_t h, mha_spec_t *sIn, mha_spec_t *sOut) |
Complex to complex FFT (backward). More... | |
void | mha_fft_wave2spec_scale (mha_fft_t h, const mha_wave_t *in, mha_spec_t *out) |
Tranform waveform segment into spectrum. More... | |
void | mha_fft_spec2wave_scale (mha_fft_t h, const mha_spec_t *in, mha_wave_t *out) |
Tranform spectrum into waveform segment. More... | |
typedef void* mha_fft_t |
Handle for an FFT object.
This FFT object is used by the functions mha_fft_wave2spec and mha_fft_spec2wave. The FFT back-end is the FFTW library. The back-end is completely hidden, including external header files or linking external libraries is not required.
mha_fft_t mha_fft_new | ( | unsigned int | n | ) |
Create a new FFT handle.
n | FFT length. |
Create a new FFT handle.
n | FFT length |
FFT | object |
void mha_fft_free | ( | mha_fft_t | h | ) |
Destroy an FFT handle.
h | Handle to be destroyed. |
Destroy an FFT handle.
h | FFT object to be removed |
void mha_fft_wave2spec | ( | mha_fft_t | h, |
const mha_wave_t * | in, | ||
mha_spec_t * | out | ||
) |
Tranform waveform segment into spectrum.
h | FFT handle. |
in | Input waveform segment. |
out | Output spectrum. |
Tranform waveform segment into spectrum.
h | FFT object handle |
in | pointer to input waveform signal |
out | pointer to output spectrum signal (has to be allocated) |
void mha_fft_wave2spec | ( | mha_fft_t | h, |
const mha_wave_t * | in, | ||
mha_spec_t * | out, | ||
bool | swaps | ||
) |
Tranform waveform segment into spectrum.
Like normal wave2spec, but swaps wave buffer halves before transforming if the swaps parameter is true.
Warning: These openMHA FFTs adopt a nonstandard scaling scheme in which the forward transform scales by 1/N and the backward does not scale. We would recommend using the '_scale' methods instead.
h | FFT handle. |
in | Input waveform segment. |
out | Output spectrum. |
swaps | Function swaps the first and second half of the waveform buffer before the FFT transform when this parameter is set to true. |
void mha_fft_spec2wave | ( | mha_fft_t | h, |
const mha_spec_t * | in, | ||
mha_wave_t * | out | ||
) |
Tranform spectrum into waveform segment.
Warning: These openMHA FFTs adopt a nonstandard scaling scheme in which the forward transform scales by 1/N and the backward does not scale. We would recommend using the '_scale' methods instead.
h | FFT handle. |
in | Input spectrum. |
out | Output waveform segment. |
Tranform spectrum into waveform segment.
h | FFT object handle |
in | pointer to input spectrum |
out | pointer to output waveform signal (has to be allocated) |
void mha_fft_spec2wave | ( | mha_fft_t | h, |
const mha_spec_t * | in, | ||
mha_wave_t * | out, | ||
unsigned int | offset | ||
) |
Tranform spectrum into waveform segment. out may have fewer number of frames than needed for a complete iFFT. Only as many frames are written into out as fit, starting with offset offset of the complete iFFT.
Warning: These openMHA FFTs adopt a nonstandard scaling scheme in which the forward transform scales by 1/N and the backward does not scale. We would recommend using the '_scale' methods instead.
h | FFT handle. |
in | Input spectrum. |
out | Output waveform segment. |
offset | Offset into iFFT wave buffer |
Tranform spectrum into waveform segment. out may have fewer number of frames than needed for a complete iFFT. Only as many frames are written into out as fit, starting with offset offset of the complete iFFT.
Only part of the iFFT is tranferred into the out buffer.
Out may have fewer number of freames than needed for a complete iFFT. Only as many frames are written into out as fit, starting with offset offset of the complete iFFT.
h | FFT object handle |
in | pointer to input spectrum |
out | pointer to output waveform signal (has to be allocated) |
offset | Offset into complete iFFT buffer. |
void mha_fft_forward | ( | mha_fft_t | h, |
mha_spec_t * | sIn, | ||
mha_spec_t * | sOut | ||
) |
Complex to complex FFT (forward).
sIn and sOut need to have nfft bins (please note that mha_spec_t typically has nfft/2+1 bins for half-complex representation).
Warning: These openMHA FFTs adopt a nonstandard scaling scheme in which the forward transform scales by 1/N and the backward does not scale. We would recommend using the '_scale' methods instead.
h | FFT handle. |
sIn | Input spectrum. |
sOut | Output spectrum. |
void mha_fft_backward | ( | mha_fft_t | h, |
mha_spec_t * | sIn, | ||
mha_spec_t * | sOut | ||
) |
Complex to complex FFT (backward).
sIn and sOut need to have nfft bins (please note that mha_spec_t typically has nfft/2+1 bins for half-complex representation).
Warning: These openMHA FFTs adopt a nonstandard scaling scheme in which the forward transform scales by 1/N and the backward does not scale. We would recommend using the '_scale' methods instead.
h | FFT handle. |
sIn | Input spectrum. |
sOut | Output spectrum. |
void mha_fft_forward_scale | ( | mha_fft_t | h, |
mha_spec_t * | sIn, | ||
mha_spec_t * | sOut | ||
) |
Complex to complex FFT (forward).
sIn and sOut need to have nfft bins (please note that mha_spec_t typically has nfft/2+1 bins for half-complex representation).
The _scale methods use standard DFT scaling: There is no scaling in the forward transformation, and 1/N scaling for the backward.
h | FFT handle. |
sIn | Input spectrum. |
sOut | Output spectrum. |
void mha_fft_backward_scale | ( | mha_fft_t | h, |
mha_spec_t * | sIn, | ||
mha_spec_t * | sOut | ||
) |
Complex to complex FFT (backward).
sIn and sOut need to have nfft bins (please note that mha_spec_t typically has nfft/2+1 bins for half-complex representation).
The _scale methods use standard DFT scaling: There is no scaling in the forward transformation, and 1/N scaling for the backward.
h | FFT handle. |
sIn | Input spectrum. |
sOut | Output spectrum. |
void mha_fft_wave2spec_scale | ( | mha_fft_t | h, |
const mha_wave_t * | in, | ||
mha_spec_t * | out | ||
) |
Tranform waveform segment into spectrum.
The _scale methods use standard DFT scaling: There is no scaling in the forward transformation, and 1/N scaling for the backward.
h | FFT handle. |
in | Input waveform segment. |
out | Output spectrum. |
void mha_fft_spec2wave_scale | ( | mha_fft_t | h, |
const mha_spec_t * | in, | ||
mha_wave_t * | out | ||
) |
Tranform spectrum into waveform segment.
The _scale methods use standard DFT scaling: There is no scaling in the forward transformation, and 1/N scaling for the backward.
h | FFT handle. |
in | Input spectrum. |
out | Output waveform segment. |