📄 cp0204_channel_noise.asv
字号:
function [y] = cp0204_Channel_Noise(x,N_los,SNR)tx = 1; c0 = 10^(-47/20); %47 dB attenuation d = 2; %distance between tx and rxgamma1 = 1.7; %attenuation index[rx,ag] = cp0801_pathloss(tx,c0,d,gamma1); % ag is channel gainTMG = ag^2;if N_los==1 LAMBDA = 0.0233e9; % Cluster Arrival Rate (1/s) lambda = 2.5e9; % Ray Arrival Rate (1/s) GAMMA = 7.1e-9; % Cluster decay factor gamma = 4.3e-9; % Ray decay factor sigma1 = 10^(3.3941/10); % Stdev of the cluster fading sigma2 = 10^(3.3941/10); % Stdev of the ray fading sigmax = 10^(3/10); % Stdev of lognormal shadowingendif N_los==2 LAMBDA = 0.4e9; % Cluster Arrival Rate (1/s) lambda = 0.5e9; % Ray Arrival Rate (1/s) GAMMA = 5.5e-9; % Cluster decay factor gamma = 6.7e-9; % Ray decay factor sigma1 = 10^(3.3941/10); % Stdev of the cluster fading sigma2 = 10^(3.3941/10); % Stdev of the ray fading sigmax = 10^(3/10); % Stdev of lognormal shadowingend if N_los==3 LAMBDA = 0.0667e9; % Cluster Arrival Rate (1/s) lambda = 2.1e9; % Ray Arrival Rate (1/s) GAMMA = 14e-9; % Cluster decay factor gamma = 7.9e-9; % Ray decay factor sigma1 = 10^(3.3941/10); % Stdev of the cluster fading sigma2 = 10^(3.3941/10); % Stdev of the ray fading sigmax = 10^(3/10); % Stdev of lognormal shadowingendif N_los==4 LAMBDA = 0.0667e9; % Cluster Arrival Rate (1/s) lambda = 2.1e9; % Ray Arrival Rate (1/s) GAMMA = 24e-9; % Cluster decay factor gamma = 12e-9; % Ray decay factor sigma1 = 10^(3.3941/10); % Stdev of the cluster fading sigma2 = 10^(3.3941/10); % Stdev of the ray fading sigmax = 10^(3/10); % Stdev of lognormal shadowingendfc = 50e9; [h0,hf,OT,ts,X] = cp0802_IEEEuwb(fc,TMG,LAMBDA,lambda,GAMMA,gamma,sigma1,sigma2,sigmax); X_POWER = var(x);linear_SNR = 10^(SNR/10);noise_sigma = X_POWER/linear_SNR;noise_scale_factor = sqrt(noise_sigma);noise = randn(1,length(x))*noise_scale_factor; %y = conv(x,hf);%y = y(1:length(x));y = y + noise;t= (length(x)/320)*312.5e-9;time = linspace(0,t,length(x));figure(3);S3=stem(time,y); %UNTITLED1 Summary of this function goes here% Detailed explanation goes here
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -