0

我遵循了精彩的 GNURadio 指导教程 PSK 解调: https ://wiki.gnuradio.org/index.php/Guided_Tutorial_PSK_Demodulation

我创建了一个非常简单的 DBPSK 调制器 在此处输入图像描述

我输入了一系列正在滑动的位。所以我输入的第一个字节是 0x01,下一个字节是 0x02、0x04、0x08 等等。这是高清的输出:

00000000  00 00 ac 0e d0 f0 20 40  81 02 04 08 10 00 20 40  |...... @...... @|
00000010  81 02 04 08 10 00 20 40  81 02 04 08 10 00 20 40  |...... @...... @|
*
00015000

前几个字节是垃圾,但随后您可以看到模式。查看第二行,您会看到:0x81、0x02、0x04、0x08、0x10、0x00、0x20、0x40、0x81

行走的就在那里,但在 0x10 之后,PSK 解调器接收到 0x00,然后几个字节后接收到 0x81。似乎时间恢复已关闭。

有没有其他人见过这样的事情?

4

1 回答 1

0

好的,我想通了。下面是我的 DBPSK 调制。 在此处输入图像描述

如果你让它运行,BER 将继续下降。有些事情要记住。PSK Mod 采用 8 位值(或者也可能是 short 或 int)。它抓取并调制它们。然后 PSK Demod 也会这样做。如果将其保存到文件中,您将无法获得确切的位。您将需要移动这些位以对齐它们。我添加了 Vector Insert 块来生成各种序言。

然后我写了一些 Python 来找到我的序言:

import numpy as np
import matplotlib.pyplot as plt


def findPreamble(preamble, x):
    for i in range(0, len(x) - len(preamble)):
        check = 0
        for j in range(0, len(preamble)):
            check += x[i + j] - preamble[j]
        if (check == 0):
            print("Found a preamble at {0}".format(i))
            x = x[i + len(preamble)::]
            break
    return check == 0, x

def shiftBits(x):
    for i in range (0, len(x) - 1):
        a = x[i]
        a = a << 1
        if x[i + 1] & 0x80:
            a = a | 1

        x[i] = (a & 0xFF)
    return x

f = open('test.bits', 'rb')
x = f.read();
f.close()

preamble = [0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08]
searchForBit = True
x = np.frombuffer(x, dtype='uint8')
x = x.astype('int')
print(x)

while searchForBit:

    x = shiftBits(x)
    print(x)
    found, y = findPreamble(preamble, x)
    if found:
        searchForBit = False
        y = y.astype('uint8')
        f = open('test.bits', 'wb')
        f.write(y)
        f.close()
于 2018-03-06T02:10:12.073 回答