Achilleas,
Thank you for the detailed analysis of the threshold parameter - I know I have been tripped up using this block in the past and made various workarounds to have a settable threshold. It is probably worth updating the documentation and parameter descriptions in the code so that users - just created an issue (https://github.com/gnuradio/gnuradio/issues/4273) in the github tracker so we don't lose sight of this.
Thanks,
Josh
On Fri, Feb 19, 2021 at 8:34 PM Achilleas Anastasopoulos <anastas@umich.edu> wrote:
Hi all,I have been playing a bit with the "corr_est_cc" block and I was banging my head to understand the meaning of the parameter "threshold".In all examples it seems to be a number VERY close to 1.The documentation is cryptic:" Threshold of correlator, relative to a 100% correlation (1.0). Default is 0.9."Upon inspection of the code it is clear that there is a mixup between thequantities "threshold" and "1-probability of false alarm".The code definesd_pfa = -logf(1.0f-threshold);which is clearly not the intended use: the pfa cannot be the log of something!In fact, what is meant is that===> THRESHOLD = -logf(PFA);The smaller the PFA the larger the threshold should be.This explains why we need to put a number close to 1 as "threshold" (which is actually 1-PFA).Further down the code it shows how THRESHOLD is meant to be used:float detection = 0;
for(int i = 0; i < noutput_items; i++) {
detection += d_corr_mag[i];
}
detection /= static_cast<float>(noutput_items);
detection *= d_pfa; <========================Clearly, the average magnitude is evaluated and then it is multiplied by "d_pfa"which is meaningless, unless (as mentioned above) you interpret this asdetection *= THRESHOLD;To summarize:-------------------What is shown as "pfa" in the code is actually a THRESHOLDWhat is shown as "threshold" in the code is actually 1-PFA.The user actually inputs 1-PFA (erroneously named "threshold").I hope this will help anyone having similar issues understanding how this block works.bestAchilleas
No comments:
Post a Comment