peak continuation algorithm and functions More...
#include "sms.h"
Defines | |
| #define | GUIDE_BEG -2 |
| #define | GUIDE_DEAD -1 |
| #define | GUIDE_ACTIVE 0 |
| #define | MAX_CONT_CANDIDATES 5 |
Functions | |
| static int | GetNextClosestPeak (sfloat fGuideFreq, sfloat *pFFreqDistance, SMS_Peak *pSpectralPeaks, SMS_AnalParams *pAnalParams, sfloat fFreqDev) |
| function to get the next closest peak from a guide | |
| static int | ChooseBestCand (SMS_ContCandidate *pCandidate, int nCandidates, sfloat fFreqDev) |
| choose the best candidate out of all | |
| static int | CheckForConflict (int iBestPeak, SMS_Guide *pGuides, int nGuides) |
| check for one guide that has choosen iBestPeak | |
| static int | BestGuide (int iConflictingGuide, int iGuide, SMS_Guide *pGuides, SMS_Peak *pSpectralPeaks) |
| chose the best of the two guides for the conflicting peak | |
| static int | GetBestPeak (SMS_Guide *pGuides, int iGuide, SMS_Peak *pSpectralPeaks, SMS_AnalParams *pAnalParams, sfloat fFreqDev) |
| function to find the best continuation peak for a given guide | |
| static int | GetNextMax (SMS_Peak *pSpectralPeaks, sfloat *pFCurrentMax) |
| function to get the next maximum (magnitude) peak | |
| static int | GetStartingPeak (int iGuide, SMS_Guide *pGuides, int nGuides, SMS_Peak *pSpectralPeaks, sfloat *pFCurrentMax) |
| function to get a good starting peak for a track | |
| int | sms_peakContinuation (int iFrame, SMS_AnalParams *pAnalParams) |
| function to advance the guides through the next frame | |
peak continuation algorithm and functions
| #define GUIDE_ACTIVE 0 |
Referenced by sms_peakContinuation().
| #define GUIDE_BEG -2 |
diferent status of guide
Referenced by GetStartingPeak().
| #define GUIDE_DEAD -1 |
Referenced by sms_peakContinuation().
| #define MAX_CONT_CANDIDATES 5 |
maximum number of peak continuation candidates
Referenced by GetBestPeak().
| static int BestGuide | ( | int | iConflictingGuide, | |
| int | iGuide, | |||
| SMS_Guide * | pGuides, | |||
| SMS_Peak * | pSpectralPeaks | |||
| ) | [static] |
chose the best of the two guides for the conflicting peak
| iConflictingGuide | conflicting guide number | |
| iGuide | guide number | |
| pGuides | array of guides | |
| pSpectralPeaks | array of peaks |
References SMS_Guide::iPeakChosen, and sfloat.
Referenced by GetBestPeak().
| static int CheckForConflict | ( | int | iBestPeak, | |
| SMS_Guide * | pGuides, | |||
| int | nGuides | |||
| ) | [static] |
check for one guide that has choosen iBestPeak
| iBestPeak | choosen peak for a guide | |
| pGuides | array of guides | |
| nGuides | total number of guides |
Referenced by GetBestPeak(), and GetStartingPeak().
| static int ChooseBestCand | ( | SMS_ContCandidate * | pCandidate, | |
| int | nCandidates, | |||
| sfloat | fFreqDev | |||
| ) | [static] |
choose the best candidate out of all
| pCandidate | pointer to all the continuation candidates | |
| nCandidates | number of candidates | |
| fFreqDev | maximum frequency deviation allowed |
References SMS_ContCandidate::fFreqDev, SMS_ContCandidate::fMagDev, and sfloat.
Referenced by GetBestPeak().
| static int GetBestPeak | ( | SMS_Guide * | pGuides, | |
| int | iGuide, | |||
| SMS_Peak * | pSpectralPeaks, | |||
| SMS_AnalParams * | pAnalParams, | |||
| sfloat | fFreqDev | |||
| ) | [static] |
function to find the best continuation peak for a given guide
| pGuides | guide attributes | |
| iGuide | number of guide | |
| pSpectralPeaks | peak values at the current frame | |
| pAnalParams | analysis parameters | |
| fFreqDev | frequency deviation allowed |
References BestGuide(), CheckForConflict(), ChooseBestCand(), SMS_Guide::fFreq, SMS_ContCandidate::fFreqDev, SMS_AnalParams::fFreqDeviation, SMS_Guide::fMag, SMS_ContCandidate::fMagDev, GetNextClosestPeak(), SMS_AnalParams::iDebugMode, SMS_ContCandidate::iPeak, SMS_Guide::iPeakChosen, MAX_CONT_CANDIDATES, SMS_AnalParams::nGuides, sfloat, SMS_DBG_ALL, and SMS_DBG_PEAK_CONT.
Referenced by sms_peakContinuation().

| static int GetNextClosestPeak | ( | sfloat | fGuideFreq, | |
| sfloat * | pFFreqDistance, | |||
| SMS_Peak * | pSpectralPeaks, | |||
| SMS_AnalParams * | pAnalParams, | |||
| sfloat | fFreqDev | |||
| ) | [static] |
function to get the next closest peak from a guide
| fGuideFreq | guide's frequency | |
| pFFreqDistance | distance of last best peak from guide | |
| pSpectralPeaks | array of peaks | |
| pAnalParams | analysis parameters | |
| fFreqDev | maximum deviation from guide |
References SMS_Peak::fFreq, sfloat, and SMS_MAX_NPEAKS.
Referenced by GetBestPeak().
| static int GetNextMax | ( | SMS_Peak * | pSpectralPeaks, | |
| sfloat * | pFCurrentMax | |||
| ) | [static] |
function to get the next maximum (magnitude) peak
| pSpectralPeaks | array of peaks | |
| pFCurrentMax | last peak maximum |
References SMS_Peak::fMag, sfloat, and SMS_MAX_NPEAKS.
Referenced by GetStartingPeak().
| static int GetStartingPeak | ( | int | iGuide, | |
| SMS_Guide * | pGuides, | |||
| int | nGuides, | |||
| SMS_Peak * | pSpectralPeaks, | |||
| sfloat * | pFCurrentMax | |||
| ) | [static] |
function to get a good starting peak for a track
| iGuide | current guide | |
| pGuides | array of guides | |
| nGuides | total number of guides | |
| pSpectralPeaks | array of peaks | |
| pFCurrentMax | current peak maximum |
References CheckForConflict(), SMS_Peak::fFreq, SMS_Guide::fFreq, GetNextMax(), GUIDE_BEG, SMS_Guide::iPeakChosen, and SMS_Guide::iStatus.
Referenced by sms_peakContinuation().

| int sms_peakContinuation | ( | int | iFrame, | |
| SMS_AnalParams * | pAnalParams | |||
| ) |
function to advance the guides through the next frame
the output is the frequency, magnitude, and phase tracks
| iFrame | current frame number | |
| pAnalParams | analysis parameters |
References SMS_AnalFrame::deterministic, SMS_AnalParams::fDefaultFundamental, SMS_Peak::fFreq, SMS_Guide::fFreq, SMS_AnalParams::fFreqDeviation, SMS_AnalFrame::fFundamental, SMS_AnalParams::fFundContToGuide, SMS_AnalParams::fHighestFreq, SMS_Peak::fMag, SMS_Guide::fMag, SMS_AnalParams::fPeakContToGuide, SMS_Peak::fPhase, GetBestPeak(), GetStartingPeak(), GUIDE_ACTIVE, GUIDE_DEAD, SMS_AnalParams::iDebugMode, SMS_AnalParams::iFormat, SMS_AnalFrame::iFrameNum, SMS_AnalParams::iMaxSleepingTime, SMS_Guide::iPeakChosen, SMS_Guide::iStatus, SMS_AnalParams::nGuides, SMS_Data::pFSinAmp, SMS_Data::pFSinFreq, SMS_Data::pFSinPha, SMS_AnalParams::ppFrames, SMS_AnalFrame::pSpectralPeaks, sfloat, SMS_DBG_ALL, SMS_DBG_PEAK_CONT, SMS_FORMAT_H, SMS_FORMAT_HP, SMS_FORMAT_IH, SMS_FORMAT_IHP, SMS_MALLOC, and SMS_OK.
Referenced by sms_analyze().

1.6.1