Initial ARSS. Need to improve and add functions.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
function quantized_data = apply_adc_quantization(adc_raw_data, n_bits, v_full_scale, mode)
|
||||
% 입력:
|
||||
% - adc_raw_data: HPF/LPF가 적용된 복소 비트 신호 (Voltage Scale)
|
||||
% - n_bits: ADC 비트 수
|
||||
% - v_full_scale: ADC Peak-to-Peak 전압 범위 (e.g., 2.0V)
|
||||
% - mode: 'IQ' (Complex 출력) 또는 'Real' (Real 출력)
|
||||
|
||||
v_max = v_full_scale / 2;
|
||||
lsb = v_full_scale / (2^n_bits);
|
||||
|
||||
if strcmpi(mode, 'IQ')
|
||||
% --- Case 1: I/Q Demodulation (Complex) ---
|
||||
% I채널과 Q채널 각각 독립적으로 Clipping 및 Quantization 진행
|
||||
r_part = real(adc_raw_data);
|
||||
i_part = imag(adc_raw_data);
|
||||
|
||||
r_part = max(min(r_part, v_max), -v_max);
|
||||
i_part = max(min(i_part, v_max), -v_max);
|
||||
|
||||
q_r = round(r_part / lsb) * lsb;
|
||||
q_i = round(i_part / lsb) * lsb;
|
||||
|
||||
quantized_data = q_r + 1j * q_i;
|
||||
|
||||
elseif strcmpi(mode, 'Real')
|
||||
% --- Case 2: Real Demodulation ---
|
||||
% 복소 신호의 실수부(I채널)만 취하여 ADC 처리
|
||||
% 실제 하드웨어에서는 믹서에서 허수 성분이 아예 생성되지 않음
|
||||
r_part = real(adc_raw_data);
|
||||
|
||||
r_part = max(min(r_part, v_max), -v_max);
|
||||
q_r = round(r_part / lsb) * lsb;
|
||||
|
||||
% 결과는 실수(Real) 행렬
|
||||
quantized_data = q_r;
|
||||
else
|
||||
error('모드는 IQ 또는 Real 중 하나를 선택해야 합니다.');
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,39 @@
|
||||
function filtered_data = apply_analog_hpf(adc_raw_data, fs_adc, fc_hpf_Hz)
|
||||
% 입력:
|
||||
% - adc_raw_data: [NumRx, NumTx, NumChirps, N_samples] 복소 데이터
|
||||
% - fs_adc: ADC 샘플링 주파수 (Hz)
|
||||
% - fc_hpf_Hz: HPF 차단 주파수 (Cut-off Frequency, Hz)
|
||||
|
||||
[NumRx, NumTx, NumChirps, N_samples] = size(adc_raw_data);
|
||||
filtered_data = zeros(size(adc_raw_data));
|
||||
|
||||
% 1. 1차 아날로그 HPF 설계 (S-plane -> Z-plane 변환)
|
||||
% Analog Transfer Function: H(s) = s / (s + omega_c)
|
||||
omega_c = 2 * pi * fc_hpf_Hz;
|
||||
|
||||
% 쌍선형 변환(Bilinear Transform)을 이용한 디지털 필터 계수 산출
|
||||
% [b, a] = butter(1, fc_hpf_Hz / (fs_adc/2), 'high'); % 또는 아래와 같이 직접 계산
|
||||
T = 1 / fs_adc;
|
||||
alpha = 2 / T;
|
||||
|
||||
b0 = alpha / (alpha + omega_c);
|
||||
b1 = -alpha / (alpha + omega_c);
|
||||
a1 = (omega_c - alpha) / (alpha + omega_c);
|
||||
|
||||
b = [b0, b1];
|
||||
a = [1, a1];
|
||||
|
||||
% 2. 모든 채널 및 처프에 대해 필터 적용
|
||||
for rx = 1:NumRx
|
||||
for tx = 1:NumTx
|
||||
for m = 1:NumChirps
|
||||
% 각 샘플 시퀀스 추출
|
||||
raw_sig = squeeze(adc_raw_data(rx, tx, m, :));
|
||||
|
||||
% 필터 적용 (초기 과도 응답을 최소화하기 위해 'filtfilt' 대신 'filter' 사용)
|
||||
% 실시간 시스템의 특성을 모사하기 위해 인과적(Causal) 필터인 filter 함수 사용
|
||||
filtered_data(rx, tx, m, :) = filter(b, a, raw_sig);
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,203 @@
|
||||
function [adc_raw_data, adc_combined] = apply_lna_and_mixer(RxOut, TxOut, RadarParams)
|
||||
% 출력: adc_raw_data [NumRx, NumTx, NumChirps, N_adc_samples] - 분석용
|
||||
% adc_combined [NumRx, NumChirps, N_adc_samples] - 실제 ADC 입력 (모든 TX 합산)
|
||||
% 입력: RxOut, TxOut, RadarParams
|
||||
% MIMO 모드에 따라 TX 신호를 생성합니다.
|
||||
Timing = RadarParams.Waveform.Timing;
|
||||
fs_adc = RadarParams.Waveform.fs_adc;
|
||||
f_start = RadarParams.Waveform.f_start;
|
||||
Slope = RadarParams.Waveform.Slope;
|
||||
pn_level = RadarParams.Waveform.nonideal.pn_level;
|
||||
f_ripple = RadarParams.Waveform.nonideal.f_ripple;
|
||||
peak_phase_error = RadarParams.Waveform.nonideal.peak_phase_error;
|
||||
enable_phase_noise = true;
|
||||
enable_nonlinearity = true;
|
||||
if isfield(RadarParams.Waveform.nonideal, 'enable_phase_noise')
|
||||
enable_phase_noise = logical(RadarParams.Waveform.nonideal.enable_phase_noise);
|
||||
end
|
||||
if isfield(RadarParams.Waveform.nonideal, 'enable_nonlinearity')
|
||||
enable_nonlinearity = logical(RadarParams.Waveform.nonideal.enable_nonlinearity);
|
||||
end
|
||||
use_datasheet_phase_noise = false;
|
||||
phase_noise_cfg = struct();
|
||||
if isfield(RadarParams.Waveform.nonideal, 'phaseNoise')
|
||||
phase_noise_cfg = RadarParams.Waveform.nonideal.phaseNoise;
|
||||
if isfield(phase_noise_cfg,'enabled') && phase_noise_cfg.enabled && ...
|
||||
isfield(phase_noise_cfg,'offset_Hz') && isfield(phase_noise_cfg,'level_dBc_Hz')
|
||||
use_datasheet_phase_noise = true;
|
||||
end
|
||||
end
|
||||
mimoMode = RadarParams.Waveform.mimoMode;
|
||||
NumTx = RadarParams.Antenna.NumTx;
|
||||
rxPathGain_dB = RadarParams.Rxpath.rxPathGain_dB;
|
||||
system_NF_dB = RadarParams.Rxpath.system_NF_dB;
|
||||
PA_Profile = RadarParams.RFOutput.PA_Profile;
|
||||
SpurParams = RadarParams.SpurParams;
|
||||
enable_spur = true;
|
||||
if isstruct(SpurParams) && isfield(SpurParams, 'enabled')
|
||||
enable_spur = logical(SpurParams.enabled);
|
||||
end
|
||||
|
||||
[NumTargets, NumRx, ~, NumChirps, N_adc_samples] = size(RxOut.space_loss_amp);
|
||||
|
||||
% TDM 모드 유효성 체크: TX별 동일한 처프 수 확보
|
||||
if strcmpi(mimoMode, 'TDM') && mod(NumChirps, NumTx) ~= 0
|
||||
error('TDM mode requires NumChirps to be a multiple of NumTx. Current NumChirps=%d, NumTx=%d.', NumChirps, NumTx);
|
||||
end
|
||||
|
||||
% t=0 (처프 시작) 기준, ADC 샘플링 시간 및 순시 주파수 계산
|
||||
t_adc = Timing.AdcStartTime : 1/fs_adc : (Timing.AdcStartTime + Timing.AdcSampTime - 1/fs_adc);
|
||||
f_inst = f_start + Slope * t_adc;
|
||||
|
||||
% --- 1. PA_Profile을 이용한 주파수별 송신 전압(Vtx) 계산 ---
|
||||
% PA_Profile의 형식에 따라 보간 (행렬일 경우 PA_Profile(:,1), PA_Profile(:,2) 사용)
|
||||
if isstruct(PA_Profile)
|
||||
P_inst_dBm = interp1(PA_Profile.freqs, PA_Profile.power_dBm, f_inst, 'linear', 'extrap');
|
||||
else
|
||||
P_inst_dBm = interp1(PA_Profile(:,1), PA_Profile(:,2), f_inst, 'linear', 'extrap');
|
||||
end
|
||||
|
||||
% dBm -> Watt -> 전압 진폭(V) 변환 (50옴 시스템 기준)
|
||||
Vtx_inst = sqrt(10.^((P_inst_dBm - 30) / 10) * 50);
|
||||
|
||||
% --- 2. 수신단 시스템 잡음 계산 ---
|
||||
T_ref = RadarParams.Basic.T0;
|
||||
P_noise_floor_W = RadarParams.Basic.kb * T_ref * fs_adc;
|
||||
|
||||
rxPathGain_lin = 10^(rxPathGain_dB/10);
|
||||
system_NF_lin = 10^(system_NF_dB/10);
|
||||
|
||||
% ADC 입력단 기준 최종 잡음 전력 및 전압 표준편차
|
||||
P_noise_total_W = P_noise_floor_W * system_NF_lin * rxPathGain_lin;
|
||||
sigma_n = sqrt(P_noise_total_W * 50);
|
||||
|
||||
% --- MIMO 모드에 따른 TX 활성화 패턴 계산 ---
|
||||
% TDM: 처프마다 다른 TX만 활성화
|
||||
% DDMA: 모든 TX 활성화 + 처프별 위상 시프트
|
||||
% legacy phase-noise model 대비 필터(데이터시트 기반 모델 미사용 시)
|
||||
window_size = 50;
|
||||
ma_filter = ones(1,window_size)/window_size;
|
||||
|
||||
% --- 3. ADC Raw Data 생성 ---
|
||||
adc_raw_data = zeros(NumRx, NumTx, NumChirps, N_adc_samples);
|
||||
|
||||
for m = 1:NumChirps
|
||||
% generate phase noise & nonlinearity for this chirp
|
||||
t_rel = t_adc; % time within chirp
|
||||
if enable_phase_noise && use_datasheet_phase_noise
|
||||
phi_noise = generate_phase_noise_from_datasheet(t_rel, phase_noise_cfg);
|
||||
elseif enable_phase_noise
|
||||
phi_noise = pn_level * filter(ma_filter, 1, randn(1, N_adc_samples));
|
||||
else
|
||||
phi_noise = zeros(1, N_adc_samples);
|
||||
end
|
||||
|
||||
phi_nonlin = zeros(1, N_adc_samples);
|
||||
if enable_nonlinearity
|
||||
ramp_idx2 = (t_rel >= Timing.IdleTime);
|
||||
phi_nonlin(ramp_idx2) = peak_phase_error * sin(2 * pi * f_ripple * (t_rel(ramp_idx2) - Timing.IdleTime));
|
||||
end
|
||||
|
||||
% MIMO 활성 TX 패턴 결정
|
||||
if strcmpi(mimoMode, 'TDM')
|
||||
% TDM: 처프 인덱스에 따라 활성 TX 결정 (1,2,3,1,2,3,...)
|
||||
active_tx_list = mod(m - 1, NumTx) + 1; % 예: m=1→TX1, m=2→TX2, m=3→TX1...
|
||||
elseif strcmpi(mimoMode, 'DDMA')
|
||||
% DDMA: 모든 TX 활성화
|
||||
active_tx_list = 1:NumTx;
|
||||
else
|
||||
% 기본값: 모든 TX 활성화
|
||||
active_tx_list = 1:NumTx;
|
||||
end
|
||||
|
||||
for tx = 1:NumTx
|
||||
% TDM 모드에서 비활성 TX는 스킵
|
||||
if strcmpi(mimoMode, 'TDM') && ~ismember(tx, active_tx_list)
|
||||
adc_raw_data(:, tx, m, :) = 0; % 비활성 TX는 0
|
||||
continue;
|
||||
end
|
||||
|
||||
for rx = 1:NumRx
|
||||
signal_mix = zeros(1, N_adc_samples);
|
||||
|
||||
for kt = 1:NumTargets
|
||||
% (1) 진폭 결합: Vtx(f) * G_tx * Space_Loss(f) * G_rx * rxPathGain
|
||||
A_path = squeeze(RxOut.space_loss_amp(kt, rx, tx, m, :))';
|
||||
|
||||
% 샘플별 가변 송신 진폭(Vtx_inst) 적용
|
||||
A_total = Vtx_inst .* (TxOut.G_tx_amp(kt, tx) * A_path * sqrt(rxPathGain_lin));
|
||||
|
||||
% (2) TTD 기반 Beat Phase (정밀한 타이밍 t_adc 반영)
|
||||
tau = squeeze(RxOut.tau(kt, rx, tx, m, :))';
|
||||
beat_phase = 2*pi * (f_start * tau + Slope * tau .* t_adc - 0.5 * Slope * tau.^2);
|
||||
% add transmit impairments (phase noise + nonlinearity)
|
||||
beat_phase = beat_phase + phi_noise + phi_nonlin;
|
||||
|
||||
% (3) DDMA 모드에서 위상 시프트 적용
|
||||
if strcmpi(mimoMode, 'DDMA')
|
||||
phase_shift = 2 * pi * (tx - 1) * (m - 1) / NumTx;
|
||||
beat_phase = beat_phase + phase_shift;
|
||||
end
|
||||
|
||||
% (4) 신호 합산
|
||||
base_sig = A_total .* exp(1j * beat_phase);
|
||||
if enable_spur && exist('SpurParams','var') && ~isempty(SpurParams)
|
||||
spur_vec = generate_spur(SpurParams, t_adc, base_sig);
|
||||
signal_mix = signal_mix + base_sig + spur_vec;
|
||||
else
|
||||
signal_mix = signal_mix + base_sig;
|
||||
end
|
||||
end
|
||||
|
||||
% (5) 복소 백색 가우스 잡음 주입
|
||||
noise = (sigma_n/sqrt(2)) * (randn(1, N_adc_samples) + 1j*randn(1, N_adc_samples));
|
||||
|
||||
adc_raw_data(rx, tx, m, :) = signal_mix + noise;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
% --- 4. 실제 ADC 신호 생성 (모든 TX 신호를 RX별로 합산) ---
|
||||
% 실제 레이더 수신기에서는 각 RX가 모든 TX 신호를 합산 수신
|
||||
adc_combined = zeros(NumRx, NumChirps, N_adc_samples);
|
||||
|
||||
for m = 1:NumChirps
|
||||
for rx = 1:NumRx
|
||||
% 모든 TX의 신호를 합산
|
||||
combined_signal = squeeze(sum(adc_raw_data(rx, :, m, :), 2));
|
||||
% ADC 도메인 spur이 있으면 추가 (orientation 맞추기)
|
||||
if enable_spur && exist('SpurParams','var') && isfield(SpurParams,'adc')
|
||||
spur_adc = generate_spur(SpurParams, t_adc);
|
||||
% ensure same shape as combined_signal (Nx1 vs 1xN)
|
||||
spur_adc = reshape(spur_adc, size(combined_signal));
|
||||
combined_signal = combined_signal + spur_adc;
|
||||
end
|
||||
adc_combined(rx, m, :) = combined_signal;
|
||||
end
|
||||
end
|
||||
|
||||
% --- 5. 거리별 스퍼: DC offset/LO leakage 및 clipping ---
|
||||
if enable_spur && exist('SpurParams','var')
|
||||
% LO leakage: 모든 도플러에 상수/DC 성분 추가
|
||||
if isfield(SpurParams,'lo_leak')
|
||||
dc_amp = SpurParams.lo_leak.amp;
|
||||
adc_combined = adc_combined + dc_amp;
|
||||
end
|
||||
|
||||
% Clipping spur: 특정 거리에서 비선형 왜곡
|
||||
if isfield(SpurParams,'clip')
|
||||
target_range = SpurParams.clip.range;
|
||||
beat_freq = 2 * Slope * target_range / RadarParams.Basic.c;
|
||||
clip_amp = SpurParams.clip.amp;
|
||||
|
||||
for m = 1:NumChirps
|
||||
% 해당 비트 주파수의 신호 생성 (코사인)
|
||||
clip_tone = clip_amp * cos(2*pi*beat_freq*t_adc);
|
||||
for rx = 1:NumRx
|
||||
adc_combined(rx, m, :) = adc_combined(rx, m, :) + reshape(clip_tone, [1, 1, length(clip_tone)]);
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,58 @@
|
||||
function phi_noise = generate_phase_noise_from_datasheet(t, phaseNoiseCfg)
|
||||
% DATASHEET 기반 SSB phase noise(dBc/Hz) 마스크로 시간영역 위상잡음(rad) 생성
|
||||
% 입력:
|
||||
% t : 시간 벡터 [1xN] 또는 [Nx1] (초)
|
||||
% phaseNoiseCfg.offset_Hz : 오프셋 주파수 벡터(Hz)
|
||||
% phaseNoiseCfg.level_dBc_Hz : 각 오프셋에서의 SSB phase noise (dBc/Hz)
|
||||
% 출력:
|
||||
% phi_noise : 시간영역 위상잡음 [1xN] (rad)
|
||||
|
||||
t = t(:);
|
||||
N = numel(t);
|
||||
phi_noise = zeros(1, N);
|
||||
if N < 2
|
||||
return;
|
||||
end
|
||||
|
||||
dt = mean(diff(t));
|
||||
fs = 1 / dt;
|
||||
df = fs / N;
|
||||
|
||||
offsets = phaseNoiseCfg.offset_Hz(:);
|
||||
levels_dBc = phaseNoiseCfg.level_dBc_Hz(:);
|
||||
|
||||
valid = isfinite(offsets) & isfinite(levels_dBc) & offsets > 0;
|
||||
offsets = offsets(valid);
|
||||
levels_dBc = levels_dBc(valid);
|
||||
if isempty(offsets)
|
||||
return;
|
||||
end
|
||||
|
||||
[offsets, order] = sort(offsets, 'ascend');
|
||||
levels_dBc = levels_dBc(order);
|
||||
|
||||
f_pos = (1:floor(N/2))' * df;
|
||||
if isempty(f_pos)
|
||||
return;
|
||||
end
|
||||
|
||||
if numel(offsets) == 1
|
||||
L_dBc = levels_dBc(1) * ones(size(f_pos));
|
||||
else
|
||||
L_dBc = interp1(log10(offsets), levels_dBc, log10(f_pos), 'linear', 'extrap');
|
||||
end
|
||||
|
||||
% SSB phase noise L(f) 와 위상 PSD 관계: L(f) ~= 0.5 * S_phi(f)
|
||||
% => S_phi(f) ~= 2 * 10^(L(f)/10) [rad^2/Hz]
|
||||
S_phi = 2 * 10.^(L_dBc / 10);
|
||||
|
||||
% 협대역 랜덤 사인 성분 합성
|
||||
amp = sqrt(2 * S_phi * df); % 각 톤 진폭(rad)
|
||||
rand_phase = 2 * pi * rand(size(f_pos));
|
||||
|
||||
t_rel = t - t(1);
|
||||
% NxK 행렬 계산
|
||||
phase_matrix = 2*pi*(t_rel * f_pos.') + rand_phase.';
|
||||
phi_noise = (cos(phase_matrix) * amp).';
|
||||
phi_noise = phi_noise(:).';
|
||||
end
|
||||
@@ -0,0 +1,83 @@
|
||||
function spur = generate_spur(SpurParams, t, baseSignal)
|
||||
%GENERATE_SPUR create spur signals based on a parameter structure
|
||||
% spur = GENERATE_SPUR(SpurParams, t, baseSignal)
|
||||
% t : time vector (row or column)
|
||||
% baseSignal : (optional) complex baseband signal used for some spur
|
||||
% mechanisms such as mixer nonlinearity. If omitted the
|
||||
% function will only generate independent tones.
|
||||
%
|
||||
% SpurParams is a struct that may contain any of the following fields
|
||||
% .lo : struct with fields amp, freq, phase (optional) -
|
||||
% LO-related spur added to phase of signal
|
||||
% .mixer : struct with fields alpha2, alpha3 - coefficients for
|
||||
% 2nd/3rd order nonlinearity. Requires baseSignal input.
|
||||
% .adc : struct with fields amp, freq, phase - tone added after
|
||||
% ADC (complex). Does not require baseSignal.
|
||||
% .switch : struct with fields amp, freq - square/pulse spur
|
||||
% .pulse : struct with fields amp, freq, duty (0–1), phase -
|
||||
% periodic gating/pulse train (lock) added to output
|
||||
%
|
||||
% Example:
|
||||
% SpurParams = struct();
|
||||
% SpurParams.lo = struct('amp',0.01,'freq',1e6,'phase',0);
|
||||
% SpurParams.mixer= struct('alpha2',1e-4,'alpha3',1e-6);
|
||||
% SpurParams.adc = struct('amp',1e-3,'freq',2e6,'phase',0);
|
||||
% SpurParams.switch = struct('amp',5e-4,'freq',5e5);
|
||||
% SpurParams.pulse = struct('amp',0.02,'freq',500e3,'duty',0.1,'phase',0);
|
||||
% 위 설정은 LO 스퍼, 믹서 비선형, ADC 톤, 스위칭
|
||||
% 잡음에 더해 10% duty pulse train 락킹까지 포함합니다.
|
||||
%
|
||||
% The returned spur vector has the same dimensions as t. If baseSignal
|
||||
% is supplied the mixer nonlinearity is computed element‑wise using that
|
||||
% signal; otherwise only independent spur terms are returned.
|
||||
|
||||
if nargin < 3
|
||||
baseSignal = [];
|
||||
end
|
||||
% ensure t is row for consistent operations
|
||||
t = t(:)';
|
||||
spur = zeros(size(t));
|
||||
|
||||
if isfield(SpurParams, 'lo')
|
||||
p = SpurParams.lo;
|
||||
phase = 0;
|
||||
if isfield(p, 'phase'); phase = p.phase; end
|
||||
spur = spur + p.amp .* sin(2*pi*p.freq .* t + phase);
|
||||
end
|
||||
|
||||
if isfield(SpurParams, 'mixer') && ~isempty(baseSignal)
|
||||
m = SpurParams.mixer;
|
||||
% apply polynomial nonlinearity to the provided base signal
|
||||
if isfield(m, 'alpha2')
|
||||
spur = spur + m.alpha2 .* (baseSignal.^2);
|
||||
end
|
||||
if isfield(m, 'alpha3')
|
||||
spur = spur + m.alpha3 .* (baseSignal.^3);
|
||||
end
|
||||
end
|
||||
|
||||
if isfield(SpurParams, 'adc')
|
||||
a = SpurParams.adc;
|
||||
phase = 0;
|
||||
if isfield(a, 'phase'); phase = a.phase; end
|
||||
spur = spur + a.amp .* exp(1j*(2*pi*a.freq .* t + phase));
|
||||
end
|
||||
|
||||
if isfield(SpurParams, 'switch')
|
||||
s = SpurParams.switch;
|
||||
spur = spur + s.amp .* square(2*pi*s.freq .* t);
|
||||
end
|
||||
|
||||
if isfield(SpurParams, 'pulse')
|
||||
p = SpurParams.pulse;
|
||||
% duty default 50%
|
||||
duty = 0.5;
|
||||
if isfield(p,'duty'); duty = p.duty; end
|
||||
phase = 0;
|
||||
if isfield(p,'phase'); phase = p.phase; end
|
||||
% generate pulse train (0/1) scaled by amp
|
||||
% square with duty cycle multiplied then shifted to [0,1]
|
||||
pulse_wave = (square(2*pi*p.freq .* t + phase, duty*100)+1)/2;
|
||||
spur = spur + p.amp .* pulse_wave;
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,21 @@
|
||||
function RxOut = receive_antenna(ChannelOut, Target, RxPattern)
|
||||
[NumTargets, NumRx, NumTx, NumChirps, N_adc] = size(ChannelOut.space_loss_amp);
|
||||
RxOut = ChannelOut;
|
||||
|
||||
for k = 1:NumTargets
|
||||
for rx = 1:NumRx
|
||||
pat = RxPattern(rx);
|
||||
if strcmpi(pat.Type, '2D')
|
||||
g_dBi = interp2(pat.az_angles, pat.el_angles, pat.gain_dBi, Target.az(k), Target.el(k), 'linear', -20);
|
||||
else
|
||||
g_az = interp1(pat.az_angles, pat.gain_az_dBi, Target.az(k), 'linear', -20);
|
||||
g_el = interp1(pat.el_angles, pat.gain_el_dBi, Target.el(k), 'linear', -20);
|
||||
g_dBi = g_az + g_el - pat.max_gain_dBi;
|
||||
end
|
||||
|
||||
% 수신 안테나 선형 진폭 이득 결합
|
||||
rx_gain_amp = sqrt(10^(g_dBi/10));
|
||||
RxOut.space_loss_amp(k, rx, :, :, :) = RxOut.space_loss_amp(k, rx, :, :, :) * rx_gain_amp;
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user