# GMSK Modem Simulation

Modems are an interface between theoretical physics and what can actually be built. The laws of physics set the limits of modem performance, and ultimately the amount of power you need for a certain bit error rate at a receiver. With the right algorithm, we can reach the limits of modem performance.

I think that’s kind of cool. There aren’t many fields where we can do the best the Universe can offer with 20th century technology. For example an internal combustion powered car is only about 15% efficient in converting chemical energy into motion. Solar cells on your roof are also about 15% efficient. We can’t do practical nuclear fusion. But 6 billion GSM mobile phones have a modem that is 100% efficient in converting received radio energy into bits. Unless you are my 16 year old son and keep forgetting to charge it.

GMSK Demodulators

This week I’ve been getting my head around GSM modems, and have worked up an Octave simulation of a couple of GMSK modems called gmsk.m. I started with this commonly used, non-coherent algorithm for GSM demodulation:

It has the advantage of being compatible with data-port capable legacy FM radios. However the best I can do in my simulations is 4.5dB away from theoretical. So I went looking for a better (hopefully close to ideal) demodulator. After some reading about MSK and GMSK and several days of confusion I eventually managed to make this “coherent” demodulator work (from the 1981 Murota paper listed below):

The adders on the RHS operate on bits and are implemented as XORs. I don’t fully understand the processing steps, especially the XORs at the end. It’s derived from an interpretation of MSK as a form of Offset QPSK, and mysteriously the inphase and quadrature arms operate at half the bit rate. But it works really well, so that’s enough for now.

The term “coherent” means we know the phase and frequency of the received signal. Coherent PSK and FSK modems have ideal performance, and often have matched filter and “integrate and dump” stages. The integrator can be seen as summing all of the energy in the bit, that’s the “Eb” part in Eb/No.

Here are the BER curves for the two modems on Eb/No and C/No scales:

The non-coherent modem is leaving a lot of bits on the floor. I also note my coherent demod outperforms the laws of physics at high Eb/No. I think I’ll build a warp drive next.

These simulations are some distance from a practical modem. The coherent demod needs clock and phase recovery and a lot of real world testing. However this is all quite possible (it’s in every mobile phone) and I’ve worked through similar steps for the HF FDMDV modem.

The non-coherent modem starts to perform (a BER of less than 1E-2) at a C/No of around 50dB. Curiously, this is where analog FM modulators start to get happy, as we discovered in the recent post on FSK over FM:

So the non-coherent demod is a nice match to legacy FM radios. I’m not sure if analog FM demodulators would be effective at lower C/Nos, even when teamed with the coherent demod. So I’m not convinced it’s possible to retrofit the coherent demod to existing FM radios, but it’s certainly realisable with a \$20 SDR dongle.

GMSK Demod Walk Through

This section has some screen shots of the two demodulators in action. First, here is (one half) of the GMSK signal spectrum:

The lower plot is the cumulative power, and 99% of the power is at the 2460 Hz point, making 4920 Hz bandwidth total. This gives a BW/Rs ratio of 1.02, close to the 1.04 expected for BT=0.5 GMSK at Rs=4800Hz. Nice.

Here is the “eye diagram” of the non-coherent demod:

This explains why the non coherent demod struggles. The low pass filter introduces significant inter-symbol interference. One symbol affects the next one as the LPF smears the symbols into each other. The eye is quiet narrow, even with no noise. A modest amount of noise can close the eye and we get bit errors. We can’t widen the filter as it will let more noise power in.

Here is the filter and integrator outputs from the coherent demod, one plot for the cos (real) and sin (imaginary) arms, with no channel noise:

Here are the integrator outputs with an Eb/No of 8dB:

It’s almost the same! Quite a lot of noise hardly bothers it, the BER is about 1E-3 (1 in 1 thousand)!

Ideas for VHF FreeDV

Now Codec 2 at 1200 bit/s sounds OK at an error rate of 1% (1E-2). Reading off the curves that’s a C/No of 42.5dBHz at 4800 bit/s or 42.5 – 10log10(4800/1200) = 36.5dBHz at 1200 bit/s. We need about 47dBHz for a 12dB SNR (ie scratchy) analog FM copy, or 50dBHz for a good FM copy. So that makes a proposed 1200 bit/s Codec 2 system 10dB ahead of analog FM. I can currently work the local repeater on 500mW with my \$50 FM HT, so this proposed system could do it on 50mW. Cool.

Hard to say if people will actually like using Codec 2 over VHF. Quality expectations are different to HF SSB, and people are used to high SNR FM. If most FM signals are strong the extra low level performance of a new digital mode may not be useful.

However if speech quality is king with all that system gain we could user higher quality speech codecs at a higher bit rate. If we have a good C/No we can increase the bit rate and hence speech quality, pushing against the “digital ceiling” in speech quality. One disadvantage of GMSK is that we can’t scale the bit rate in high C/No channels without making the RF bandwidth wider. mPSK is better at this, we can raise the number of bits/symbol and get a greater data throughput in the same RF bandwidth.

The extra system gain allows us to to explore other options. For example two channel TDMA would let us build diplexer free repeaters. This would require running the modem at 2400 bit/s, to get an average of 1200 bit/s. The hardware complexity would be similar to a \$50 HT. A 1 watt TDMA repeater based on SDR could be built for \$100, and do all sorts of clever things like form mesh networks with adjacent repeaters. Sprinkle them about hill tops in a humanitarian disaster situation, they could be treated as disposable.

I do think a new VHF DV mode must have some significant advantages to gain traction. Here are my current ideas:

