main sms analysis routines More...
#include "sms.h"
Defines | |
#define | SMS_MAX_SPEC 8192 |
maximum size for magnitude spectrum | |
Functions | |
void | sms_analyzeFrame (int iCurrentFrame, SMS_AnalParams *pAnalParams, sfloat fRefFundamental) |
compute spectrum, find peaks, and fundamental of one frame | |
static int | ReAnalyzeFrame (int iCurrentFrame, SMS_AnalParams *pAnalParams) |
re-analyze the previous frames if necessary | |
int | sms_analyze (int sizeWaveform, sfloat *pWaveform, SMS_Data *pSmsData, SMS_AnalParams *pAnalParams) |
main function to perform the SMS analysis on a single frame |
main sms analysis routines
the analysis routine here calls all necessary functions to perform the complete SMS analysis, once the desired analysis parameters are set in SMS_AnalParams.
#define SMS_MAX_SPEC 8192 |
maximum size for magnitude spectrum
Referenced by sms_analyzeFrame().
static int ReAnalyzeFrame | ( | int | iCurrentFrame, | |
SMS_AnalParams * | pAnalParams | |||
) | [static] |
re-analyze the previous frames if necessary
iCurrentFrame | current frame number | |
pAnalParams | structure with analysis parameters |
References SMS_AnalFrame::fFundamental, SMS_AnalParams::fSizeWindow, SMS_AnalFrame::iFrameNum, SMS_AnalFrame::iFrameSize, SMS_AnalParams::iSamplingRate, SMS_AnalFrame::iStatus, SMS_AnalParams::ppFrames, sfloat, SMS_ANAL_DELAY, sms_analyzeFrame(), SMS_FRAME_READY, SMS_FRAME_RECOMPUTED, sms_fundDeviation(), SMS_MAX_DEVIATION, and SMS_MIN_GOOD_FRAMES.
Referenced by sms_analyze().
int sms_analyze | ( | int | sizeWaveform, | |
sfloat * | pWaveform, | |||
SMS_Data * | pSmsData, | |||
SMS_AnalParams * | pAnalParams | |||
) |
main function to perform the SMS analysis on a single frame
The input is a section of the sound, the output is the SMS data
sizeWaveform | size of input waveform data | |
pWaveform | pointer to input waveform data | |
pSmsData | pointer to output SMS data | |
pAnalParams | pointer to analysis parameters |
References SMS_AnalFrame::deterministic, SMS_AnalParams::fDefaultFundamental, SMS_AnalFrame::fFundamental, SMS_AnalParams::fResidualAccumPerc, SMS_AnalParams::iCleanTracks, SMS_AnalParams::iDefaultSizeWindow, SMS_AnalParams::iFormat, SMS_AnalFrame::iFrameSample, SMS_SndBuffer::iMarker, SMS_AnalParams::iMaxDelayFrames, SMS_AnalParams::iSamplingRate, SMS_AnalParams::iSoundType, SMS_AnalFrame::iStatus, SMS_AnalParams::iStochasticType, SMS_SEnvParams::iType, MAX, MIN, SMS_AnalFrame::nPeaks, SMS_Data::nTracks, SMS_SndBuffer::pFBuffer, SMS_Data::pFSinAmp, SMS_Data::pFSinFreq, SMS_Data::pFSinPha, SMS_Data::pFStocCoeff, SMS_AnalParams::ppFrames, SMS_Data::pResPhase, SMS_AnalParams::prevFrame, ReAnalyzeFrame(), sfloat, SMS_SndBuffer::sizeBuffer, SMS_AnalParams::sizeHop, SMS_AnalParams::sizeNextRead, sms_analyzeFrame(), sms_arrayDBToMag(), sms_cleanTracks(), sms_clearFrame(), SMS_DELAY_FRAMES, SMS_ENV_NONE, sms_error(), sms_errorCheck(), sms_errorString(), sms_fillSoundBuffer(), sms_filterHighPass(), SMS_FORMAT_HP, SMS_FORMAT_IH, SMS_FORMAT_IHP, SMS_FRAME_DONE, SMS_FRAME_EMPTY, SMS_FRAME_END, SMS_FRAME_READY, sms_fundDeviation(), sms_getWindow(), sms_initFrame(), SMS_MAX_DEVIATION, sms_peakContinuation(), sms_power2(), sms_residual(), sms_scaleDet(), sms_scaleWindow(), sms_sineSynthFrame(), sms_sizeNextWindow(), SMS_SOUND_TYPE_NOTE, sms_spectralEnvelope(), sms_spectrum(), SMS_STOC_APPROX, SMS_STOC_IFFT, SMS_STOC_NONE, sms_stocAnalysis(), SMS_WIN_HAMMING, SMS_AnalParams::soundBuffer, SMS_AnalParams::specEnvParams, and SMS_AnalParams::synthBuffer.
void sms_analyzeFrame | ( | int | iCurrentFrame, | |
SMS_AnalParams * | pAnalParams, | |||
sfloat | fRefFundamental | |||
) |
compute spectrum, find peaks, and fundamental of one frame
This is the main core of analysis calls
iCurrentFrame | frame number to be computed | |
pAnalParams | structure of analysis parameters | |
fRefFundamental | reference fundamental |
References SMS_AnalParams::iFormat, SMS_AnalFrame::iFrameSample, SMS_AnalFrame::iFrameSize, SMS_SndBuffer::iMarker, SMS_AnalParams::iWindowType, SMS_AnalFrame::nPeaks, SMS_AnalParams::peakParams, SMS_SndBuffer::pFBuffer, SMS_AnalParams::ppFrames, SMS_AnalFrame::pSpectralPeaks, sfloat, sms_arrayMagToDB(), sms_detectPeaks(), SMS_FORMAT_H, SMS_FORMAT_HP, sms_getWindow(), sms_harmDetection(), SMS_MAX_SPEC, sms_power2(), sms_scaleWindow(), sms_spectrum(), and SMS_AnalParams::soundBuffer.
Referenced by ReAnalyzeFrame(), and sms_analyze().