Documentation

Hadamard Code Generator

Generate Hadamard code from orthogonal set of codes

图书馆

Sequence Generators sublibrary of Comm Sources

Description

这Hadamard Code Generator block generates a Hadamard code from a Hadamard matrix, whose rows form an orthogonal set of codes. Orthogonal codes can be used for spreading in communication systems in which the receiver is perfectly synchronized with the transmitter. In these systems, the despreading operation is ideal, as the codes are decorrelated completely.

Hadamard代码是Hadamard矩阵的单个行。Hadamard矩阵是正方形矩阵,其条目为+1或-1,其行和列是相互正交的。如果N是2的非负能力,N-经过-NHadamard matrix, denotedHN, is defined recursively as follows.

H 1 = [ 1 ] H 2 N = [ H N H N H N H N ]

n-b-n hadamard矩阵具有

HNHNT=NIN

whereIN是个N-经过-Nidentity matrix.

Hadamard代码生成器块输出一行HN。这output is bipolar. You specify the length of the code,N,由Code length范围。这Code lengthmust be a power of 2. You specify the index of the row of the Hadamard matrix, which is an integer in the range [0, 1, ... ,N-1],由Code index范围。

Parameters

Code length

A positive integer that is a power of two specifying the length of the Hadamard code.

Code index

An integer between 0 andN-1, whereN是个Code length, specifying a row of the Hadamard matrix.

Sample time

输出信号的每个样本之间的时间。指定为非负实际标量。

Samples per frame

这number of samples in one column of the output signal. Specify as a positive integer scalar.

Note

这time between output updates is equal to the product ofSamples per frameSample time。例如,如果Sample timeSamples per frameequal one, the block outputs a sample every second. IfSamples per frame增加到10,然后每10秒输出10 x-1矢量。这确保等效输出率不取决于Samples per frame范围。

Output data type

这output type of the block can be specified as anint8或者double。By default, the block sets this todouble

模拟使用

Select the simulation mode.

代码生成

在第一个模型运行中,模拟和生成代码。如果块的结构不变,则随后的模型运行不会再生代码。

如果the simulation mode is代码生成, System objects corresponding to the blocks accept a maximum of nine inputs.

解释执行

在不生成代码的情况下模拟模型。此选项会导致更快的启动时间,但可以减慢后续的仿真性能。

Examples

正交扩展 - 单用户与两用户比较

This example model compares a single-user system vs. a two-user data transmission system with the two data streams being independently spread by different orthogonal codes.

这model uses random binary data which is BPSK modulated (real), spread by Hadamard codes of length 64 and then transmitted over an AWGN channel. The receiver consists of a despreader followed by a BPSK demodulator. Open the model here:hadamard_block_example1

modelname ='hadamard_block_example1';Open_System(modelName);SIM(modelName);

对于相同的数据和频道设置,该模型计算了单用户传输的性能。

Note that for the individual users, the error rates are exactly the same in both cases. This shows that perfect despreading is possible due to the ideal cross-correlation properties of the Hadamard codes.

To experiment with this model further, specify a differentCode length或者Code index让单个用户检查相对性能的变化。

close_system(modelname, 0);

Orthogonal Spreading - Multipath Scenario

此示例模型考虑了一个单用户系统,其中信号在多个路径上传输。这类似于移动通道环境,该环境通过多个路径接收信号,每条路径都有不同的幅度和延迟。为了利用多径传输,接收器采用多样性接收,将独立路径连贯地结合在一起。

Note, to keep the system simple, no shadowing effects are considered and the receiver has先验了解路径数量及其各自的延误。在此处打开模型:hadamard_block_example2

modelname ='hadamard_block_example2';Open_System(modelName);SIM(modelName);

For the data transmission with the same spreading code that was used in the first example, we now see deterioration in performance when compared with that example (compare the 180 errors with 81 in the previous case). This can be attributed to the non-ideal auto-correlation values of the orthogonal spreading codes chosen, which prevents perfect resolution of the individual paths. Consequently, we don't see the merits of diversity combining.

要进一步尝试此模型,请尝试选择其他路径延迟以查看相同代码的性能如何变化。还可以尝试使用相同延迟的不同代码。

close_system(modelname, 0);

Extended Capabilities

在R2006a之前引入