News for hackers. Stuff that matters.
Re:Norway switches off FM radio, but a station is defying go... by pjc50 on Friday December 15, 2017 @11:33AM (#15932965)
Some buffering is probably inherent. The protocol is at http://www.etsi.org/deliver/etsi_en/300400_300499/300401/01.... if anyone wants a long read.

At a guess the critical number is "The transmitted signal has a frame structure of 96 ms duration (Transmission mode I)", which implies that most systems will need to buffer at least that much and probably several times that.

Theoretically you could decode all the signals in a particular DAB multiplex at the same time (e.g. all the BBC stations are on the same multiplex in the UK), and then change instantly between them, but I don't think consumer recievers let you do this. Might be able to try it with SDR.

Re:Norway switches off FM radio, but a station is defying go... by baobrien on Friday December 15, 2017 @01:26PM (#15933876)
It's probably also doing some kind of interleaving along with forward error correction, and would need to collect a few frames before it can start decoding. There's a section on interleaving under convolution coding in the spec, but it looked pretty complicated and I've got no idea how stations are usually configured.
Re:Norway switches off FM radio, but a station is defying go... by icebraining on Friday December 15, 2017 @11:41AM (#15933032)
I'm quite ignorant about wireless signals, but do you know why they chose 96ms? That sounds huge for a single frame.

I guess an optimization the receivers could do is decode all the presets, then at least switching between those would be instant.

Re:Norway switches off FM radio, but a station is defying go... by mikeash on Friday December 15, 2017 @11:50AM (#15933097)
There's a tradeoff between latency and efficiency. Longer frames can compress better, and you amortize any per-frame header over more stuff. Shorter frames incur more overhead from headers, and may not compress as well. 96ms seems like a reasonable choice for a realtimeish system without tight latency requirements, but I couldn't say why they chose exactly that number.
Re:Norway switches off FM radio, but a station is defying go... by rlpb on Friday December 15, 2017 @12:06PM (#15933204)
> ...but I couldn't say why they chose exactly that number.

I would speculate that it's because it's fairly close to 100 and is also divisible by a fairly high power of 2 (32). Buffer management is easier (less arithmetic) when using powers of 2.

I could be completely wrong, but 96 is the kind of number that crops up in computing quite a bit for this reason. Having said that, the number of samples may be more important than the number of milliseconds.

Re:Norway switches off FM radio, but a station is defying go... by mikeash on Friday December 15, 2017 @12:42PM (#15933495)
I dug into the PDF above and and it looks like it's mostly due to the underlying codec. They use MPEG-1 Audio Layer II, which has a frame size of 1152 samples. They support 24kHz or 48kHz sample rates, which means that a 1152 sample frame is either 48ms or 24ms. Apparently they stuff 2 or 4 of these audio frames into each transmission frame.
Re:Norway switches off FM radio, but a station is defying go... by rlpb on Friday December 15, 2017 @12:49PM (#15933568)
That just punts the question. Why does the codec have a frame size of 1152 samples? Is it because that brings the frame size to sums of powers of two milliseconds? :)
Re:Norway switches off FM radio, but a station is defying go... by mikeash on Friday December 15, 2017 @01:23PM (#15933859)
Damn, I was hoping nobody would notice that.

I mean, good point. I dug a bit farther and found this document which discusses the design in some detail:

https://web.archive.org/web/20040919073530/http://www.cs.col...

It looks like MP1 has 32 subbands and works on 12 samples each, which results in a frame size of 384. MP2 works on 3 groups of 12 samples for each subband, resulting in 1152 samples.

Of course this just punts it to the question of why 32, 12, and 3? To which I can only answer: quick, look behind you! <runs away>

At least the mystery numbers are smaller.

But seriously, I'm at (beyond) the limits of my understanding of this stuff, so if anyone with more knowledge would care to chime in and explain those, I'd be most interested to know.