TSpectrumPeaksAnalyzer Class

Header: Dew.Signal/SignalAnalysis.h · Cross-compiler
tObjectTSpectrumPeaksAnalyzer

class TSpectrumPeaksAnalyzer : public tObject;

Manages frequency spectrum peaks.

Marks, traces, interpolates and filters peaks of the owning spectrum. Because the spectrum is sampled only at the discrete bin frequencies f_k = k HzRes, the true frequency of a peak that falls between two bins is estimated by Interpolation.Method. For an off-bin tone of true frequency f_0 the nearest bin gives an error up to 1/2HzRes, while the interpolators reduce it: imNumeric / imQuinnSecond reach | f - f_0| lesssim 10^(-3) HzRes (rectangular window, no zero padding), and imQuadratic / imBarycentric / imJain a few 10^(-1) HzRes. imNumeric also returns the complex spectral value, so amplitude and phase are recovered as well. The phase reported by the numeric estimator is the DTFT phase arg X(f) rotated by a fixed quadrature term. TraceMethod controls how peaks are (re)marked: ptLargest marks the LargestCount strongest peaks (sorted by descending amplitude), ptAllPeaks marks every local maximum, and ptAmpltHarmonics / ptFreqHarmonics mark a fundamental and its harmonics. Methods other than imNumeric require a rectangular window with ZeroPadding = 1 and fall back to imNone otherwise.

Constructors

NameDescription
TSpectrumPeaksAnalyzer (2)

Destructors

NameDescription
~TSpectrumPeaksAnalyzer

Properties

NameTypeDescription
ActiveboolSet this property to false, to disable peak tracing, marking, interpolating and filtering when the Update method is called.
BandwidthHdoubleDefines the upper frequency that limits the search for peak.
BandwidthLdoubleDefines the lower frequency that limits the search for peak.
HarmonicsCountintDefines the number of harmonics to be marked, if TraceMethod is ptAmpltHarmonics or ptFreqHarmonics.
InterpolationTSpectrumPeakInterpolation*Defines the peak interpolation parameters.
LargestCountintDefines the number of largest peaks to mark, when TraceMethod = ptLargest.
LargestRatiodoubleDefines the ratio between the largest peak below which, the peak will not be considered.
ListTMarkList*A pointer to a list of all marked peaks (= TSpectrum.Marks). Read only.
NormalizedAmpltTNormalizedAmplt*Parameters for normalized amplitude.
NormalizedFreqTNormalizedFreq*Parameters for normalized frequency.
SpectrumTSpectrum*
TraceIntervaldoubleDefines the interval centered around the current position of peak in percentage of the bandwidth, within which the new position of the peak is to be searched for.
TraceMethodTPeakTraceMethodDefines the method used to trace and mark the peaks.
UseFullBandwidthboolSet this property to true, to assume that BandwidthL = 0 and BandwidthH equals the Nyquist frequency.

Methods

NameDescription
AddMarkReturns the index of the newly added mark at Freq.
AdjustCalled by Update method, if TraceMethod is ptNone.
AmpltHarmonicsCalled by the Update method, if TraceMethod is ptAmpltHarmonics.
Approximate (3)Finds the maximum of the peak at Freq and applies interpolation.
ApproximateComplexEst (2)Finds the maximum of the peak at Freq and applies interpolation.
Assign
FilterFilters the peak specified with Index.
FilterAllFilters all peaks.
FindAllPeaksCalled by Update method, if TraceMethod is ptAll.
FindFirstHarmonicCalled by Update method, if TraceMethod is ptFirstHarmonic.
FindFrequency (2)Finds the largest peak on the frequency interval.
FindFundamentalsLocates the first harmonics of a harmonic series.
FindLargestPeaksCalled by Update method, if TraceMethod is ptLargest.
FreqHarmonicsCalled by the Update method, if TraceMethod is ptFreqHarmonics.
GetMarks
LogAmpltConverts all peaks in dB. The associated spectrum must already be in logarithmic scale.
Marks
SetMarks
TraceCalled by the Update method, if TraceMethod is ptCurrent.
UpdateReestimates the order frequency and traces the peaks.

Operators

NameDescription
operator[]

Fields

NameTypeDescription
aIdxTVecInt *