TSpectrumPeaksAnalyzer Class

type TSpectrumPeaksAnalyzer = class(TPersistent);

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.

Properties

NameTypeDescription
ActiveBooleanSet 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.
HarmonicsCountIntegerDefines the number of harmonics to be marked, if TraceMethod is ptAmpltHarmonics or ptFreqHarmonics.
InterpolationTSpectrumPeakInterpolationDefines the peak interpolation parameters.
ItemTMarkRecordDefault array property for the marks (=peaks) array.
LargestCountIntegerDefines 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.
ListTMarkListA pointer to a list of all marked peaks (= TSpectrum.Marks). Read only.
NormalizedAmpltTNormalizedAmpltParameters for normalized amplitude.
NormalizedFreqTNormalizedFreqParameters for normalized frequency.
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.
UseFullBandwidthBooleanSet 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.
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 for each value in Frequency parameter.
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.
LogAmpltConverts all peaks in dB. The associated spectrum must already be in logarithmic scale.
TraceCalled by the Update method, if TraceMethod is ptCurrent.
UpdateReestimates the order frequency and traces the peaks.