Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could the crc error correction return wrong result? #35

Closed
flux242 opened this issue Dec 4, 2016 · 7 comments
Closed

could the crc error correction return wrong result? #35

flux242 opened this issue Dec 4, 2016 · 7 comments

Comments

@flux242
Copy link

flux242 commented Dec 4, 2016

that is not discarded?

{"group":"2A","pi":"0x141D","prog_type":"No PTY","radiotext":"Jetzt on air: ** KUNGS feat. JAMIE N COMMONS ** DONT YOU KNOW","tp":true}
{"group":"2A","pi":"0x141D","prog_type":"No PTY","radiotext":"Jetzt on air: ** KUNGS feat. JAMIE N COMMONS ** DOOL YOU KNOW","tp":true}
{"group":"2A","pi":"0x141D","prog_type":"No PTY","radiotext":"Jetzt on air: ** KUNGS feat. JAMIE N COMMONS ** DONT YOU KNOW","tp":true}

DONT -> DOOL -> DONT

@windytan
Copy link
Owner

windytan commented Dec 4, 2016

Weird indeed. I'll need to write tests for the error detector.

This much is said about the RDS error protection scheme:

  • Detects all single and double bit errors in a block.
  • Detects any single error burst spanning 10 bits or less.
  • Detects about 99.8% of bursts spanning 11 bits and about 99.9% of all longer bursts.

Maybe it could be a long error burst (like 11000000011)?

@flux242
Copy link
Author

flux242 commented Dec 5, 2016

I let my computer record the bit stream tonight for 5-6 hours but I couldn't reproduce the problem unfortunately. This is somehow related to the noise introduced by the usb cable, dongle, computer and antenna constellation.

I have recorded samples with cases when the radiotext message is not fully displayed first, then more symbols are shown and then the full message is shown. Maybe it's somehow related but maybe it's ok

I will try to record more bit stream samples trying to catch similar cases.

@windytan
Copy link
Owner

I tested the error detector with a million known error vectors, and it works as advertised. (However, error correction doesn't do anything for some reason. Erroneous blocks are discarded however).

This means that 0.1 - 0.2 % of long error bursts go undetected, so there will inevitably be some errors when the signal is very noisy.

@windytan
Copy link
Owner

Just for the record - this is affected by the correction algorithm.

Here's a test run to measure error detection rates for errors of different length when correction is disabled vs. enabled for 1-2 bit errors:

burstLen don't correct correct 1bit correct 1-2bit
1 100.0 % 100.0 % 100.0 %
2 100.0 % 100.0 % 100.0 %
3 100.0 % 100.0 % 100.0 %
4 100.0 % 100.0 % 100.0 %
5 100.0 % 100.0 % 100.0 %
6 100.0 % 97.4 % 89.0 %
7 100.0 % 99.8 % 98.6 %
8 100.0 % 98.2 % 98.3 %
9 100.0 % 99.0 % 98.1 %
10 100.0 % 97.3 % 96.5 %
11 99.8 % 97.1 % 94.6 %
12 99.9 % 97.5 % 95.7 %
13 99.9 % 97.5 % 95.7 %
...

This shows that error detection rates are somewhat impacted by enabling error correction. This will result in some errors slipping through. I think it's an expected tradeoff of the error protection scheme used.

@flux242
Copy link
Author

flux242 commented Dec 14, 2016

hm, interesting distribution. So what's the default currently? Don't correct, discard?

@windytan
Copy link
Owner

windytan commented Dec 14, 2016

Currently (at least in the latest commit) errors of 1 or 2 bits will be corrected, and uncorrectable blocks are discarded. I based this on Kopitz & Marks 1999: "RDS: The Radio Data System", p. 224: "...the error-correction system should be enabled, but should be restricted by attempting to correct bursts of errors spanning one or two bits."

1-bit errors should not be very common because of delta encoding; perhaps 2-bit errors only would suffice.

@windytan
Copy link
Owner

Will reopen if it causes further problems :) The restrictions mentioned in that document seem to keep it in order.

windytan added a commit that referenced this issue Jun 20, 2024
* With --no-fec you will see fewer errors in noisy conditions but also fewer blocks.
* Also, testability improvements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants