detector_new
Correlation-based pattern detector.
Namespace: dsp::fourier
Prototype
sptr<Detecteur> detector_new(const DetectorConfig &config=DetectorConfig())
Parameters
config | Configuration structure |
Returns
Filter cfloat \(\to\) float, that take as input samples, and produces as output, the normalized correlation with the pattern.
Description
This block will compute the normalized correlation between a streaming signal \((x_k)\) and a fixed pattern \((h_k)\) of dimension \(M\) :
The \(y_n\) are thus between 0 and 1, and will be equal to 1 only if the signal is exactly equal to the pattern (up to some scale factor) on the interval \([n-M+1\dots n]\).
The computing being done in the frequency domain through the Overlap-And-Add technique (see filter_fft()), the complexity is of order \(\log_2 M\) operations per sample (if \(M\) is a power of 2).
This block will:
- Return, as output, the correlation signal (green signal in the example below),
Call a user callback whenever the correlation is above a configurable threshold. As parameters of this callback, the following informations are given (see the structure Detection):
- Peak value of the normalized correlation,
- Real gain of the sinal (amplitude ratio between the received signal and the expected pattern),
- Relative phase of the received signal (compared to the expected pattern),
- Noise standard deviation,
- Estimated SNR.