MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / initMpsFFTData

Function initMpsFFTData

libjamesdsp/JdspImpResToolbox.c:31–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 free(fd->mSineTab);
30}
31void initMpsFFTData(fftData *fd, unsigned int xLen, float threshdB)
32{
33 fd->xLen = xLen;
34 fd->fftLen = upper_power_of_two(xLen);
35 fd->halfLen = fd->fftLen >> 1;
36 fd->halfLenWdc = fd->halfLen + 1;
37 fd->mBitRev = (unsigned int*)malloc(fd->fftLen * sizeof(unsigned int));
38 fd->mSineTab = (float*)malloc(fd->fftLen * sizeof(float));
39 LLbitReversalTbl(fd->mBitRev, fd->fftLen);
40 LLsinHalfTblFloat(fd->mSineTab, fd->fftLen);
41 fd->threshold = powf(10.0f, threshdB / 20.0f);
42 fd->logThreshold = logf(fd->threshold);
43 fd->normalizeGain = 1.0f / fd->fftLen;
44}
45void mps(fftData *fd, float *x, float *y)
46{
47 unsigned int i;

Callers 1

Calls 3

LLsinHalfTblFloatFunction · 0.70
upper_power_of_twoFunction · 0.50
LLbitReversalTblFunction · 0.50

Tested by

no test coverage detected