OFDM packet detection

       本文分析了一种基于自相关方法的WLAN数据包起始位置检测算法。该算法通过计算信号的相关性和功率,估计信噪比,并使用阈值检测来定位数据包的起始位置。

1. 算法概述

该算法的核心思想是通过检测信号的相关性和功率,计算信噪比(SNR),并使用阈值检测来确定WLAN数据包的起始位置。主要步骤包括:

1. 计算信号的相关性。

2. 计算信号的功率。

3. 估计信噪比。

4. 使用阈值检测确定起始位置。

2. 公式分析

2.1 相关性计算

相关性计算用于检测信号的相似性:

C = \sum_{i=1}^{\text{P}} \text{conj}(rx_{\text{Delayed}}[i]) \cdot rx[i]

计算延迟信号 rxDelayed 和原始信号 rx 的复共轭乘积的和。

 2.2 归一化相关性

归一化相关性用于后续处理:

CS = \frac{C}{\text{symbolLength}}

 将相关性结果 C 归一化。

2.3 功率计算

功率计算用于估计信号的能量:

P = \sum_{i=1}^{\text{P}} \frac{|\text{rx}_{\text{Delayed}}[i]|^2 + |rx[i]|^2}{2 \cdot \text{symbolLength}}

 计算延迟信号和原始信号的功率平均值,并进行归一化。

 2.4 归一化功率

归一化功率用于避免除零错误:

PS = P + \text{pNoise}

 将功率值 P 归一化,并加上一个很小的噪声值 pNoise。

2.5 信噪比估计

信噪比估计用于检测信号的起始位置:

M_n = \frac{|CS|^2}{PS^2}

 计算信噪比,用于后续的阈值检测。

  2.6 阈值检测

阈值检测用于确定起始位置:

N = \begin{cases} 1 & \text{if } M_n > \text{threshold} \\ 0 & \text{otherwise} \end{cases}

通过比较信噪比估计值 `Mn` 和阈值 `threshold`,生成二进制向量 `N`。

2.7 起始位置检测

起始位置检测用于定位数据包的起始位置:

\text{packetStart} = \begin{cases} \text{found}(N) - 1 & \text{if } \text{sum}(N) \geq \text{symbolLength} \cdot 1.5 \\ \text{null} & \text{otherwise} \end{cases}

- **解释**:如果检测到的峰值数量足够多,则认为检测到了一个可能的起始位置,并检查后续峰值之间的距离是否合理。

 3. 总结

该算法通过以下步骤实现WLAN数据包起始位置的检测:

1. 计算信号的相关性和功率。

2. 估计信噪比。

3. 使用阈值检测确定起始位置。

4. 检查后续峰值之间的距离以避免误判。

 reference code

correlationLength = lenLSym - (symbolLength*2);
pNoise = eps; % Adding noise to avoid the divide by zero
weights = ones(symbolLength, 1);
index = 1:correlationLength + 1;

packetStart = []; % Initialize output

% Shift data for correlation
rxDelayed = rxSig(symbolLength + 1:end , :); % Delayed samples
rx = rxSig(1:end-symbolLength, :); % Actual samples

% Sum output on multiple receive antennas
C = sum(filter(weights, 1,(conj(rxDelayed).*rx)), 2);
CS = C(symbolLength:end)./symbolLength;

% Sum output on multiple receive antennas
P = sum(filter(weights, 1, (abs(rxDelayed).^2+abs(rx).^2)/2)./symbolLength, 2);

PS = P(symbolLength:end) + pNoise;

Mn = abs(CS).^2./PS.^2;
N = Mn > threshold;

if (sum(N) >= symbolLength*1.5)
    found = index(N);
    packetStart = found(1) - 1;
    % Check the relative distance between peaks relative to the first
    % peak. If this exceed three times the symbol length then the
    % packet is not detected.
    if sum((found(2:symbolLength) - found(1))>symbolLength*3)
        packetStart = [];
    end
end

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值