好的,我想通了。下面是我的 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()