Quality of Reconstruction Factor
measureQRF.RdComputes the quality of reconstruction factor of an estimate against a reference component, in decibels.
Details
$$\mathrm{QRF}(\hat s, s) = 20 \log_{10} \frac{\|s\|_2}{\|s - \hat s\|_2},$$
Inf when the estimate equals the reference.
Conditions
A reference of zero norm is outside the domain of the factor and stops the function with an error.
Examples
Time <- seq_len(1000) / 1000
Signal <- cos(2 * pi * 2 * Time) + 0.25 * cos(2 * pi * 24 * Time) +
0.0625 * cos(2 * pi * 288 * Time)
# The signal without its third tone, against the signal.
measureQRF(estimate = Signal - 0.0625 * cos(2 * pi * 288 * Time),
reference = Signal)
#> [1] 24.36163
measureQRF(estimate = Signal, reference = Signal)
#> [1] Inf