メインコンテンツ

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

ソフトウェア無線を用いたGNSS信号伝送

R2024b 以降

この例では、グローバル測位システム (GPS) 波形を生成し、ソフトウェア定義無線 (SDR) を使用して送信する方法を示します。この例を使用すると、生成されたGPS波形を使用して受信機をテストます。この例ではGPS波形の生成について説明していますが、これを拡張して他の全地球航法衛星システム (GNSS) テクノロジに対応させることもできます。

単一の衛星のGPS波形を生成する方法の詳細については、GPS 波形生成 の例を参照してください。

この例では、次の手順に従います。

  1. GPSアルマナックファイルを使用して衛星コンスタレーションをシミュレートします。

  2. 受信機の位置を指定して、現実的なGPS波形シナリオを作成します。

  3. 衛星環境をシミュレートして、モデル化された受信機に対する衛星の相対位置を計算します。

  4. このシナリオで受信信号のドップラーシフト、遅延、および電力を計算します。

  5. gpsWaveformGenerator System object ™ を使用してベースバンドGPS波形を生成します。

  6. ステップ 4 の結果を使用して、生成されたベースバンド信号にドップラー シフトや遅延などの障害を導入します。

  7. 障害のあるベースバンド波形を SDR 経由で送信します。

この図は波形生成プロセスを示しています。

WaveformGeneration.png

この例を使用すると、 GPS波形をファイルに保存したり、サポートされている SDR を使用して信号を無線で送信したりできます。

GNSSSDRWorkFlow.png

パラメーターの初期化と構成

GPS 波形生成 の例は、障害のない 1 つの衛星のみからの波形生成を示しています。この例では、衛星シナリオをシミュレートして複数の衛星の波形を生成し、SDR を使用してその波形を無線で送信できます。

波形を生成するための構成パラメーターを指定します。

useSDR            = false;                  % In the default case, do not use SDR
WriteWaveToFile   = false;
waveformFileName  = "gpsBBWaveform.bb"; % File extension is always .bb
signalType        = "GPS C/A"; % Possible values: "GPS C/A" | "GPS L1C", "GPS L2C" | "GPS L5"
centerFrequency   = 1575.42e6; % Possible values: L1 (1575.42 MHz), L2 (1254.35 MHz), and L5 (1176.45 MHz)
sampleRate        = 5000000; % In Hz
rxlla             = [17.4349,78.3827,19]; % Receiver position in latitude (degrees), longitude (degrees), and altitude (m)
waveDuration      = 10; % Waveform duration in seconds
enableImpairments =  true;                 % Option to enable or disable impairments
minElevationAngle = 10; % In degrees. Below this elevation angle satellites are not considered in simulation
seed              = 73; % Seed for getting reproducible results
useSEMAlmanac     = "stored"; % File to derive ephemeris data and satellite simulation
if useSEMAlmanac == "stored"
    % Provide the system effectiveness model (SEM) almanac file name
    almFileName   = "gpsAlmanac.txt"; % Almanac file name
    % Provide the startTime
    startTime = datetime(2021,6,24,0,0,48,TimeZone="UTC");
else
    % Download the latest SEM almanac file from the Navigation Center
    % website and store the file
    url = "https://www.navcen.uscg.gov/sites/default/files/gps/almanac/current_sem.al3";
    currentDay = string(datetime("today",TimeZone="UTC"));
    almFileName = "gps_SEM_" + currentDay + "_UTC.txt";
    websave(almFileName,url)

    % Uses the latest SEM almanac file. Set the startTime to current date
    % and time.
    startTime = datetime("now",TimeZone="UTC");
end

指定された signalType に基づいて、いくつかの構成パラメーターを初期化します。

wavegenobj = gpsWaveformGenerator(SampleRate=sampleRate);
switch(signalType)
    case "GPS C/A"
        wavegenobj.SignalType = "legacy";
        navDataType = "LNAV";
    case "GPS L1C"
        wavegenobj.SignalType = "l1C";
        navDataType = "CNAV2";
    case "GPS L2C"
        wavegenobj.SignalType = "l2C";
        navDataType = "CNAV";
    case "GPS L5"
        wavegenobj.SignalType = "l5";
        navDataType = "L5";
end
stepTime = wavegenobj.BitDuration;          % Generate waveform in the step size corresponding to bit duration

特定の衛星シナリオのドップラーシフトとレイテンシを計算します。

% Initialize satellite scenario
sc = satelliteScenario;
% Set up the satellites based on the RINEX data
sat = satellite(sc,almFileName,OrbitPropagator="gps");
rx = groundStation(sc,rxlla(1),rxlla(2),Altitude=rxlla(3)); % Set up the receiver which doesn't move
rx.MinElevationAngle = minElevationAngle;

sc.StartTime = startTime;
sc.StopTime = sc.StartTime + seconds(waveDuration-stepTime);
sc.SampleTime = stepTime;

% Calculate Doppler shift and latency over time for all the visible satellites
dopShifts = dopplershift(sat,rx,Frequency=centerFrequency).';
ltncy = latency(sat,rx).';

信号対雑音比 (SNR) の計算に役立つ値を初期化します。

c = physconst("LightSpeed"); % Speed of light in m/sec
Pt = 44.8;                   % Typical transmission power of GPS satellite in watts
Dt = 12;                     % Directivity of the transmit antenna in dBi
DtLin = db2pow(Dt);
Dr = 4;                      % Directivity of the receive antenna in dBi
DrLin = db2pow(Dr);
k = physconst("boltzmann");  % Boltzmann constant in Joules/Kelvin
T = 300;                     % Room temperature in Kelvin

自由空間経路損失方程式から受信機での電力を計算します。

Pr   = Pt*DtLin*DrLin./ ...
    ((4*pi*(centerFrequency+dopShifts).*ltncy).^2);

可視衛星ごとに信号対雑音比を計算します。SDR で送信する際の損失を考慮して、信号電力 (ここでは 3 dB) を追加します。

snrs = 10*log10(Pr/(k*T*sampleRate)) + 3;

波形を生成し、障害を追加する

アルマナックから構成ファイルを初期化します。

satIndices = find(~isnan(ltncy(1,:)));
navcfg = HelperGPSAlmanac2Config(almFileName,navDataType,satIndices,startTime);
visiblesatPRN = [navcfg(:).PRNID]
visiblesatPRN = 1×8

    10    13    15    20    21    24    29    32

ナビゲーションデータを生成します。

% Generate GPS navigation data
tempnavdata = HelperGPSNAVDataEncode(navcfg(1));
navdata = zeros(length(tempnavdata),length(navcfg));
navdata(:,1) = tempnavdata;
for isat = 2:length(navcfg)
    navdata(:,isat) = HelperGPSNAVDataEncode(navcfg(isat));
end

GPS波形生成オブジェクトを構成します。

wavegenobj.PRNID = visiblesatPRN
wavegenobj = 
  gpsWaveformGenerator with properties:

           SignalType: "legacy"
                PRNID: [10 13 15 20 21 24 29 32]
          EnablePCode: false
    HasDataWithCACode: true
           SampleRate: 5000000

  Show all properties

gnsschannelobj = HelperGNSSChannel(FrequencyOffset=dopShifts(1,satIndices), ...
    SignalDelay=ltncy(1,satIndices), ...
    SignalToNoiseRatio=snrs(1,satIndices), ...
    SampleRate=sampleRate,RandomStream="mt19937ar with seed",Seed=seed)
gnsschannelobj = 
  HelperGNSSChannel with properties:

               SampleRate: 5000000
    IntermediateFrequency: 0
       DisableImpairments: false
          FrequencyOffset: [956.0901 -3.2174e+03 -2.5058e+03 316.0502 1.7671e+03 1.7725e+03 -1.8776e+03 3.4268e+03]
              SignalDelay: [0.0767 0.0808 0.0715 0.0728 0.0744 0.0771 0.0691 0.0803]
       SignalToNoiseRatio: [-11.2812 -11.7307 -10.6680 -10.8213 -11.0074 -11.3176 -10.3708 -11.6799]
             RandomStream: "mt19937ar with seed"
                     Seed: 73

numsteps = round(waveDuration/stepTime);
samplesPerStep = sampleRate*stepTime;

波形を初期化します。障害を有効にすると、すべての衛星信号が 1 つのストリームに結合されるため、波形内のチャネル数は 1 に設定されます。障害を無効にすると、チャネル数は可視衛星の数と等しくなります。

numchannels = 1*enableImpairments + length(visiblesatPRN)*(~enableImpairments);
gpswaveform = zeros(numsteps*samplesPerStep,numchannels);

必要に応じて、波形をファイルに書き込むオブジェクトを初期化します。

if WriteWaveToFile == true
    bbwriter = comm.BasebandFileWriter(waveformFileName,sampleRate,0);
end

波形を生成します。

for istep = 1:numsteps
    idx = (istep-1)*samplesPerStep + (1:samplesPerStep);
    navbit = navdata(istep,:);
    tempWaveform = wavegenobj(navbit);
    if enableImpairments == true
        gpswaveform(idx,:) = gnsschannelobj(tempWaveform);
    else
        gpswaveform(idx,:) = tempWaveform;
    end
    if WriteWaveToFile == true
        bbwriter(gpswaveform(idx,:))
    end
    
    % Update the properties of the channel object based on the values
    % calculated from the satellite scenario
    gnsschannelobj.SignalToNoiseRatio = snrs(istep,satIndices);
    gnsschannelobj.FrequencyOffset = dopShifts(istep,satIndices);
    gnsschannelobj.SignalDelay = ltncy(istep,satIndices);
end

波形のスペクトルを可視化します。

scope = spectrumAnalyzer(SampleRate=sampleRate,AveragingMethod="exponential",ForgettingFactor=1);
scope.SpectrumUnits = "dBW";
% Plot only 1 sec of the waveform spectrum.
wlen = sampleRate; % Number of samples corresponding to one second
if length(gpswaveform) > wlen
    scope(gpswaveform(end-wlen+1:end))
else
    % If the length of the generated waveform is less than one second,
    % visualize the spectrum of the entire waveform
    scope(gpswaveform)
end

ラジオのセットアップ

関数 radioConfigurations (Wireless Testbench) を呼び出します。この関数は、Radio Setup (Wireless Testbench) ウィザードを使用して保存した利用可能なすべての無線セットアップ構成を返します。

if useSDR == 1
    savedRadioConfigurations = radioConfigurations;

保存した無線セットアップ構成名でドロップダウン メニューを更新するには、更新 をクリックします。次に、この例で使用するラジオを選択します。

    savedRadioConfigurationNames = [string({savedRadioConfigurations.Name})];
    if ~isempty(savedRadioConfigurationNames)
        radio = savedRadioConfigurationNames(1) ;
    end
end

SDR経由で波形を送信

SDR を接続したら、 GPS信号を無線でブロードキャストします。

if useSDR == 1 & ~isempty(savedRadioConfigurationNames) % Using SDR
    if ~exist("txradio","var")
        txradio = basebandTransmitter(radio);
        txradio.RadioGain = 10;
        txradio.CenterFrequency = centerFrequency;
        txradio.SampleRate = sampleRate
    end
    transmit(txradio,gpswaveform,"once")
end

その他の調査

この例では、basebandTransmitter (Wireless Testbench) オブジェクトを使用した信号の送信を示します。あるいは、より多くの USRP プラットフォームをサポートする comm.SDRuTransmitter オブジェクトを使用することもできます。

この例で生成された波形は、SDR を使用して無線で送信できます。次に、別の SDR を使用してその波形を受信し、キャプチャした信号に対してGPS受信機アルゴリズムを実行します。

物理的なハードウェア接続なしで信号波形を直接使用して受信機の性能を評価する方法のデモについては、

サポート ファイル

この例では、これらのデータとヘルパー ファイルを使用します。

  • HelperGNSSChannel.m — 波形に障害を追加するためのGNSSチャネルオブジェクトを作成する

  • HelperGPSAlmanac2Config.m —アルマナックファイルのプロパティをナビゲーション構成オブジェクトのプロパティに変換します

  • HelperGPSConvertTime.m — GPS の週と週の時間を datetime オブジェクトに変換し、その逆も行います。

  • HelperGPSNAVDataEncode.m — 構成オブジェクトからナビゲーションデータをビットにエンコードします

  • HelperGPSNavigationConfig.m — GPSナビゲーションデータの構成オブジェクトを作成する

  • L1CLDPCParityCheckMatrices.mat — L1C データをエンコードするためのLDPCパリティ検査行列

参考

| |

トピック