メインコンテンツ

このページは機械翻訳を使用して翻訳されました。最新版の英語を参照するには、ここをクリックします。

ソフトウェア定義無線を使用したDVB-S2送信機

この例では、第 2 世代デジタル ビデオ放送衛星(DVB-S2)物理レイヤー(PL) フレームを生成し、ソフトウェア定義無線 (SDR) デバイスを使用して無線で送信するか、ファイルに保存する方法を示します。追加の SDR ハードウェア デバイスを使用して、DVB-S2 Receiver Using Software-Defined Radio の例を使用して PL フレームをデコードできます。

はじめに

この例では、dvbs2WaveformGenerator System object ™ を使用して、指定されたパラメーターに構成されたDVB-S2ベースバンド波形を生成します。生成された波形を、SDRu トランスミッター System object および SDR ハードウェアを使用して無線で送信します。

この例では、これらの SDR がサポートされています。

  • ADALM-PLUTO(Analog Devices® ADALM-PLUTO 無線用の Communications Toolbox™ サポート パッケージが必要です)

  • USRP™ B200/B210/N200/N210/USRP2 (USRP™ 無線用の Communications Toolbox サポート パッケージが必要)

  • USRP™ N3xx/X3xx/X4xx (NI™ USRP™ 無線用の Wireless Testbench™ サポート パッケージが必要)

このセットアップの SDR デバイスは、指定された周波数と 1 Msps のシンボル レートでDVB-S2同相および直交位相 (IQ) サンプルを送信します。

この図は送信プロセスをまとめたものです。

DVB-S2 LDPCパリティ行列データセットをダウンロード

DVB-S2 LDPCパリティ マトリックスを含む MAT ファイルをロードします。MAT ファイルが MATLAB ® パス上にない場合は、次のコマンドを使用して MAT ファイルをダウンロードし、解凍します。

if ~exist('dvbs2xLDPCParityMatrices.mat','file')
    if ~exist('s2xLDPCParityMatrices.zip','file')
        url = 'https://ssd.mathworks.com/supportfiles/spc/satcom/DVB/s2xLDPCParityMatrices.zip';
        websave('s2xLDPCParityMatrices.zip',url);
        unzip('s2xLDPCParityMatrices.zip');
    end
    addpath('s2xLDPCParityMatrices');
end

設定例

DVB-S2波形をファイルに書き込んだり、SDR プラットフォームを使用して送信したりできます。SDR プラットフォームを使用して波形を送信するには、useSDRtrue に設定します。

useSDR = false;

useSDRtrue に設定する場合は、SDR 送信に必要な変数を設定します。

if useSDR
    txsim.DeviceName = "B200";
    txsim.RadioCenterFrequency = 915e6;
    txsim.RadioGain = 25;
end

DVB-S2構成セットアップ

dvbs2WaveformGenerator System object を初期化し、そのプロパティを設定します。

wg = dvbs2WaveformGenerator;
wg.FECFrame = "short";
wg.MODCOD = 24;                               % 32APSK 3/4
wg.DFL = getDFL(wg.MODCOD,wg.FECFrame);       % Default DFL is Kbch-80
wg.SamplesPerSymbol = 2
wg = 
  dvbs2WaveformGenerator with properties:

           StreamFormat: "TS"
        NumInputStreams: 1
               FECFrame: "short"
                 MODCOD: 24
                    DFL: 11632
          ScalingMethod: "outer radius as 1"
              HasPilots: 0
          RolloffFactor: 0.3500
    FilterSpanInSymbols: 10
       SamplesPerSymbol: 2

  Show all properties

入力データを生成する

最初のバイトが同期バイトであるパケット形式で入力データを生成します。複数のパケットを連結して、長さ DFL のフレームを作成します。50 フレームを生成します。

numFrames = 50;                                           % Number of PL frames to be processed
rng("default")
if strcmpi(wg.StreamFormat,"TS")
    syncBits = [0 1 0 0 0 1 1 1]';                        % Sync byte for TS packet is 47 Hex
    pktLen = 1496;                                        % UP length without sync bits is 1496
else
    if wg.UPL
        syncBits = randi([0 1],8,1);
        pktLen = wg.UPL - 8;                              % UP length without sync byte
    end
end
% For GS continuous streams
if strcmpi(wg.StreamFormat,"GS") && wg.UPL == 0
    numBits = wg.DFL*numFrames;
    data = randi([0 1],numBits,1);
else % For TS and GS packetized streams
    numPkts = wg.MinNumPackets*numFrames;
    txRawPkts = randi([0 1],pktLen,numPkts);
    txPkts = [repmat(syncBits,1,numPkts); txRawPkts];
    data = txPkts(:);
end

DVB-S2波形を生成する

パイロット支援モードでDVB-S2ベースバンド波形を生成します。

wg.HasPilots = true;
txOut = [wg(data); flushFilter(wg)];

送信用のSDRの設定

コンピュータに接続されている無線を検出します。この例では、txsim.DeviceName および findsdru 関数を使用して最初に見つかった SDR 無線を使用します。無線が利用可能かどうかを確認し、無線の種類を記録します。sdrtx または comm.SDRuTransmitter System object を初期化します。プラットフォーム、中心周波数、サンプル レート、ゲイン、その他の関連プロパティを設定します。SDR デバイスを使用してDVB-S2波形を無線で送信します。

