```
In [1]:
```%matplotlib inline
import numpy as np
import scipy.signal
import matplotlib.pyplot as plt

We load a file containing the relevant GMSK transmission that contains all 4 SSDV frames. The recording was done at the Dwingeloo radiotelescope and can be obtained here. For convenience, a small piece of that recording contain the SSDV transmission can be downloaded at dslwp_photo_short.c64. This file is then used in the cell below (the path should be adjusted to the location of the file).

The 250bps GMSK signal is converted down to baseband and lowpass filtered to 800Hz.

```
In [2]:
```x = np.fromfile('/home/daniel/dslwp_photo_short.c64', dtype='complex64')
fs = 40e3
f = 2410
x = x * np.exp(-1j*2*np.pi*np.arange(x.size)*f/fs)
h = scipy.signal.firwin(1000, 0.01)
x = scipy.signal.lfilter(h, 1, x)

```
In [3]:
```plt.plot(np.diff(np.unwrap(np.angle(x[500000:510000]))))
plt.ylim([-0.02,0.02]);

```
```

```
In [4]:
```phase = 50
softbits = np.diff(np.unwrap(np.angle(x)))[phase::160]
plt.plot(softbits,'.')
plt.ylim([-0.02,0.02]);

```
```

Soft bits are now converted to hard bits.

```
In [5]:
```bits = (softbits > 0)*1

```
In [6]:
```asm = np.unpackbits(np.array([0x03,0x47,0x76,0xC7,0x27,0x28,0x95,0xB0], dtype='uint8'))
asm_diff = asm[:-1] ^ asm[1:]
asm_diff[1::2] ^= 1

```
In [7]:
```asm_corr = scipy.signal.correlate(2*bits-1, 2*asm_diff.astype('float')-1)
plt.plot(asm_corr)

```
Out[7]:
```

We now look at the distances between the ASMs. DSLWP-B uses Turbo codewords of 3576 symbols. Since the ASM is 64 bits long and Turbo codewords are transmitted back-to-back, without any gap between them, we expect a distance of 3640 bits.

Note that before we have stated that the ASM is 63 bits long. This is because the GMSK precoder is differential, so the first bit of the ASM is not defined, as it depends on the preceding data. Thus, we only use the 63 bits of the ASM that are fixed when doing the correlation.

Below we show the distances between the ASMs.

```
In [8]:
```np.diff(np.where(asm_corr > 40)[0])

```
Out[8]:
```

We see that the distance between ASM 0 and ASM 1 is correct. Likewise, the distance between the ASM 2 and ASM 3 is correct. However, the distance between ASM 1 and ASM 2 is only 3597 bits. This means that the second Turbo codeword was somehow cut short and not transmitted completely (43 bits are missing).

In a similar manner, the fourth Turbo codeword was also cut short. Indeed, the transmitter goes off before the Turbo codeword has been transmitted completely. Indeed, the distance between ASM 3 and the end of the file is:

```
In [9]:
```asm_corr.size-np.where(asm_corr > 40)[0][-1]

```
Out[9]:
```

```
In [10]:
```plt.plot(np.diff(np.unwrap(np.angle(x))))
plt.title('Instantaneous frequency')
plt.ylabel('Frequency (radians/sample)')
plt.xlabel('Samples');

```
```