使用SDR-B1进行WLAN MIMO发射测试

1. 概述

SDR-B1是正旗通信推出的软件无线电平台,采用Xilinx Zynq XC7Z045 FPGA及ADI AD9363无线收发芯片,本文给出了使用SDR-B1进行WLAN MIMO发射测试的过程。

2. 测试仪表

  • NI PCIe-5644R
  • GWINSTEK GPD-3303S

3. 测试软件

  • Matlab R2024a(AMD SoC Support from SoC Blockset)
  • NI WLAN Analysis Toolkit

4. 测试设置

按照如下的方式进行连接,PC1与SDR-B1通过网线相连接,PC1的IP地址设置为192.168.2.30,用于运行Matlab程序,向SDR-B1发送波形;SDR-B1的IP地址设置为192.168.2.55,并烧写我司提供的专用测试固件;PC2运行NI WLAN Analysis Toolkit,并与NI PCIe-5644R通过雷电线连接。

5. 测试过程

(1) 为SDR-B1上电,启动完成后,输入用户名与密码(均为root),输入以下命令:

ifconfig eth0 192.168.2.55

(2) 使用Matlab打开wlan_tx_ht.m,并在最后一行处设置断点,如下图

(3) 点击运行,可以在命令窗口中观察到如下信息:

Generating WLAN transmit waveform:
## Establishing connection to hardware. This process can take several seconds.
## Waveform transmission has started successfully and will repeat indefinitely.
## Call the release method to stop the transmission.

此时可以在NI WLAN Analysis Toolkit中观察到对应的分析结果,如下图

可以看到,仪器已经识别出来此时的发射信号是双流信号,也就是MIMO,并且当前是第一条流。

(4) 将PCIe-5644R连接至SDR-B1的TX2端口,仪器可以识别到此时是第二条流的信号,如下图,软件中使用了不同的颜色代表两条流的分析结果。

(5) 在Matlab中点击继续,停止SDR-B1的发射,测试结束。

6. 测试代码

wlan_tx_ht.m的内容如下:


clear;

cfgPHY = wlanHTConfig(MCS=15);  

msduLength = 2304;                                      % MSDU length in bytes
numMSDUs = 10;

txData = zeros(1,msduLength);

for i = 1:msduLength
    txData(i) = randi([0 255]);
end

data = zeros(0,1);

for i=0:numMSDUs-1

    frameBody = txData;

    % Create MAC frame configuration object and configure sequence number
    cfgMAC = wlanMACFrameConfig(FrameType='Data',FrameFormat="HT-Mixed",MPDUAggregation=true,SequenceNumber=i);

    % Generate MPDU
    [psdu, lengthMPDU]= wlanMACFrame(frameBody,cfgMAC,cfgPHY,OutputFormat='bits');

    % Concatenate PSDUs for waveform generation
    data = [data; psdu]; %#ok

end

HTcfg = wlanHTConfig;                               % Create packet configuration
HTcfg.MCS = 15;                                     % Modulation: 64QAM Rate: 5/6
HTcfg.NumTransmitAntennas = 2;                      % Number of transmit antenna
HTcfg.NumSpaceTimeStreams = 2;
chanBW = HTcfg.ChannelBandwidth;
HTcfg.PSDULength = lengthMPDU;                      % Set the PSDU length

scramblerInitialization = randi([1 127],numMSDUs,1);

osf = 1.5;
sampleRate = wlanSampleRate(HTcfg);                 % Nominal sample rate in Hz
txWaveform = wlanWaveformGenerator(data,HTcfg, ...
    NumPackets=numMSDUs,IdleTime=20e-6, ...
    ScramblerInitialization=scramblerInitialization,...
    OversamplingFactor=osf);

% Transmitter properties
sdrTransmitter = sdrtx('AD936x');
sdrTransmitter.IPAddress = '192.168.2.55';
sdrTransmitter.ChannelMapping = [1,2];
sdrTransmitter.BasebandSampleRate = sampleRate*osf;
sdrTransmitter.CenterFrequency = 2.4e9;
sdrTransmitter.Gain = -10;

fprintf('\nGenerating WLAN transmit waveform:\n')

% Scale the normalized signal to avoid saturation of RF stages
powerScaleFactor = 0.8;

txWaveform1 = txWaveform(:,1);
txWaveform2 = txWaveform(:,2);

txWaveform1 = txWaveform1.*(1/max(abs(txWaveform1))*powerScaleFactor);
txWaveform2 = txWaveform2.*(1/max(abs(txWaveform2))*powerScaleFactor);

% Transmit RF waveform
transmitRepeat(sdrTransmitter, [txWaveform1, txWaveform2]);
release(sdrTransmitter);