Rsym = 1e6;
Fsamp = Rsym*wg.SamplesPerSymbol;                                                % Sampling rate in samples per second
if useSDR
    if matches(txsim.DeviceName,"Pluto")
        frameSize = getFrameSize(wg.FECFrame,wg.MODCOD)*wg.SamplesPerSymbol;
        radioTx = sdrtx("Pluto");
        radioTx.RadioID               = "usb:1";
        radioTx.CenterFrequency       = txsim.RadioCenterFrequency;
        radioTx.BasebandSampleRate    = Fsamp;
        radioTx.SamplesPerFrame       = frameSize;
        radioTx.Gain                  = txsim.RadioGain;
    elseif matches(txsim.DeviceName,"N3xx/X3xx/X410")
        savedRadioConfigurations = radioConfigurations;
        savedRadioConfigurationNames = [string({savedRadioConfigurations.Name})];
        % Specify the index of the saved radio configuration to be utilized
        % as the receiver
        radioIndex = 1;
        radio = savedRadioConfigurationNames(radioIndex);
        if ~exist("radioTx","var")
            radioTx = basebandTransmitter(radio);            
        end
        radioTx.RadioGain = txsim.RadioGain;
        radioTx.CenterFrequency = txsim.RadioCenterFrequency;
        radioTx.SampleRate = Fsamp;
    else
        connectedRadios = findsdru;
        rIdx = find(strcmp(txsim.DeviceName,{connectedRadios.Platform}));
        if strcmp(connectedRadios(rIdx).Status,"Success")
            usrpTx.Platform = connectedRadios(rIdx).Platform;
            switch usrpTx.Platform
                case {'B200','B210'}
                    usrpTx.SerialNum = connectedRadios(rIdx).SerialNum;
                    usrpTx.MasterClockRate = 20e6;
                case 'N200/N210/USRP2'
                    usrpTx.Address = connectedRadios(rIdx).IPAddress;
                    usrpTx.MasterClockRate = 100e6;
                otherwise
                    error("%s\n","Unsupported USRP device")
            end
        end
        usrpTx.Gain = txsim.RadioGain;                                            % In dB
        switch usrpTx.Platform
            case {'B200','B210'}
                radioTx = comm.SDRuTransmitter( ...
                    Platform             = usrpTx.Platform, ...
                    SerialNum            = usrpTx.SerialNum, ...
                    CenterFrequency      = txsim.RadioCenterFrequency, ...
                    MasterClockRate      = usrpTx.MasterClockRate, ...
                    InterpolationFactor  = usrpTx.MasterClockRate/Fsamp, ...
                    Gain                 = usrpTx.Gain);
            case 'N200/N210/USRP2'
                radioTx = comm.SDRuTransmitter(...
                    Platform            = usrpTx.Platform, ...
                    IPAddress           = usrpTx.Address, ...
                    CenterFrequency     = txsim.RadioCenterFrequency, ...
                    Gain                = usrpTx.Gain, ...
                    InterpolationFactor = usrpTx.MasterClockRate/Fsamp);
        end
    end
    numRepeatTxFrames = 1000;                                                     % Waveform is repeatedly transmitted in a loop
    disp(radioTx)
    fprintf("Starting transmission at Fs = %g MHz\n",Fsamp/1e6)
    if matches(txsim.DeviceName,"N3xx/X3xx/X410")
        FrameRate = Fsamp/length(txOut);
        transmitDuration = numRepeatTxFrames/FrameRate;
        transmit(radioTx,txOut,"continuous");
        pause(transmitDuration);
        stopTransmission(radioTx);
    else
        for frame = 1:numRepeatTxFrames
            underrun = radioTx(txOut);
            if (underrun)
                warning("Dropped samples.")
            end
        end
        release(radioTx)
    end

    fprintf("Transmission finished\n")
    

波形をファイルに保存

波形を MAT ファイルに保存します。

else
    fprintf("Writing DVB-S2 IQ samples into a file.\n")
    filename = "dvbs2ModCod" + string(wg.MODCOD) + "Waveform.mat";
    save(filename,'txOut')
end
Writing DVB-S2 IQ samples into a file.
release(wg)

さらなる探究

付随する例である DVB-S2 Receiver Using Software-Defined Radio 例を使用して、この例で送信された波形をデコードできます。

SDR のトラブルシューティング

参考文献

  1. ETSI規格 EN 302 307-1 V1.4.1(2014-11)。デジタル ビデオ放送 (DVB)。放送、インタラクティブ サービス、ニュース収集、およびその他のブロードバンド衛星アプリケーション向けの第 2 世代のフレーミング構造、チャネルコーディングおよび変調システム ( DVB-S2)

ローカル関数

function dfl = getDFL(modCod,fecFrame)
% Get data field length
if strcmp(fecFrame,"normal")
    nDefVal = [16008 21408 25728 32208 38688 43040 48408 51648 53840 57472 ...
        58192 38688 43040 48408 53840 57472 58192 43040 48408 51648 53840 ...
        57472 58192 48408 51648 53840 57472 58192] - 80;
else
    nDefVal = [3072 5232 6312 7032 9552 10632 11712 12432 13152 14232 0 ...
        9552 10632 11712 13152 14232 0 10632 11712 12432 13152 14232 0 11712 ...
        12432 13152 14232 0] - 80;
end
dfl = nDefVal(modCod);
end
function frameSize = getFrameSize(fecFrame,modCod)
% Get PL frame size
[modOrder,~,cwLen] = satcom.internal.dvbs.getS2PHYParams(modCod,fecFrame);
dataLen = cwLen/log2(modOrder);
% Pilot sequence and indices generation
slotLen = 90;
pilotBlkFreq = 16;                                                              % In slots
numPilotBlks = floor(dataLen/(slotLen*pilotBlkFreq));
if floor(dataLen/(slotLen*16)) == dataLen/(slotLen*pilotBlkFreq)
    numPilotBlks = numPilotBlks - 1;
end
pilotLen = numPilotBlks*36;                                                     % One pilot block contains 36 pilot symbols
frameSize = dataLen + pilotLen + slotLen;
end

参考

トピック