1. An entry level implementation using freely downloadable software that runs on a PC, a sound card, and legacy FM radios through the mic/spkr ports. People get frustrated when told to upgrade all of their radio hardware to one particular brand to use DV.
2. Be an open standard, with a high performance open source implementation. No annoying closed source components, license fees, and encouraging rather than prohibiting experimentation.
3. Outperform legacy analog and digital modes.
4. Diplexor less, trivially simple repeaters.
5. Variable speech quality levels.

GMSK Modem Resources

Here is a good treatment of various Digital Modulation schemes from Atlanta RF. The Dsplog site has a good explanation and Octave simulation of MSK that helped me get my head around coherent (G)MSK demodulators. I implemented the demodulator from the 1981 IEEE Trans paper “GSM Modulation for Digital Radio Telephony” from Murota and friends. I think this paper originally proposed using GMSK for digital mobile phones.

## 9 thoughts on “GMSK Modem Simulation”

1. Great thoughts, can’t wait to see something working on VHF! I’ve been wanting to do something with TDMA over VHF for a while, the idea of being able to have a patent free open-source cell system really catches captures immigration! It allows you to make useful phone patches and the option to run messaging over it as well! Neat stuff.

One thing about SDRs from what I’ve seen is that the power usage is much higher than something that is hardware based. Maybe it would be possible to find a coherent GMSK ic that could do what you’re looking for. It opens up options for much lower power repeaters, something that really counts when it comes to solar powered locations. With the 14 off the grid wifi towers we keep going, we know that every amp counts.

1. david says:

Happy to work with you Daniel if you are interested in building up a TDMA VHF system. It probably is something missing from the open source ecology. I’m pretty sure we can build a low power SDR, for example the SM1000 draws less than 200mW for plenty of DSP.

1. I’ll email you some time in the next day or so. We have the manufacturing facilities to make this a reality at fairly low costs. I’d just like to see something happen for the better good of all! No more paying \$500+ dollars for a closed-source radio that boasts that it’s digital capabilities.

2. Guys….

I think you are on the right track here. I would like to help. Not a big programmer kinda guy, but I can and do build many bleeding age projects. Be happy to prototype a device or two

3. John says:

Hi David,

Looks like we have a team :).

IMHO one model should be fast ADC based. Maybe FPGA sigma-delta based?

John

4. Kevin N8VNR says:

I can only offer outside anecdotes and observations, but a little qualitative data never hurt.

> Hard to say if people will actually like using Codec 2 over VHF.

In my area, DMR (aka MotoTRBO) has gaining quite a footing. It uses the newer AMBE+ codec so the voice quality is superior to D-STAR, and the cost of the radios is much lower. If Codec2 can match that quality, you’ve got it in the bag. The other feature that gets big kudos (that D-STAR also has) is the network link capability. Any manner of digital makes this easier to my mind since you can just encapsulate the frames and ship them off.

> Quality expectations are different to HF SSB, and people are used to high SNR FM.

At Dayton 2013 a friend of mine put on the headphones for the FreeDV demo. He’s been doing sideband since all before I was born. As he listened for a minute he exclaimed “This is just as good as FM!” My guess is the lack of static and pitch offset were what he was keying on, and not so much what we think of as the difference in audio quality. That combined with the qualities mentioned above and I think you’re on to something.

> The extra system gain allows us to to explore other options. For example two channel TDMA would let us build diplexer free repeaters.

When TDMA gets mentioned, most people I talk to think of DMR and the fact that it has two timeslots on the same frequency. I hadn’t ever considered using it to eliminate the big ol’ cavity. That’s genius! At that point you could even conceivably run the repeater on a single frequency. Either way, there is one concern I thought of:

> This would require running the modem at 2400 bit/s, to get an average of 1200 bit/s.

Getting into your notion of perfectly efficient systems, even the best SDR can’t switch between TX and RX instantaneously. The time for that switch will rob you of bits, and that will have to be accounted for. I can imagine there being some resync issues in the mix too. Nonetheless, D-STAR has proved 4800 bit/s running in 6.25KHz (1/4 current analog FM) is quite desirable. I’d personally like to see at least the callsign of the transmitting station get included as metadata for convenience. Don’t necessarily need super-fancy routing. But I digress.

Thanks for these extremely informative posts! It’s like drinking from the firehose for me, but I’ll keep trying to stay caught up. 73!

1. david says:

Hi Kevin,

Thank you for your comments. Maybe the best way to nail the speech quality risk is to work out a way to rapidly prototype over the air in similar use cases to VHF FM. Same speakers, microphones, acoustic car noise.

Yes re effective bit rate over TDMA you are correct, we need some “guard time” either sides to account for tx/rx switching, so a (slightly) higher bit rate in practice. Actually sync will be helped by having a reference from the remote tx every x ms to lock our tx too.

Yes I agree there should be a meta data channel of some sort. For HF FreeDV we have a low rate text channel that you can process with a computer (e.g. extract callsign or use for spotting).

Cheers,

David

5. david says:

To build a TDMA prototype system one key need is RF design skills. For example someone who can design and prototype the front end for a SDR radio, and a 1W PA for 2m, fast tx/rx switching. Please contact me if you are interested!

– David

6. Nathan Myers says:

Not to quibble, but I am not aware of modems that perform quantum-computational operations on the photons that leave and enter the antenna. I also don’t know what those operations would be, or how much better they could perform than classical methods. But I suspect there is still quite a lot of room for improvement. I.e., nobody need despair that signal processing is a dead field with no more fundamental advances to be found.

Unfortunately it is not possible to simulate quantum computation in octave, even if you allow yourself extra time.