├── Weatherlike and Phased Array Radar simulator ├── Functions │ ├── cMMSE.m │ ├── FR.m │ ├── gauss_gen.m │ ├── gen_a.m │ ├── CP.m │ ├── gauss_calc.m │ ├── total_power_reflectivity.m │ └── weatherlike_spectra_signals.m └── Weatherlike and Phased Array Simulator │ ├── test_spatial_response.m │ ├── Analysis_script.m │ ├── estimation_accuracies.m │ └── Main.m ├── Noise and non-target filtration adaptive algorithm ├── Functions │ ├── noise-range-average-power.mat │ ├── gauss_calc.m │ ├── gauss_gen.m │ ├── binary_scan_win.m │ ├── target_params.m │ ├── Kernel_pdf.m │ ├── density_pdf_fitting.m │ └── weather_sig_simulator_beta.m └── Main_github.m └── README.md /Weatherlike and Phased Array Radar simulator/Functions/cMMSE.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agrd-eng/Phased-Array-Weather-Radar/HEAD/Weatherlike and Phased Array Radar simulator/Functions/cMMSE.m -------------------------------------------------------------------------------- /Noise and non-target filtration adaptive algorithm/Functions/noise-range-average-power.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agrd-eng/Phased-Array-Weather-Radar/HEAD/Noise and non-target filtration adaptive algorithm/Functions/noise-range-average-power.mat -------------------------------------------------------------------------------- /Weatherlike and Phased Array Radar simulator/Functions/FR.m: -------------------------------------------------------------------------------- 1 | function [X_hat,W] = FR(Y,steer_theta,Delta) 2 | % FR Computed classic beamforming, called Fourier or MF 3 | % 4 | % Description: 5 | % Model: 6 | % Y = S*X+N 7 | % Y dim: NxL 8 | % S dim: NxM 9 | % X dim: MxL 10 | % N: number of antenna elements 11 | % L: number of samples 12 | % M: number of steering angles 13 | % 14 | % Usage: 15 | % [X_hat,W] = FR(Y,steer_theta,Delta) 16 | % 17 | % Output: 18 | % X_hat - signals matrix, estimated reflected signals 19 | % W - beamforming matrix 20 | % 21 | % Input: 22 | % Y - data matrix, samples received by the phased array antenna system 23 | % steer_theta - steering vector, 1 x M, M here is the total number of 24 | % steering angles 25 | % Delta - scalar, ration between d - distance between antenna elements 26 | % for a Uniform Linear Array (ULA) and lambda - system wavelength. 27 | [N,~] = size(Y); 28 | S = gen_a(N,Delta,steer_theta); 29 | 30 | W = 1/N*S; % MxN :FR beamformer 31 | X_hat = W'*Y; % MxN*NxL ->X_hat dim: MxL 32 | 33 | end 34 | 35 | 36 | -------------------------------------------------------------------------------- /Weatherlike and Phased Array Radar simulator/Functions/gauss_gen.m: -------------------------------------------------------------------------------- 1 | 2 | function f = gauss_gen(vmax,Ndoppler,M0,M1,M2) 3 | %GAUSS_GEN Generates gaussian spectra based on input moments 4 | % 5 | % Description: 6 | % Gaussian distribution is characterized by three moments, number of bins 7 | % and edges limits. This is used to generate a weatherlike Doppler 8 | % spectra which can be approximated with a Gaussian pdf shape. 9 | % 10 | % Usage: 11 | % f = gauss_gen(vmax,Ndoppler,M0,M1,M2) 12 | % 13 | % Output: 14 | % f - vector: 1 x Ndoppler, Gaussian probability distribution 15 | % function values; 16 | % 17 | % Input: 18 | % 19 | % vmax - scalar, maximum unambiguos Doppler velocity, |v_unamb|; 20 | % Ndoppler - scalar, number of Doppler bins; 21 | % M0 - scalar, input total power; 22 | % M1 - scalar, input mean Doppler velocity; 23 | % M2 - scalar, input spectral width, 1st std. 24 | % 25 | dv = 2*vmax/Ndoppler;% velocity resolution 26 | x = -vmax:dv:vmax-dv;% velocity bins (contains zero frequency/velocity) 27 | 28 | f = M0/(sqrt(2*pi)*M2)*exp(-(x-M1).^2/(2*M2^2)); 29 | 30 | end -------------------------------------------------------------------------------- /Weatherlike and Phased Array Radar simulator/Functions/gen_a.m: -------------------------------------------------------------------------------- 1 | function A = gen_a(M,Delta,theta) 2 | %GEN_A Generates array response vector, a(theta(i)) 3 | % 4 | % Description 5 | % Model used for phased array antenna is: 6 | % X = A*S+N 7 | % X: M x N - received data, M number of antenna elements and N - number 8 | % of samples 9 | % A: M x k - arrays response vectors on column 10 | % S: k x N - signals reflected by each target at k^{th} time sample, row 11 | % N: M x N - Gaussian additive noise 12 | % 13 | % Usage: 14 | % A = gen_a(M,Delta,theta) 15 | % 16 | % Output: 17 | % A - matrix, M x N, where M is the number of antenna elements and N is 18 | % the number of time samples. Each column represent a(theta(k)), 19 | % for each k^{th} time sample. 20 | % 21 | % Input: 22 | % M - scalar, number of antenna elements. 23 | % Delta - scalar, ration between d - distance between antenna elements 24 | % for a Uniform Linear Array (ULA) and lambda - system wavelength. 25 | % theta - steering vector, 1 x k, where k is the number of steering 26 | % angles. 27 | 28 | A = exp((0:M-1).'*1i*2*pi*Delta*sind(theta)); 29 | end 30 | 31 | -------------------------------------------------------------------------------- /Weatherlike and Phased Array Radar simulator/Functions/CP.m: -------------------------------------------------------------------------------- 1 | function [X_hat,W] = CP(Y,steer_theta,Delta) 2 | % CP Computed adaptive beamforming with gain control called Capon 3 | % 4 | % Description: 5 | % Model: 6 | % Y = S*X+N 7 | % Y dim: NxL 8 | % S dim: NxM 9 | % X dim: MxL 10 | % N: number of antenna elements 11 | % L: number of samples 12 | % M: number of steering angles 13 | % 14 | % Usage: 15 | % [X_hat,W] = CP(Y,steer_theta,Delta) 16 | % 17 | % Output: 18 | % X_hat - signals matrix, estimated reflected signals 19 | % W - beamforming matrix 20 | % 21 | % Input: 22 | % Y - data matrix, samples received by the phased array antenna system 23 | % steer_theta - steering vector, 1 x M, M here is the total number of 24 | % steering angles 25 | % Delta - scalar, ration between d - distance between antenna elements 26 | % for a Uniform Linear Array (ULA) and lambda - system wavelength.[N,~] = size(Y); 27 | [N,L] = size(Y); 28 | M = numel(steer_theta); 29 | 30 | Ry = 1/L*(Y*Y'); % samples covariance matrix 31 | 32 | for i = 1:M 33 | S(:,i) = gen_a(N,Delta,steer_theta(i)); 34 | W(:,i) = (Ry^(-1)*S(:,i))/((S(:,i)'*Ry^(-1)*S(:,i))); 35 | end 36 | 37 | X_hat = W'*Y; -------------------------------------------------------------------------------- /Noise and non-target filtration adaptive algorithm/Functions/gauss_calc.m: -------------------------------------------------------------------------------- 1 | function [M0t,M1t,M2t] = gauss_calc(v,vmax,Ndoppler) 2 | %GAUSS_CALC Calculates Doppler spectrum moments 3 | % Description: 4 | % To compute Doppler spectrum moments we assume weather Doppler spectra 5 | % follows a Gaussian distribution. Thus zero moment, M0 is total power 6 | % reflectivity, first moment, M1, is mean Doppler velocity, and second 7 | % moment, M2, is first standard deviation (aka spectral width). 8 | %Usage: 9 | % [M0t,M1t,M2t] = gauss_calc(v,vmax,Ndoppler) 10 | %Input 11 | % v - Doppler velocity grid; 12 | % vmax - maximum unambiguous Doppler velocity; 13 | % Ndoppler - number of Doppler bins. 14 | %Output 15 | % M0t - zero moment of Gausian Doppler spectrum (power) 16 | % M1t - first moment of Gausian Doppler spectrum (mean velocity) 17 | % M2t - second moment of Gausian Doppler spectrum (power) 18 | %========================================================================== 19 | % v.1.0 - AG, 2021 20 | % 02.06.2021, OK - TODO - add more descriptions 21 | %========================================================================== 22 | dv = 2*vmax/Ndoppler; 23 | x = -vmax:dv:vmax-dv; 24 | 25 | M0t = sum(v*dv); 26 | M1t = (1/M0t)*sum(x.*abs(v).*dv); 27 | M2t = sqrt((1/(M0t)*sum((x-M1t).^2.*abs(v).*dv))); 28 | 29 | end -------------------------------------------------------------------------------- /Weatherlike and Phased Array Radar simulator/Functions/gauss_calc.m: -------------------------------------------------------------------------------- 1 | function [M0t,M1t,M2t] = gauss_calc(v,vmax) 2 | %GAUSS_CALC Computes Gaussian pdf moments based on the input pdf 3 | % 4 | % Description: 5 | % Gaussian distribution is characterized by three moments: 6 | % M0: total power 7 | % M1: mean value 8 | % M2: 1st standard deviation 9 | % This is used to generate a weatherlike Doppler spectra for data 10 | % received by a radar. Weather spectra can be approximated with a 11 | % Gaussian pdf shape, we talk here about spectra moments: 12 | % M0: total power reflectivity 13 | % M1: mean Doppler velocity (considered redial wind velocity, v_r [m/s]) 14 | % M2: spectral width [m/s] 15 | % 16 | % Usage: 17 | % [M0t,M1t,M2t] = gauss_calc(v,vmax) 18 | % 19 | % Output: 20 | % M0t - scalar, total power reflectivity, [linear scale] 21 | % M1t - scalar, mean Doppler velocity, [m/s] 22 | % M2t - scalar, spectral width, [m/s] 23 | % 24 | % Input: 25 | % v - vector: 1 x N, where N is the number of Doppler bins; 26 | % vmax - scalar, maximum unambiguos Doppler velocity, |v_unamb|. 27 | % 28 | 29 | Ndoppler = numel(v); 30 | dv = 2*vmax/Ndoppler; 31 | x = -vmax:dv:vmax-dv; 32 | 33 | M0t = sum(v*dv); 34 | M1t = (1/M0t)*sum(x.*abs(v).*dv); 35 | M2t = sqrt((1/(M0t)*sum((x-M1t).^2.*abs(v).*dv))); 36 | 37 | end -------------------------------------------------------------------------------- /Noise and non-target filtration adaptive algorithm/Functions/gauss_gen.m: -------------------------------------------------------------------------------- 1 | function f = gauss_gen(vmax,Ndoppler,M0,M1,M2) 2 | %GAUSS_GEN Generates Gaussian distribution shape 3 | % Description: 4 | % To compute Doppler spectrum moments we assume weather Doppler spectra 5 | % follows a Gaussian distribution. Thus zero moment, M0 is total power 6 | % reflectivity, first moment, M1, is mean Doppler velocity, and second 7 | % moment, M2, is first standard deviation (aka spectral width). Using 8 | % this inpus parameters, number of bins (= NDoppler) and edges |v_{max}|, 9 | % one can generate any Gaussian distribution. 10 | %Usage: 11 | % f = gauss_gen(vmax,Ndoppler,M0,M1,M2) 12 | %Input 13 | % vmax - scalar, maximum unambigous Doppler velocity; 14 | % Ndoppler - scalar, number of Doppler bins; 15 | % M0,M1 and M2 - scalar values, represents total power, mean Doppler 16 | % velocity and spectral width respectively. 17 | % 18 | %Output 19 | % f - vector, resulted values for the Gaussian distribution shape. 20 | %========================================================================== 21 | % v.1.0 - AG, 2021 22 | % August 2021 - Helper added 23 | %========================================================================== 24 | dv = 2*vmax/(Ndoppler);% velocity resolution 25 | x = -vmax:dv:vmax-dv;% velocity bins 26 | 27 | f = M0/(sqrt(2*pi)*M2)*exp(-(x-M1).^2/(2*M2^2)); 28 | -------------------------------------------------------------------------------- /Weatherlike and Phased Array Radar simulator/Weatherlike and Phased Array Simulator/test_spatial_response.m: -------------------------------------------------------------------------------- 1 | % Test spatial response 2 | 3 | % Gives results as in article when next variables are set in Main as follows: 4 | % N = 128 5 | % d_el = 0.1; 6 | % steer_theta = (10:d_el:35);% BF elevation angles [deg] 7 | % Prx_max = 10.^([20 40]./10);% represent power level at the mean theta position 8 | % el_Prx_max = [25 60]; % Elevation Angle that corresponds with targets max power 9 | % std_Prx_tg = 1*ones(1,numel(Prx_max));% Elevation Width of the spectrum 10 | % SNR = 50 11 | 12 | A = exp((0:N-1)'*1i*(2*pi*delta*sind(steer_theta))); 13 | % ind(1)=find(steer_theta=10.77,1,'first'); 4 | right_tg(1) = find(steer_theta<=22.6,1,'last'); 5 | right_tg(2) = find(steer_theta>=26.5,1,'first'); 6 | extreme(1) = find(steer_theta<=2.88,1,'last')+1; 7 | extreme(2) = find(steer_theta>=32.46,1,'first')-1; 8 | 9 | xl_int = [steer_theta(left_tg(1)) steer_theta(left_tg(2))]; 10 | x2_int = [steer_theta(right_tg(1)) steer_theta(right_tg(2))]; 11 | 12 | xl_out1 = [steer_theta(extreme(1)) steer_theta(left_tg(1))]; 13 | xl_out2 = [steer_theta(left_tg(2)) steer_theta(right_tg(1))]; 14 | xl_out3 = [steer_theta(right_tg(2)) steer_theta(extreme(2))]; 15 | 16 | for j = 1:2 % 2 versions for Ground truth 17 | for i = 1:3% 3 moments 18 | M_truth(:,:,j) = [10*log10(abs(M0_truth(:,j)).');M1_truth(:,j).';M2_truth(:,j).']; 19 | end 20 | end 21 | M_est = zeros(3,numel(steer_theta),N_meth); 22 | 23 | for m = 1:N_meth 24 | M_est(:,:,m) = [10*log10(abs(M0_est(m,:)));M1_est(m,:);M2_est(m,:)]; 25 | end 26 | 27 | 28 | % M_rms_error(:,:,it) = squeeze(sqrt(var((M_est - repmat(M_truth,1,1,N_meth)),1,2))); 29 | % M_rms_error(:,:,it) = sqrt(squeeze(sum(abs(M_est - repmat(M_truth,1,1,N_meth)).^2,2))./size(M_truth,2)); 30 | 31 | 32 | 33 | % -------------- ADD HERE ALL GRAPHS SCRIPTS YOU WANT TO PLOT ------------- 34 | analysis_graphs_1 35 | % analysis_graphs_2_SNR 36 | % ------------------------------------------------------------------------- 37 | -------------------------------------------------------------------------------- /Noise and non-target filtration adaptive algorithm/Functions/target_params.m: -------------------------------------------------------------------------------- 1 | function M0 = target_params(r_P_peaks,std_P_tg,P_peaks,range) 2 | % 3 | % Description: 4 | % Total power reflectivity (power received by a radar and integrated 5 | % over Doppler spectra) computed based on the target position, width 6 | % and maximum power, when consider that the target's power can be 7 | % characterized by a Gaussian shape in the Doppler spectra. 8 | % 9 | % INPUT: 10 | % r_P_peaks - vector, contains the distance [km] where the maximum 11 | % power of the target(s) is/are located; 12 | % std_P_tg - vector, contains the width [km] of the target(s). 13 | % This defines an extended/point target; 14 | % P_peaks - vectors, contains the max power that each target 15 | % has. 16 | % range - vector, range bins. 17 | % 18 | % OUTPUT: 19 | % M0 - total power received for each range bin, when 20 | % integrated over Doppler spectra. 21 | % 22 | % ======================================================================= 23 | % 18.08.2021 - AG, Helper added 24 | % 25 | % ======================================================================= 26 | K = numel(P_peaks); 27 | 28 | % generate gaussian shape power distribution for each target 29 | for i = 1:K 30 | M0_tg(i,:) = P_peaks(i)*exp(-(range-r_P_peaks(i)).^2/(2*std_P_tg(i)^2)); 31 | end 32 | if K > 1 33 | M0 = sum(M0_tg); 34 | else 35 | M0 = M0_tg; 36 | end 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Noise and non-target filtration adaptive algorithm/Functions/Kernel_pdf.m: -------------------------------------------------------------------------------- 1 | 2 | function y_out = Kernel_pdf(input,x,BW) 3 | %KERNEL_PDF Computes continuous non-parametric pdf using Kernel estimator technique. 4 | % 5 | % Description: 6 | % Kernel_pdf(input,x,Bw) function pack together two MATLAB functions 7 | % PD = fitdist(input,BW) and pdf(PD,x), where the former fits 8 | % the input values to a specific distribution, in this case a 9 | % kernel and by default is 'gaussian', and width: BW. If BW is not 10 | % set then is adaptively computed. This function, "fitdist" returns PD, 11 | % which plugged in latter function returns an array 12 | % of values of the pdf, for the pdf specified in PD evaluated at 13 | % the values in x. 14 | % Usage: 15 | % y_out = Kernel_pdf(input,x,BW) 16 | % Input: 17 | % input - vector, contains data samples; 18 | % x - vector, contains data axis; 19 | % BW - scalar, represent width, which is the number of samples 20 | % over which each kernel distribution is computed. 21 | % Output: 22 | % y_out - vector, final resulted distribution, using bassically 23 | % kernel estimation method, which by default for fitdist 24 | % uses Gaussian shape. 25 | %========================================================================== 26 | % v.1.0 - AG, 2021 27 | % August 2021 - Helper Added 28 | %========================================================================== 29 | if nargin == 3 30 | pd_input = fitdist(input,'Kernel','BandWidth',BW); 31 | else 32 | pd_input = fitdist(input,'Kernel'); 33 | end 34 | 35 | y_out = pdf(pd_input,x); 36 | 37 | end -------------------------------------------------------------------------------- /Weatherlike and Phased Array Radar simulator/Functions/total_power_reflectivity.m: -------------------------------------------------------------------------------- 1 | 2 | function M0 = total_power_reflectivity(el_Prx_max,std_Prx_tg,Prx_max,steer_theta) 3 | 4 | %TOTAL_POWER_REFLECTIVITY Generates total power array for multiple targets 5 | % 6 | % Description: 7 | % For fixed range and azimuth angle the atmospheric particles scanned in 8 | % one single radar volume is characterized by a total power value. This 9 | % value can vary with elevation angle. This function returns vector M0 10 | % which is the superposition of the power reflected by multiple targets 11 | % at different elevation angles, discretized by the steering angle. 12 | % Target parameters are maximum power, position of this maximum w.r.t. to 13 | % elevation angle and the elevation width of the target's power 14 | % distribution. This function simulated targets power distribution vs 15 | % elevation angle as a Gaussian shape. 16 | % 17 | % Usage: 18 | % M0 = total_power_reflectivity(el_Prx_max,std_Prx_tg,Prx_max,steer_theta) 19 | % 20 | % Output: 21 | % M0 - vector, 1 x K, where K is the number of angles used for 22 | % steering vector; 23 | % Input: 24 | % el_Prx_max - vector, 1 x M, M is the number of targets 25 | % position of the maximum power w.r.t. elevation angle. 26 | % std_Prx_tg: - vector, 1 x M, 1st standard deviation of the target's power 27 | % distribution; one can simulate either extended targets or 28 | % point targets. 29 | % Prx_max: - vector, 1 x M, target's power (maximum value if we consider that each 30 | % target is characterized by a Gaussian distribution) 31 | % 32 | 33 | K = numel(Prx_max); 34 | 35 | % generate gaussian shape power distribution for each target 36 | for i = 1:K 37 | M0_tg(i,:) = Prx_max(i)*exp(-(steer_theta-el_Prx_max(i)).^2/(2*std_Prx_tg(i)^2)); 38 | end 39 | 40 | if K > 1 41 | M0 = sum(M0_tg); 42 | else 43 | M0 = M0_tg; 44 | end 45 | 46 | end 47 | 48 | -------------------------------------------------------------------------------- /Noise and non-target filtration adaptive algorithm/Functions/density_pdf_fitting.m: -------------------------------------------------------------------------------- 1 | function rmse = density_pdf_fitting(density_in) 2 | %DENSITY_PDF_FITTING Compute rmse between estimated and U-quadratic pdf 3 | % 4 | % Description 5 | % Computes RMSE value between estimated pdf 6 | % given by density vector returned by binary_scan_win.m 7 | % function: density_in,, and pdf for U-quadratic 8 | % distribution. 9 | % Parametric U-quadratic pdf is computed considering 10 | % that density range is between [0,1]. In order to 11 | % computed non-parametric pdf and to estimate rmse 12 | % value, which is a scalar, we use a kernel pdf estimation 13 | % technique with adaptive width. 14 | % This can be found under MATLAB functions as fitdist.m 15 | % and then pdf.m to generate the pdf. These two 16 | % functions are packed under function called 17 | % Kernel_pdf.m which can be found in MAX3D Toolbox. 18 | % Usage: 19 | % rmse = density_pdf_fitting(density_in) 20 | % Input: 21 | % density_in - vector, pixels density values computed for each position of a 22 | % fixed-size sliding window, in a raw binary image. 23 | % Output 24 | % rmse - root mean square error - scalar value computed 25 | % between estimated pdf using density_in using a Kernel 26 | % estimator (Gaussian kernel), and U-quadratic pdf. 27 | %========================================================================== 28 | % v.1.0 - AG, 2021 29 | % 02.06.2021, OK - TODO - add more descriptions 30 | % August - AG, description added 31 | %========================================================================== 32 | a = 0; 33 | b = 1; 34 | 35 | x = linspace(a,b,100); 36 | 37 | beta = (a+b)/2; 38 | alpha = 12/(b-a)^3; 39 | u_quadr = alpha*(x-beta).^2; 40 | 41 | y_out = Kernel_pdf(density_in,x); 42 | 43 | rmse = sqrt(mean((u_quadr-y_out).^2)); 44 | 45 | end 46 | 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Main Repository 2 | 3 | This repository contains personal developed algorithms for signal processing for radar systems. Different topics 4 | are listed in different folders. In this README, each chapter contains a brief explanation for each folder. 5 | More detailed explanations can be found in each folder. 6 | 7 | ## Weatherlike and Phased Array Radar 8 | 9 | This is a phased array radar data simulator for both extended (weather) and point targets, which can be tested 10 | for fast rotating radar. The final goal is to test the performances of three different beamforming (BF) methods: 11 | 12 | 1. Fourier; [1] 13 | 2. Capon; [1] 14 | 3. Recursive MMSE (Minimum Mean Square Error) with gain control [1]; 15 | 16 | w.r.t. weather objects, when three main criteria for the BF methods are researched: 17 | 18 | 1. Robusted to a limited number of Doppler bins (i.e. fast rotating radar); 19 | 2. Accurate estimation of amplitude and phase information; 20 | 3. Performances for sidelobes suppression. 21 | 22 | This goal is achieved by generating desired Doppler weather spectra, characterized by three statistical moments: 23 | 1. Zero moment: total power reflectivity; 24 | 2. First moment: mean Doppler velocity [m/s]; 25 | 3. Second moment: spectral width [m/s]; 26 | 27 | where Doppler weather spectra is assumed to follow a Gaussian distribution shape. Next, Doppler data is transformed 28 | (using ifft) in time domain and used as input for the the data model used for a phased array antenna: 29 | * Y = S*X+N 30 | 31 | ,where time domain signals (ground truth) are stored in matrix X, S is a matrix of array response vectors, a(theta(k)), 32 | and N is i.i.d. Gaussian noise. The role of the beamforming algorithms is to estimate X from Y, when Y is noisy. 33 | 34 | NOTE: weather object represents an object spread over multiple elevation angles with wide spectra width. However, point 35 | targets can be simulated as well, when elevation spread and spectral width are much narrower. 36 | 37 | Finally, \hat{X} for each BF method is processed for Doppler domain and statistical moments are computed, such that, 38 | the performances of the BF methods are compared between them and with the ground truth moments values. 39 | 40 | 41 | ## References 42 | [1] E. Yoshikawa et al., “MMSE Beam Forming on Fast-Scanning Phased Array Weather Radar,” IEEE Trans. Geosci. Remote Sens., vol. 51, no. 2, pp. 3077–3088, 2013. -------------------------------------------------------------------------------- /Noise and non-target filtration adaptive algorithm/Functions/weather_sig_simulator_beta.m: -------------------------------------------------------------------------------- 1 | function [X_PS_nf, X_PS_n,M0_truth,M1_truth,M2_truth] = weather_sig_simulator_beta(M0,M1,M2,L,vmax,varn) 2 | % WEATHER_SIG_SIMULATOR_BETA Simulates weather like time domain signals 3 | % 4 | % Description: 5 | % When considered that Doppler weather spectra, or any other point 6 | % target spectra can be parametrized as a Gaussian shape distribution 7 | % then it can be simulated. For this, the algorithm of Zrnic from [1] 8 | % is employed and implemented in this function. A gaussian 9 | % distribution can be characterized by three moments: M0, M1 and M2, 10 | % total power, mean and first standard deviation. When estimated 11 | % based on a Doppler spectra they are called: total power 12 | % reflectivity, mean Doppler velocity and spectral width. 13 | % 14 | % Usage: 15 | % [X_PS_nf, X_PS_n,M0_truth,M1_truth,M2_truth] = weather_sig_simulator_beta(M0,M1,M2,L,vmax,varn) 16 | % 17 | % Input: 18 | % M0 - vector, total power reflectivity; 19 | % M1 - vector, mean Doppler velocity; 20 | % M2 - vector, spectral width; 21 | % L - scalar, number of Doppler bins; 22 | % vmax - maximum unambiguous Doppler velocity; 23 | % varn - noise variance when white noise. 24 | % Output: 25 | % X_PS_nf - vector, noise free time series signal; 26 | % X_PS_n - vector, noisy time series signal; 27 | % M0_truth - vector, noisy total power reflectivity; 28 | % M1_truth - vector, noisy mean Doppler velocity; 29 | % M2_truth - vector, noisy spectral width. 30 | % 31 | % ======================================================================== 32 | % 18.08.2021 Helper added 33 | % ======================================================================== 34 | M = numel(M0); % number of sources 35 | 36 | for m = 1:M 37 | 38 | ph = -pi+2*pi*rand(1,L);% uniformly distributed phase [-pi,pi] 39 | UD = rand(1,L);% uniformly distributed random variable [0,1] 40 | v = gauss_gen(vmax,L,M0(m),M1(m),M2(m));% v is in power 41 | 42 | X_PS_nf(m,:) = ((-v.*log(UD))).*exp(1i*ph);% noise free Power Spectrum 43 | 44 | X_PS_n(m,:) = ((-(v+varn(m)).*log(UD))).*exp(1i*ph);% Power spectrum 45 | 46 | [M0_truth(m,1),M1_truth(m,1),M2_truth(m,1)] = gauss_calc(abs(X_PS_n(m,:)),vmax,L);% Moments computation with noise 47 | 48 | end 49 | 50 | % [1] D. S. Zrnic,Simulation of Weatherlike Doppler Spectra and Signals,J.Appl.Meteorol.14, no.4, 619 (June 1975) 51 | -------------------------------------------------------------------------------- /Weatherlike and Phased Array Radar simulator/Weatherlike and Phased Array Simulator/estimation_accuracies.m: -------------------------------------------------------------------------------- 1 | disp('--yellow--') 2 | disp('---------------------') 3 | disp('--total power--') 4 | for i = 1:3 5 | temp = [10*log10(M0_truth(left_tg(1):left_tg(2),1).') - 10*log10(M0_est(i,left_tg(1):left_tg(2)))... 6 | 10*log10(M0_truth(right_tg(1):right_tg(2),1).') - 10*log10(M0_est(i,right_tg(1):right_tg(2)))]; 7 | mb_power(i) = mean(temp); 8 | std_power(i) = std(temp); 9 | end 10 | mb_power 11 | std_power 12 | disp('--mean Doppler velocity--') 13 | for i = 1:3 14 | 15 | temp = [(M1_truth(left_tg(1):left_tg(2),1).') - (M1_est(i,left_tg(1):left_tg(2)))... 16 | (M1_truth(right_tg(1):right_tg(2),1).') - (M1_est(i,right_tg(1):right_tg(2)))]; 17 | mb_vel(i) = mean(abs(temp)); 18 | std_vel(i) = std(abs(temp)); 19 | end 20 | mb_vel 21 | std_vel 22 | disp('--spectral width--') 23 | for i = 1:3 24 | temp = [(M2_truth(left_tg(1):left_tg(2),1).') - (M2_est(i,left_tg(1):left_tg(2)))... 25 | (M2_truth(right_tg(1):right_tg(2),1).') - (M2_est(i,right_tg(1):right_tg(2)))]; 26 | mb_sw(i) = mean(abs(temp)); 27 | std_sw(i) = std(abs(temp)); 28 | end 29 | mb_sw 30 | std_sw 31 | 32 | clear mb_power mb_vel mb_sw std_power std_vel std_sw 33 | 34 | disp('----------------------------') 35 | disp('---blue---') 36 | disp('--total power--') 37 | for i = 1:3 38 | temp = [10*log10(M0_truth(extreme(1):left_tg(1),1).') - 10*log10(M0_est(i,extreme(1):left_tg(1)))... 39 | 10*log10(M0_truth(left_tg(2):right_tg(1),1).') - 10*log10(M0_est(i,left_tg(2):right_tg(1)))... 40 | 10*log10(M0_truth(right_tg(2):extreme(2),1).') - 10*log10(M0_est(i,right_tg(2):extreme(2)))]; 41 | mb_power(i) = mean(temp); 42 | std_power(i) = std(temp); 43 | end 44 | mb_power 45 | std_power 46 | 47 | disp('---mean D vel---') 48 | for i = 1:3 49 | temp = [(M1_truth(extreme(1):left_tg(1),1).') - (M1_est(i,extreme(1):left_tg(1)))... 50 | (M1_truth(left_tg(2):right_tg(1),1).') - (M1_est(i,left_tg(2):right_tg(1)))... 51 | (M1_truth(right_tg(2):extreme(2),1).') - (M1_est(i,right_tg(2):extreme(2)))]; 52 | mb_vel(i) = mean(abs(temp)); 53 | std_vel(i) = std(abs(temp)); 54 | end 55 | mb_vel 56 | std_vel 57 | 58 | disp('--spectral width---') 59 | for i = 1:3 60 | temp = [(M2_truth(extreme(1):left_tg(1),1).') - (M2_est(i,extreme(1):left_tg(1)))... 61 | (M2_truth(left_tg(2):right_tg(1),1).') - (M2_est(i,left_tg(2):right_tg(1)))... 62 | (M2_truth(right_tg(2):extreme(2),1).') - (M2_est(i,right_tg(2):extreme(2)))]; 63 | mb_sw(i) = mean(abs(temp)); 64 | std_sw(i) = std(abs(temp)); 65 | end 66 | mb_sw 67 | std_sw 68 | -------------------------------------------------------------------------------- /Weatherlike and Phased Array Radar simulator/Functions/weatherlike_spectra_signals.m: -------------------------------------------------------------------------------- 1 | function [X_TD,X_PS_n,M0_truth,M1_truth,M2_truth] = weatherlike_spectra_signals(M0,M1,M2,L,vmax,varn) 2 | %WEATHERLIKE_SPECTRA_SIGNALS Simulate weatherlike Doppler spectra and signals 3 | % 4 | % Description: 5 | % To study the performances of different algorithms used for radar weather 6 | % applications, e.g. beamforming, in case of phased array radar, weather targets 7 | % detection and noise or/and clutter cancelation algorithms etc., a 8 | % simulation technique is required. Within this simulator Doppler spectra 9 | % is generated as a Gaussian shape, which requires three moments: total 10 | % power reflectivity, mean Doppler velocity and spectral width. Moreover, 11 | % additive noise power can be introduced in the spectra. Formula and 12 | % algorithm used is taken from [1]. 13 | % 14 | % Usage: 15 | % [X_TD,X_PS_n,M0_truth,M1_truth,M2_truth] = weatherlike_spectra_signals(M0,M1,M2,L,vmax,varn) 16 | % 17 | % Output: 18 | % X_TD - matrix: K x L, matrix containing weather like signals - time 19 | % domain, for L Doppler bins and K is either the number of range bin 20 | % or elevation bins, whatever user wants to generate 21 | % X_PS - matrix: K x L, matrix containing weather like Doppler spectra 22 | % - frequency domain; 23 | % M0_truth - matrix: K x 2, that contains total power (zero moment) 24 | % values for weather like Doppler spectra with additive noise 25 | % for the 1st row and noise free for the 2nd one; 26 | % M1_truth - matrix: K x 2, that contains mean Doppler velocity (1st moment) 27 | % values for weather like Doppler spectra with additive noise 28 | % for the 1st row and noise free for the 2nd one; 29 | % M2_truth - matrix: K x 2, that contains spectral width (2nd moment) 30 | % values for weather like Doppler spectra with additive noise 31 | % for the 1st row and noise free for the 2nd one. 32 | % 33 | % Input: 34 | % M0 - vector, 1 x K: total power reflectivity; 35 | % M1 - vector, 1 x K: mean Doppler velocity; 36 | % M2 - vector, 1 x K: spectral width (1st standard deviation) 37 | % L - number of Doppler bins 38 | % vmax - maximum unambiguos Doppler velocity, |v_unamb| 39 | % varn - noise variance 40 | 41 | K = numel(M0); % number of range bins/elevation bins 42 | 43 | for m = 1:K 44 | 45 | ph = -pi+2*pi*rand(1,L);% uniformly distributed phase [-pi,pi] 46 | UD = rand(1,L);% uniformly distributed random variable [0,1] 47 | v = gauss_gen(vmax,L,M0(m),M1(m),M2(m));% v is returned for power values 48 | 49 | X_PS_nf(m,:) = ((-(v).*log(UD))).*exp(1i*ph);% power spectrum [1] 50 | X_TD(m,:) = ifft(fftshift((L.*X_PS_nf(m,:)).^(1/2))); % power spectrum -> amplt spectrum(denormalized) -> signal time domain 51 | 52 | X_PS_n(m,:) = ((-(v+varn).*log(UD))).*exp(1i*ph);% power spectrum [1] 53 | 54 | 55 | [M0_truth(m,1),M1_truth(m,1),M2_truth(m,1)] = gauss_calc(abs(X_PS_n(m,:)),vmax);% Moments computation with noise 56 | [M0_truth(m,2),M1_truth(m,2),M2_truth(m,2)] = gauss_calc(abs(X_PS_nf(m,:)),vmax);% noise-free Moments computation 57 | 58 | end 59 | % [1] D. S. Zrnic,Simulation of Weatherlike Doppler Spectra and Signals,J.Appl.Meteorol.14, no.4, 619 (June 1975) 60 | 61 | end 62 | 63 | -------------------------------------------------------------------------------- /Weatherlike and Phased Array Radar simulator/Weatherlike and Phased Array Simulator/Main.m: -------------------------------------------------------------------------------- 1 | 2 | clc 3 | clear 4 | close all 5 | 6 | addpath ('D:\1_TUDelft\9_Master_Thesis\All programs\AG_finalver_software - Copy\Functions') 7 | L = input('Give number of Doppler bins [256]: '); 8 | if isempty(L) 9 | L = 256; 10 | end 11 | N = input('Give number of antenna elements [40]: '); 12 | if isempty(N) 13 | N = 40;% number of antenna elements 14 | end 15 | 16 | % Fixed phased array parameter values 17 | d = 20e-3; % distance between elements 18 | f0 = 9650e6; %Hz center freq 19 | c = physconst('lightspeed'); 20 | lambda = c/f0; 21 | delta = d/lambda;% d/lambda (d = distance between antenna elements) 22 | d_el = rad2deg(.886/(N*delta));% broadside elevation resolution 23 | % d_el = 0.1;% if one wants to analyze Antenna Spatial Response 24 | steer_theta = (-5:d_el:35);% BF elevation angles [deg] 25 | 26 | % Max unambiguous Doppler velocity 27 | vmax = 7.39;%m/s max unambigous Doppler velocity 28 | dv = 2*vmax/L; 29 | vel = -vmax:dv:vmax-dv; 30 | 31 | % Target parameters 32 | Prx_max = 10.^([40 60]./10);% represent power level at the mean theta position 33 | el_Prx_max = [10 25]; % Elevation Angle that corresponds with targets max power 34 | std_Prx_tg = 1.5*ones(1,numel(Prx_max));% Elevation Width of the spectrum 35 | 36 | % % Generate M0 37 | M0 = total_power_reflectivity(el_Prx_max,std_Prx_tg,Prx_max,steer_theta); 38 | 39 | % Set noise variance w.r.t. the maximum power among all targets and given 40 | % SNR 41 | SNR = input('Give SNR value [dB]: [20]'); 42 | if isempty(SNR) 43 | SNR = 20; 44 | end 45 | varn = max(Prx_max)/10^(SNR/10); 46 | comp = L*varn/N*dv;% compensation - computes noise floor for final plots 47 | 48 | % M1 and M2 49 | % Below is only one example to set these two parameters M1 and M2 50 | m2 = 1; % Doppler spectrum width 51 | 52 | M1 = linspace(-vmax+1*m2,vmax-1*m2,numel(M0)); % % monotonically increasing mean Doppler velocity 53 | % or 54 | % M1 = 5*ones(1,numel(M0)); % constant mean Doppler velocity 55 | M2 = m2*ones(1,numel(M0)); % constant spectral width 56 | 57 | % % Shows M0, M1 and M2 58 | font_s = 30; 59 | f1_1 = figure('units','normalized','outerposition',[0 0 1 1]); 60 | figure(f1_1) 61 | 62 | subplot(131) 63 | plot(steer_theta, 10*log10(M0),'-ob','Linewidth',2) 64 | ylim([-10 70]) 65 | xlim([0.5 29.5]) 66 | xlabel('Elevation [deg]') 67 | ylabel('Power [dB]') 68 | title('M0') 69 | grid minor 70 | set(gca,'Fontsize',font_s) 71 | 72 | subplot(132) 73 | plot(steer_theta, M1,'-or','Linewidth',2) 74 | xlim([0.5 29.5]) 75 | xlabel('Elevation [deg]') 76 | ylabel('Velocity [m/s]') 77 | title('M1') 78 | grid minor 79 | set(gca,'Fontsize',font_s) 80 | 81 | subplot(133) 82 | plot(steer_theta, M2,'-og','Linewidth',2) 83 | xlim([0.5 29.5]) 84 | xlabel('Elevation [deg]') 85 | ylabel('Velocity [m/s]') 86 | title('M2') 87 | grid minor 88 | set(gca,'Fontsize',font_s) 89 | 90 | % Generate Weather like time domains signals to plug it in data model for 91 | % the phased antenna array 92 | [X,X_PS,M0_truth,M1_truth,M2_truth] = weatherlike_spectra_signals(M0,M1,M2,L,vmax,varn/N); 93 | % Model used for data model of a phase array antenna is: 94 | % X = S*X + Noise 95 | % The unknown is X 96 | S = gen_a(N,delta,steer_theta); 97 | noise = sqrt(varn/2)*(randn(N,L)+1i*randn(N,L));% [antenna elem's]x[doppler bins] 98 | Y = S*X+noise; 99 | % 100 | % Estimate X using three different beamforming methods: 101 | % 1. recursive MMSE with gain control 102 | % 2. Fourier, aka Matched Filtering (MF) 103 | % 3. Capon, aka Minimum Variance Distortionless Response (MVDR) 104 | N_meth = 3; % number of beamforming methods to compare 105 | X_hat = zeros(numel(steer_theta),L,N_meth);% amplitude time domain signal 106 | data_ED = zeros(numel(steer_theta),L,N_meth);% power spectrum signal 107 | 108 | % Recursive MMSE (cMMSE), 'c' comes from converged, when th is reached 109 | [X_hat(:,:,1),iter_out,W_cmmse] = cMMSE(Y,steer_theta,delta,varn,0.001); 110 | % Fourier (FR) 111 | [X_hat(:,:,2),W_fr] = FR(Y,steer_theta,delta); 112 | % Capon (CP) 113 | [X_hat(:,:,3),W_cp] = CP(Y,steer_theta,delta); 114 | 115 | 116 | data_ED = 1/L.*abs(fftshift(fft(squeeze(X_hat(:,:,:)),[],2),2)).^2;% Power spectrum 117 | for m = 1:N_meth 118 | 119 | for n = 1:numel(steer_theta) 120 | [M0_est(m,n),M1_est(m,n),M2_est(m,n)] = gauss_calc(data_ED(n,:,m),vmax); 121 | end 122 | 123 | end 124 | disp(['No of iterations for cMMSE: ',num2str(iter_out)]) 125 | 126 | % Code lines for plots are written in the next scripts 127 | Analysis_script 128 | test_spatial_response 129 | estimation_accuracies 130 | 131 | -------------------------------------------------------------------------------- /Noise and non-target filtration adaptive algorithm/Main_github.m: -------------------------------------------------------------------------------- 1 | addpath('D:\1_TUDelft\9_Master_Thesis\All programs\AG_finalver_software - Copy\To_commit_2\Functions') 2 | load('noise-range-average-power.mat') 3 | % A) 4 | 5 | % % Rate of false alarme as function of threshold [db] 6 | Th = 0; % dB threshold used for noise clipping 7 | win_size = 2; % window size used for AMF algorithm 8 | rmse_th = 1e-3; % threshold used for AMF 9 | 10 | % % SNR, range bin of the target and target width 11 | % NOTE: number of targets can be set by giving multiple values for the 12 | % following three variables 13 | SNR_db = 30; 14 | r_P_peaks = 7; % range [km] correspond with max Power of each cluster 15 | std_M0 = 0.5; % km 16 | 17 | % % Radar Parameters 18 | % Doppler bins and velocity axis 19 | L = 256; 20 | vmax = 7.39;%m/s max unambigous Doppler velocity 21 | dv = 2*vmax/L; 22 | v_axis = -vmax:dv:vmax-dv; 23 | 24 | % Range bins 25 | Nr = numel(noise_range_average); 26 | c = physconst('lightspeed'); 27 | B = 66e6; %Hz 28 | dr = c/(2*B)*1e-3; 29 | range = (1:Nr)*dr;%[km] 30 | 31 | % % Compute moments 32 | % M0 - total power reflectivity 33 | SNR_peaks = 10.^(SNR_db./10);% linear scale 34 | Noise_var_peaks = noise_range_average(round(r_P_peaks./dr+1)); 35 | P_peaks = SNR_peaks.*Noise_var_peaks; 36 | std_P_tg = std_M0*ones(1,numel(r_P_peaks));% Range Width of each Cloud 37 | 38 | M0 = target_params(r_P_peaks,std_P_tg,P_peaks,range); 39 | % M1 and M2 40 | m2 = .5; % Doppler spectrum width 41 | M1 = linspace(-vmax+1*m2,vmax-1*m2,Nr); % % monotonically increasing mean Doppler velocity 42 | % M1 = 5*ones(1,numel(M0)); % constant mean Doppler velocity 43 | M2 = m2*ones(1,numel(M0)); % spectral width 44 | 45 | 46 | % % Weatherlike time domain signals and ground truth moments 47 | [X_PS_nf, X_PS_n,M0_truth,M1_truth,M2_truth] = weather_sig_simulator_beta(M0,M1,M2,L,vmax,noise_range_average); 48 | % ------------------------------------------------------------------------- 49 | 50 | % B) Create ground truth 51 | TG_clip_NF = zeros(size(X_PS_nf)); 52 | noise_var_mat = repmat(noise_range_average,[1, L]); 53 | TG_clip_NF(abs(X_PS_nf) > noise_var_mat) = 1; 54 | 55 | E_se = strel('square',2); 56 | TG_clip_MF = imdilate(TG_clip_NF,E_se); 57 | 58 | X_PS_nf_C = TG_clip_MF.*X_PS_nf; 59 | % ------------------------------------------------------------------------- 60 | 61 | % C) AMF 62 | % CLIPPING 63 | TG_clip = zeros(size(X_PS_n)); 64 | noise_var_mat = repmat(noise_range_average*(10^(Th/10)),[1, L]); 65 | TG_clip(abs(X_PS_n) > noise_var_mat) = 1;% Raw binary image 66 | X_PS_n_RB = TG_clip .* X_PS_n; % image after noise thresholding 67 | 68 | rmse_diff = []; % contains square diference between consecutive rmse values 69 | final_dim_SE = []; % final dimension of the structural element (SE) 70 | 71 | av_ov = 0;% cst used to avoid overshooting 72 | mem = 0;% cst to save the number of consecutive H1 hypothesis 73 | rep = 3;% threshold for the maximum number of consecutive H1 74 | 75 | k = 1; 76 | dim_SE = 1; 77 | TG_clip_MF = []; % Target Mask 78 | 79 | while 1 80 | E_se = strel('square',dim_SE); 81 | TG_clip_MF_temp = imopen(TG_clip,E_se); 82 | TG_clip_MF(:,:,k) = imdilate(TG_clip_MF_temp,E_se); 83 | % figure(1) 84 | % imagesc(squeeze(TG_clip_MF(:,:,k))); 85 | density = binary_scan_win(squeeze(TG_clip_MF(:,:,k)),win_size); 86 | rmse(k) = density_pdf_fitting(density); 87 | 88 | % --------------------AMF----------------- 89 | if k > 1 90 | rmse_diff = [rmse_diff (abs(rmse(k)-rmse(k-1)))^2]; 91 | if numel(final_dim_SE) == 0 92 | if (rmse(k)-rmse(k-1))^2 <= rmse_th 93 | if mem == k-1 || mem == 0 94 | av_ov = av_ov+1; 95 | mem = k; 96 | else 97 | av_ov = 0; 98 | mem = 0; 99 | end 100 | if av_ov > rep 101 | break 102 | end 103 | else 104 | mem = 0; 105 | end 106 | end 107 | end 108 | 109 | k = k+1; 110 | dim_SE = dim_SE+1; 111 | end 112 | dim_SE_final = k-(rep); 113 | disp(['Final SE dim: ',num2str(dim_SE_final)]) 114 | 115 | X_PS_n_C = squeeze(TG_clip_MF(:,:,dim_SE_final)).*X_PS_n; 116 | % ------------------------------------------------------------------------ 117 | 118 | % D Plot 119 | 120 | % --- 121 | figure 122 | subplot(221) 123 | imagesc(v_axis,range,10*log10(abs(X_PS_n))) 124 | title('Raw image') 125 | xlabel('Doppler velocity [m/s]') 126 | ylabel('Range [km]') 127 | set(gca,'ydir','norm') 128 | 129 | subplot(222) 130 | imagesc(v_axis,range,10*log10(abs(X_PS_nf_C))) 131 | title('Ground truth image') 132 | xlabel('Doppler velocity [m/s]') 133 | ylabel('Range [km]') 134 | set(gca,'ydir','norm') 135 | 136 | subplot(223) 137 | imagesc(v_axis,range,10*log10(abs(X_PS_n_RB))) 138 | title({'Image after noise thresholding',['Threshold: ', num2str(Th),' dB']}) 139 | xlabel('Doppler velocity [m/s]') 140 | ylabel('Range [km]') 141 | set(gca,'ydir','norm') 142 | 143 | subplot(224) 144 | imagesc(v_axis,range,10*log10(abs(X_PS_n_C))) 145 | title('Image after AMF') 146 | xlabel('Doppler velocity [m/s]') 147 | ylabel('Range [km]') 148 | set(gca,'ydir','norm') 149 | 150 | %---- 151 | figure 152 | plot([1:numel(rmse_diff)],rmse_diff,'-*r'),hold on 153 | yline(rmse_th,'k','linewidth',2);hold off 154 | ylim([rmse_th-0.5 +inf ]) 155 | title('AMF Converging curve') 156 | ylabel('(rmse(k)-rmse(k-1))^2') 157 | xlabel('SE dimension') 158 | 159 | %----- 160 | % Between noisy and ground truth image 161 | for m = 1:Nr 162 | [M0_truth(m,2),M1_truth(m,2),M2_truth(m,2)] = gauss_calc(abs(X_PS_nf_C(m,:)),vmax,L);% Moments computation with noise 163 | end 164 | M0_truth(M0_truth == 0) = NaN; 165 | % 1 - noisy 166 | % 2 - noise free 167 | M0_e(:,1) = sqrt((M0_truth(:,1) - M0_truth(:,2)).^2); 168 | M1_e(:,1) = sqrt((M1_truth(:,1) - M1_truth(:,2)).^2); 169 | M2_e(:,1) = sqrt((M2_truth(:,1) - M2_truth(:,2)).^2); 170 | 171 | % Between noisy and after-AMF-image 172 | for m = 1:Nr 173 | [M0_truth(m,3),M1_truth(m,3),M2_truth(m,3)] = gauss_calc(abs(X_PS_n_C(m,:)),vmax,L);% Moments computation with noise 174 | end 175 | M0_truth(M0_truth == 0) = NaN; 176 | 177 | M0_e(:,2) = sqrt((M0_truth(:,3) - M0_truth(:,2)).^2); 178 | M1_e(:,2) = sqrt((M1_truth(:,3) - M1_truth(:,2)).^2); 179 | M2_e(:,2) = sqrt((M2_truth(:,3) - M2_truth(:,2)).^2); 180 | 181 | M0_err_cor = nanmean(log10(M0_e(:,1)./M0_e(:,2))); 182 | M1_err_cor = nanmean(log10(M1_e(:,1)./M1_e(:,2))); 183 | M2_err_cor = nanmean(log10(M2_e(:,1)./M2_e(:,2))); 184 | 185 | disp('-------------------------------------------') 186 | disp('Estimation Accuracy Gain is: ') 187 | disp(['M0: ',num2str(M0_err_cor),' [log10 scale]']) 188 | disp(['M1: ',num2str(M1_err_cor),' [log10 scale]']) 189 | disp(['M2: ',num2str(M2_err_cor),' [log10 scale]']) 190 | --------------------------------------------------------------------------------