Engee 文档
Notebook

调制分析

在本例中,我们将分析建立不同调制方式星座的可能性。

以下是已实施的演示模型。

image_2.png

我们可以看到,该示例使用了 3 种调制方式。 1.正交相移键控(QPSK - quadrature phase-shift keying,或 4-PSK)使用在一个圆上等距离放置四个点的星座。 2.二进制相移键控(BPSK,二进制相移键控)。这种调制方式使用两个相移(一个为逻辑 1,一个为逻辑 0)。 3.正交调制(QAM,Quadrature Amplitude Modulation)--一种信号幅度调制,是两个频率相同的载波振荡之和,但相位相对移动 90 °(π/2 弧度)。

首先,让我们宣布每个符号的信息比特能量与噪声的频谱功率密度之比。

In [ ]:
Eb_No = 10;

现在让我们声明启动模型和执行模拟的函数。

In [ ]:
function run_model(name_model)
    Path = string(@__DIR__) * "/" * name_model * ".engee"
    
    if name_model in [m.name for m in engee.get_all_models()] # Проверка условия загрузки модели в ядро
        model = engee.open( name_model ) # Открыть модель
        model_output = engee.run( model, verbose=true ); # Запустить модель
    else
        model = engee.load( Path, force=true ) # Загрузить модель
        model_output = engee.run( model, verbose=true ); # Запустить модель
        engee.close( name_model, force=true ); # Закрыть модель
    end
    return model_output
end
Out[0]:
run_model (generic function with 1 method)
In [ ]:
run_model("demo_model")
Building...
Progress 0%
Progress 14%
Progress 44%
Progress 71%
Progress 99%
Progress 100%
Out[0]:
SimulationResult(
    "Selector-1.1" => WorkspaceArray{Vector{Float64}}("demo_model/Selector-1.1")
,
    "Selector.1" => WorkspaceArray{Vector{Float64}}("demo_model/Selector.1")
,
    "Selector-2.1" => WorkspaceArray{Vector{Float64}}("demo_model/Selector-2.1")

)

让我们对每种调制方式进行构建。我们从 QPSK 开始,然后构建 BPSK 和 8-PSK。

In [ ]:
qpsk = collect(qpsk);
qpsk_new = [(i...)+0 for i in qpsk.value];
In [ ]:
plot(title="QPSK")
plot!(ComplexF64.(qpsk_new), seriestype=:scatter)
plot!([0.75+0.75im, 0.75-0.75im, -0.75+0.75im, -0.75-0.75im], seriestype=:scatter)
Out[0]:
In [ ]:
bpsk = collect(bpsk);
bpsk_new = [(i...)+0 for i in bpsk.value];
In [ ]:
plot(title="BPSK")
plot!(ComplexF64.(bpsk_new), seriestype=:scatter)
plot!([-1+0im, 1+0im], seriestype=:scatter)
Out[0]:
In [ ]:
qam = collect(qam);
qam_new = [(i...)+0 for i in qam.value];
In [ ]:
plot(title="8-PSK")
plot!(ComplexF64.(qam_new), seriestype=:scatter)
plot!(cis.(2pi*[0:7...]/8), seriestype=:scatter)
Out[0]:

从上面的星座图中我们可以看到,前两种调制方式的点扩散更为明显。在前两种变体中,点的交叉区域明显较少,因此我们在 QPSK 和 BPSK 中接收到的误码值比使用 8-PSK 时少四倍。

结论

在本示例中,我们以 QPSK、BPSK 和 QAM 调制为例,介绍了构建和分析调制信号的方法。