5G NR PRACH の検出と偽警報のテスト
この例では、TS 38.141-1 の定義に従い、物理ランダム アクセス チャネル (PRACH) の誤検出と偽警報の適合性テストを実装します。プリアンブル信号が存在する場合に PRACH プリアンブルを正しく検出する確率を測定したり、PRACH の送信をオフにして偽警報の確率を測定したりすることができます。
はじめに
PRACH は、ユーザー端末 (UE) が gNodeB との同期を開始するのに使用されるアップリンク伝送です。TS 38.141-1 の Section 8.4.1.5 では、所定の PRACH 構成と伝播条件において、特定の SNR 値に対し、PRACH の検出確率が 99% 以上でなければならないと定義されています。検出エラーにはいくつかのケースがあります。
間違ったプリアンブルを検出した
プリアンブルを検出できなかった
正しいプリアンブルを検出したが、タイミングを正しく推定できなかった
TS 38.141-1 では、強度が最も高いパスのタイミング オフセットの推定誤差が Table 8.4.1.1-1 で示された時間誤差の許容値未満のときに検出が正確だと言えると記載されています。チャネル伝播条件 TDLC300-100、PRACH プリアンブル形式 0 の場合、時間誤差の許容値は 2.55 マイクロ秒です。
この例では、PRACH 波形を構成し、適切なチャネルによって送信します。また、この例では、受信側で PRACH の検出を実行し、PRACH 検出確率を計算します。この例では、TS 38.141-1 の Table 8.4.1.5-1 および Table A.6-1 で定義されたパラメーターについて考えます。ここでは、ノーマル モード (unrestricted set)、2 つの受信アンテナ、TDLC300-100 チャネル、ノーマル サイクリック プレフィックス、バースト形式 0、SNR -6.0 dB とします。Table A.6-1 にリストされた他のいずれかの PRACH プリアンブルを使用するために PRACH 構成を変更した場合、TS 38.141-1 の Table 8.4.1.1-1 および Table 8.4.1.5-1 ~ 8.4.1.5-3 に従って時間誤差の許容値と SNR 値をそれぞれ更新する必要があります。
シミュレーションの構成
この例では、いくつかの SNR について 10 個の PRACH スロットを使用する場合について考えます。有意な結果を得るためには、多数の numPRACHSlots
を使用する必要があります。SNRdB
は、値の配列、またはスカラーとして設定できます。この例で使用している SNR 定義の説明については、リンク シミュレーションで使用する SNR の定義を参照してください。TS 38.141-1 の Table 8.4.1.5-1 では、送信機と受信機との間でモデル化された周波数オフセット foffset
が指定されています。変数 timeErrorTolerance
は、TS 38.141-1 の Table 8.4.1.1-1 で定義された時間誤差の許容値を指定します。関数nrPRACHDetect
で、検出しきい値を範囲 [0,1] の値に設定するか、既定値を使用する場合は空に設定します。偽警報のテストをシミュレートするには、代わりに、prachEnabled
を false
に設定して PRACH の送信を無効にします。
numPRACHSlots = 10; % Number of PRACH slots to simulate at each SNR SNRdB = [-21, -16, -11, -6, -1]; % SNR range in dB foffset = 400.0; % Frequency offset in Hz timeErrorTolerance = 2.55; % Time error tolerance in microseconds threshold = []; % Detection threshold prachEnabled = true; % Enable PRACH transmission. To simulate false alarm test, disable PRACH transmission.
キャリア構成
nrCarrierConfig
構成オブジェクト carrier
を使用し、キャリアの設定を指定します。この例では、サブキャリア間隔 15 kHz、帯域幅 5 MHz によって特徴付けられるキャリアを使用する場合について考えます。TS 38.104 の Table 5.3.2-1 によれば、この場合、キャリアは 25 個のリソース ブロックにまたがります。
carrier = nrCarrierConfig;
carrier.SubcarrierSpacing = 15;
carrier.NSizeGrid = 25;
% Compute the OFDM-related information
ofdmInfo = nrOFDMInfo(carrier);
PRACH 構成
TS 38.141-1 の Table A.6-1 では、PRACH 検出適合性テストに使用する PRACH 構成が指定されています。
TS 38.141-1 の Table A.6-1 および Section 8.4.1.4.2 に従い、nrPRACHConfig
構成オブジェクト prach
を使用して PRACH 構成を設定します。
% Set PRACH configuration prach = nrPRACHConfig; prach.FrequencyRange = 'FR1'; % Frequency range prach.DuplexMode = 'FDD'; % Frequency Division Duplexing (FDD) prach.ConfigurationIndex = 27; % Configuration index for format 0 prach.SubcarrierSpacing = 1.25; % Subcarrier spacing prach.SequenceIndex = 22; % Logical sequence index prach.PreambleIndex = 32; % Preamble index prach.RestrictedSet = 'UnrestrictedSet'; % Normal mode prach.FrequencyStart = 0; % Frequency location % Define the value of ZeroCorrelationZone using the NCS table stored in % the nrPRACHConfig object switch prach.Format case {'0','1','2'} ncsTable = nrPRACHConfig.Tables.NCSFormat012; ncsTableCol = (string(ncsTable.Properties.VariableNames) == prach.RestrictedSet); case '3' ncsTable = nrPRACHConfig.Tables.NCSFormat3; ncsTableCol = (string(ncsTable.Properties.VariableNames) == prach.RestrictedSet); otherwise ncsTable = nrPRACHConfig.Tables.NCSFormatABC; ncsTableCol = contains(string(ncsTable.Properties.VariableNames), num2str(prach.LRA)); end NCS = 13; zeroCorrelationZone = ncsTable.ZeroCorrelationZone(ncsTable{:,ncsTableCol}==NCS); prach.ZeroCorrelationZone = zeroCorrelationZone; % Cyclic shift index
伝播チャネル構成
TS 38.141-1 の Table 8.4.1.1-1 に従い、nrTDLChannel
オブジェクトを使用してタップ付き遅延線 (TDL) の伝播チャネル モデル channel
を構成します。
channel = nrTDLChannel; channel.DelayProfile = "TDLC300"; % Delay profile channel.MaximumDopplerShift = 100.0; % Maximum Doppler shift in Hz channel.SampleRate = ofdmInfo.SampleRate; % Input signal sample rate in Hz channel.MIMOCorrelation = "Low"; % MIMO correlation channel.TransmissionDirection = "Uplink"; % Uplink transmission channel.NumReceiveAntennas = 2; % Number of receive antennas channel.NormalizePathGains = true; % Normalize delay profile power channel.Seed = 42; % Channel seed. Change this for different channel realizations channel.NormalizeChannelOutputs = true; % Normalize for receive antennas % Get the channel characteristic information channelInfo = info(channel);
SNR 値のループ
ベクトル SNRdB
で与えられた一連の SNR 点について、ループを使用してシミュレーションを実行します。TS 38.141-1 の Table 8.4.1.5-1 で説明されているように、ここで構成された SNR ベクトルは、-6.0 dB における点を含む SNR 点の範囲であり、プリアンブル形式 0 において PRACH 検出率のテスト要件 (99%) が達成される SNR です。
hNRPRACHWaveformGenerator
は、5G Toolbox™ 内のアップリンク データ伝送と同じ送信電力に正規化された出力信号を生成します。そのため、PRACH に追加したノイズについても同じ正規化を行わなければなりません。OFDM 復調の前に追加されたノイズは、IFFT のサイズ () の平方根に等しい倍数だけ IFFT によって増幅されます。追加したノイズの電力が復調後に確実に正規化されて目的の SNR が得られるようにするため、目的のノイズ パワーが
で除算されます。さらに、ノイズの実数部と虚数部が個別に作成された後、それらが複素数の加法性ホワイト ガウス ノイズに結合される前に、生成されたノイズ パワーが 1 となるようにノイズの振幅が
でスケーリングされます。
各 SNR テスト ポイントにおいて、次の手順でスロットごとに検出確率を計算します。
PRACH の送信:
hNRPRACHWaveformGenerator
を使用して PRACH 波形を生成します。TS 38.141-1 の Figure 8.4.1.4.2-2 で定義されたタイミング オフセットで PRACH プリアンブルを送信します。PRACH の生成では、タイミング オフセットの基準値をサイクリック シフト数の 50% に設定します。プリアンブルごとに、テスト範囲の終端 (PRACH プリアンブル形式 0 の場合は 0.9 マイクロ秒) に達するまで、このオフセットをステップ値 0.1 マイクロ秒ずつ増やします。その後、このパターンを繰り返します。ノイズを含むチャネルのモデル化: TDL チャネルに波形を渡し、加法性ホワイト ガウス ノイズを付加します。チャネルのモデル化で予期される遅延範囲 (実装遅延およびチャネル遅延スプレッドの組み合わせ) をカバーするため、波形の末尾にサンプルを追加します。その後、プリアンブル検出器でこの実装遅延が実際のタイミング オフセットとして解釈されないようにするため、実装遅延を削除します。
周波数オフセットの適用: 仕様の定義に従い、受信波形に周波数オフセットを適用します。
PRACH の検出: すべてのセル プリアンブル インデックス (0:63) について、関数
nrPRACHDetect
を使用して PRACH の検出を実行します。nrPRACHDetect
によって返された PRACH インデックスとオフセットの検出結果を使用し、はじめにのセクションで説明した制約に基づいて正しく検出されたかどうかを判断します。
% Initialize variables storing detection probability at each SNR pDetection = zeros(size(SNRdB)); % Store the configuration parameters needed to generate the PRACH waveform waveconfig.NumSubframes = prach.SubframesPerPRACHSlot; waveconfig.Windowing = []; waveconfig.Carriers = carrier; waveconfig.PRACH.Config = prach; waveconfig.PRACH.Enable = prachEnabled; % The temporary variables 'prach_init', 'waveconfig_init', 'ofdmInfo_init', % and 'channelInfo_init' are used to create the temporary variables % 'prach', 'waveconfig', 'ofdmInfo', and 'channelInfo' within the SNR loop % to create independent instances in case of parallel simulation prach_init = prach; waveconfig_init = waveconfig; ofdmInfo_init = ofdmInfo; channelInfo_init = channelInfo; for snrIdx = 1:numel(SNRdB) % comment out for parallel computing % parfor snrIdx = 1:numel(SNRdB) % uncomment for parallel computing % To reduce the total simulation time, you can execute this loop in % parallel by using the Parallel Computing Toolbox. Comment out the 'for' % statement and uncomment the 'parfor' statement. If the Parallel Computing % Toolbox(TM) is not installed, 'parfor' defaults to normal 'for' statement % Display progress in the command window timeNow = char(datetime('now','Format','HH:mm:ss')); fprintf([timeNow ': Simulating SNR = %+5.1f dB...'], SNRdB(snrIdx)); % Set the random number generator settings to default values rng('default'); % Initialize variables for this SNR point, required for initialization % of variables when using the Parallel Computing Toolbox prach = prach_init; waveconfig = waveconfig_init; ofdmInfo = ofdmInfo_init; channelInfo = channelInfo_init; % Reset the channel so that each SNR point will experience the same % channel realization reset(channel); % Normalize noise power to account for the sampling rate, which is a % function of the IFFT size used in OFDM modulation. The SNR is defined % per carrier resource element for each receive antenna. SNR = 10^(SNRdB(snrIdx)/10); N0 = 1/sqrt(2.0*channel.NumReceiveAntennas*double(ofdmInfo.Nfft)*SNR); % Detected preamble count detectedCount = 0; % Loop for each PRACH slot numActivePRACHSlots = 0; for nSlot = 0:numPRACHSlots-1 % Generate PRACH waveform for the current slot prach.NPRACHSlot = nSlot; waveconfig.PRACH.Config.NPRACHSlot = nSlot; [waveform,~,winfo] = hNRPRACHWaveformGenerator(waveconfig); % Set PRACH timing offset in microseconds as per TS 38.141-1 Figure % 8.4.1.4.2-2 and Figure 8.4.1.4.2-3 if prach.LRA==839 % Long preamble, values as in Figure 8.4.1.4.2-2 baseOffset = ((winfo.WaveformResources.PRACH.Resources.PRACHSymbolsInfo.NumCyclicShifts/2)/prach.LRA)/prach.SubcarrierSpacing*1e3; % (microseconds) timingOffset = baseOffset + mod(nSlot,10)/10; % (microseconds) else % Short preamble, values as in Figure 8.4.1.4.2-3 baseOffset = 0; % (microseconds) timingOffset = baseOffset + mod(nSlot,9)/10; % (microseconds) end sampleDelay = fix(timingOffset / 1e6 * ofdmInfo.SampleRate); % Generate transmit waveform txwave = [zeros(sampleDelay,1); waveform]; % Pass data through channel model. Append zeros at the end of the % transmitted waveform to flush channel content. These zeros take % into account any delay introduced in the channel. This is a mix % of multipath delay and implementation delay. This value may % change depending on the sampling rate, delay profile and delay % spread rxwave = channel([txwave; zeros(channelInfo.MaximumChannelDelay, size(txwave,2))]); % Add noise noise = N0*complex(randn(size(rxwave)), randn(size(rxwave))); rxwave = rxwave + noise; % Skip this slot if the PRACH is inactive. % Skip the detection of this slot after advancing the channel to % make sure that the channel is always synchronized with the % current slot. % If the PRACH is inactive in this slot, the receiver should not % expect any PRACH transmission and thus should not even try to % detect a PRACH. Skipping the detection of an inactive slot is % particularly important when performing a conformance test. If the % PRACH is inactive, the reference waveform computed internally in % the |nrPRACHDetect| function is empty. This leads to an empty % correlation and thus to an empty detected preamble. This empty % preamble leads to an incorrect value of the detection % probability. if isempty(winfo.WaveformResources.PRACH.Resources.PRACHSymbols) continue; end numActivePRACHSlots = numActivePRACHSlots + 1; % Remove the implementation delay of the channel filter rxwave = rxwave((channelInfo.ChannelFilterDelay + 1):end, :); % Apply frequency offset t = ((0:size(rxwave, 1)-1)/channel.SampleRate).'; rxwave = rxwave .* repmat(exp(1i*2*pi*foffset*t), 1, size(rxwave, 2)); % PRACH detection for all cell preamble indices [detected, offsets] = nrPRACHDetect(carrier, prach, rxwave, 'DetectionThreshold', threshold); % Test for preamble detection if (length(detected)==1) if ~prachEnabled % For the false alarm test, any preamble detected is wrong detectedCount = detectedCount + 1; else % Test for correct preamble detection if (detected==prach.PreambleIndex) % Calculate timing estimation error trueOffset = timingOffset/1e6; % (s) measuredOffset = offsets(1)/channel.SampleRate; timingerror = abs(measuredOffset-trueOffset); % Test for acceptable timing error if (timingerror<=timeErrorTolerance/1e6) detectedCount = detectedCount + 1; % Detected preamble end end end end end % of nSlot loop % Compute final detection probability for this SNR pDetection(snrIdx) = detectedCount/numActivePRACHSlots; % Display the detection probability for this SNR fprintf('Detection probability: %d%%\n', pDetection(snrIdx)*100); end % of SNR loop
01:51:11: Simulating SNR = -21.0 dB...Detection probability: 0% 01:51:12: Simulating SNR = -16.0 dB...Detection probability: 40% 01:51:13: Simulating SNR = -11.0 dB...Detection probability: 80% 01:51:14: Simulating SNR = -6.0 dB...Detection probability: 100% 01:51:14: Simulating SNR = -1.0 dB...Detection probability: 100%
結果
この例では、SNR ループが終了した後、各 SNR 値について、目標確率に対する計算された検出確率をプロットします。
% Plot detection probability figure('Name','Detection Probability'); plot(SNRdB,pDetection,'b-o','LineWidth',2,'MarkerSize',7); title(['Detection Probability for ', num2str(numPRACHSlots) ' PRACH Slot(s)'] ); xlabel('SNR (dB)'); ylabel('Detection Probability'); grid on; hold on; % Plot target probability if prachEnabled % For a missed detection test, detection probability should be >= 99% pTarget = 99; else % For a false alarm test, detection probability should be < 0.1% pTarget = 0.1; %#ok<UNRCH> end plot(-6.0,pTarget/100,'rx','LineWidth',2,'MarkerSize',7); legend('Simulation Result', ['Target ' num2str(pTarget) '% Probability'],'Location','best'); minP = 0; if(~isnan(min(pDetection))) minP = min([pDetection(:); pTarget]); end axis([SNRdB(1)-0.1 SNRdB(end)+0.1 minP-0.05 1.05])
参考文献
3GPP TS 38.141-1. "NR; Base Station (BS) conformance testing. Part 1: Conducted conformance testing." 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.
3GPP TS 38.104. "NR; Base Station (BS) radio transmission and reception." 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.