
GOLD码与Walsh码
5星
- 浏览量: 0
- 大小:None
- 文件类型:PPT
简介:
GOLD码的生成过程及其相关特性
该函数用于生成长度为$a$的最大长度伪随机序列$m_\text{seq}$。令输入向量$a$的长度为$n$,则其中最大可能长度为$2^{n}-1$。其中序列的最大可能长度由式(\ref{eq:1})确定:
$$
N=2^n-1 \tag{1}
$$
其中序列的最大可能长度为$N=2^{n}-1$。
令初始状态寄存器向量$\text{reg}$由前$n-1$位全零和最后一位置一组成,即:
$$
\text{reg}=[\underbrace{0,\dots,0}_{n-1 \text{个}} 1]
$$
序列的第一个输出码元$m_\text{seq}(1)$等于当前寄存器的状态$\text reg(n)$。
对于$i=2$到$N$的循环,计算新状态向量$\text newre$:
$$
\text newre(1)= \mod(\sum(a \cdot \text reg), 2)
$$
然后将当前状态$\text reg$更新为新的寄存器状态$\text newre$
序列的第$i$个输出码元$m_\text{seq}(i)$等于新状态寄存器的最后一位值:
$$
m_\text{seq}(i)=\text reg(n)
$$
结束语句。
清除所有变量;
分别生成mseq1和mseq2,参数分别为[1 0 0 0 0 1]和[1 1 0 0 1 1];
计算N=63的值;
从i=0到N−1遍历每个索引:
将mseq2向右循环移位i次,并与当前mseq2进行异或运算,结果存入gseq数组中的第i+1行;
获取gseq矩阵的大小为[m,n];
绘制每一行的数据点,使用阶梯图形式展示;
设置坐标轴范围为x从0到n−1,y从-0.2到1.2。
s1 = gseq(1, :);
Compute the length of s1.
Extend s1 by copying its first L elements to positions L+1 through 2L.
Scale each element in s1 by a factor of two and subtract one from every entry.
Initialize an array corr1 with length equal to that of s1. For each integer delta ranging from 1 to the length of s1:
Shift the elements of s1 by delta positions, creating a new array s2 composed of the shifted elements.
Compute the sum of element-wise multiplication between corresponding entries in s1 and s2 for this shift value.
Plot corr1 against the shift values.
全部评论 (0)


