Add path for antenna pattern

This commit is contained in:
2025-07-29 22:15:44 +09:00
parent 90ed080045
commit b1940770ac
+6 -4
View File
@@ -3,6 +3,7 @@ close all;
clc
addpath(genpath(fullfile(pwd, 'Functions')));
addpath(genpath(fullfile(pwd, 'Antenna_Pattern')));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
@@ -297,7 +298,7 @@ g = [G_dB_LNA G_dB_Mixer G_dB_HPF1 G_dB_VGA1 G_dB_HPF2, G_dB_VGA2 G_dB_LPF1 G_dB
% nf = [4.0 0.5 5.0 1.0 0.6 1.0 6.0];
% g = [20.0 -0.5 -7.0 -1.0 21.75 21.75 -5.0];
[cnf,ng] = noisefigure(nf,g)
[cnf,ng] = noisefigure(nf,g);
% NF_dB2 = cal_nf(nf, g, T0);
NF_dB = 12;
@@ -314,6 +315,7 @@ thermal_noise_LNA = sqrt(Pn) * randn([size(rxsig_wo_n)]);
% 02. Mixing
% 2-1. Product
mixed_sig = zeros(size(rxsig_wo_n));
mixed_noise = zeros(size(thermal_noise_LNA));
for rxidx = 1 : Nr
mixed_sig(:,:,rxidx) = dechirping(rxsig_wo_n(:,:,rxidx), Ref_wave(:,:,rxidx));
mixed_noise(:,:,rxidx) = dechirping(thermal_noise_LNA(:,:,rxidx), Ref_wave(:,:,rxidx));
@@ -344,7 +346,7 @@ for rxidx = 1 : Nr
mixed_noise_hpf(:,:,rxidx) = mixed_noise(:,:,rxidx);
end
end
[h_hpf1, w] = freqz(hpf1_d_num,hpf1_d_den, rngFFTlen);
[h_hpf1, ~] = freqz(hpf1_d_num,hpf1_d_den, rngFFTlen);
Loss_hpf1_dB = pow2db(sum(abs(h_hpf1).^2)/rngFFTlen);
Loss_hpf2_dB = pow2db(sum(abs(h_hpf1).^2)/rngFFTlen);
@@ -380,9 +382,9 @@ for rxidx = 1 : Nr
mixed_noise_lpf(:,:,rxidx) = mixed_noise_hpf(:,:,rxidx);
end
end
[h_lpf1, w] = freqz(lpf1_d_num, lpf1_d_den, rngFFTlen);
[h_lpf1, ~] = freqz(lpf1_d_num, lpf1_d_den, rngFFTlen);
Loss_lpf1_dB = pow2db(sum(abs(h_lpf1).^2)/rngFFTlen);
[h_lpf2, w] = freqz(lpf2_d_num, lpf2_d_den, rngFFTlen);
[h_lpf2, ~] = freqz(lpf2_d_num, lpf2_d_den, rngFFTlen);
Loss_lpf2_dB = pow2db(sum(abs(h_hpf1).^2)/rngFFTlen);
% figure()