| 29 | free(fd->mSineTab); |
| 30 | } |
| 31 | void 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 | } |
| 45 | void mps(fftData *fd, float *x, float *y) |
| 46 | { |
| 47 | unsigned int i; |
no test coverage detected