Calculates the noise weighting of the linear least squares cost function function W = MIMO_Calc_LS_Weight(data, G); Output W = weighting matrix for the linear least squares cost function 1 MIMO experiment: ny x ny x F nu MIMO experiments: ny x ny x nu x F Input data = structure containing the non-parametric data required for the identification data.CY = (sample) noise covariance matrix of Y 1 MIMO experiment: ny x ny x F nu MIMO experiments: ny x ny x nu x F data.CU = (sample) noise covariance matrix of U 1 MIMO experiment: nu x nu x F nu MIMO experiments: nu x nu x nu x F data.CYU = (sample) noise covariance matrix of U 1 MIMO experiment: ny x nu x F nu MIMO experiments: ny x nu x nu x F data.G = frequency response matrix, size ny x nu x F Copyright (c) Rik Pintelon, Vrije Universiteit Brussel - dept. ELEC, 26 November 2009 All rights reserved. Software can be used freely for non-commercial applications only.
0001 function W = MIMO_Calc_LS_Weight(data, G); 0002 % 0003 % Calculates the noise weighting of the linear least squares cost function 0004 % 0005 % function W = MIMO_Calc_LS_Weight(data, G); 0006 % 0007 % 0008 % Output 0009 % 0010 % W = weighting matrix for the linear least squares cost function 0011 % 1 MIMO experiment: ny x ny x F 0012 % nu MIMO experiments: ny x ny x nu x F 0013 % 0014 % Input 0015 % 0016 % data = structure containing the non-parametric data required for the identification 0017 % data.CY = (sample) noise covariance matrix of Y 0018 % 1 MIMO experiment: ny x ny x F 0019 % nu MIMO experiments: ny x ny x nu x F 0020 % data.CU = (sample) noise covariance matrix of U 0021 % 1 MIMO experiment: nu x nu x F 0022 % nu MIMO experiments: nu x nu x nu x F 0023 % data.CYU = (sample) noise covariance matrix of U 0024 % 1 MIMO experiment: ny x nu x F 0025 % nu MIMO experiments: ny x nu x nu x F 0026 % 0027 % data.G = frequency response matrix, size ny x nu x F 0028 % 0029 % 0030 % Copyright (c) Rik Pintelon, Vrije Universiteit Brussel - dept. ELEC, 26 November 2009 0031 % All rights reserved. 0032 % Software can be used freely for non-commercial applications only. 0033 % 0034 0035 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0036 % determine the number of MIMO experiments % 0037 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0038 0039 NumberDim = length(size(data.CY)); % number of matrix dimensions 0040 if NumberDim == 3 0041 NumberExp = 1; % number of MIMO experiments 0042 elseif NumberDim == 4 0043 NumberExp = size(data.CY, 3); % number of MIMO experiments 0044 end % if 0045 0046 0047 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0048 % calculate the weighting matrix W % 0049 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0050 0051 if NumberExp > 1 0052 0053 [ny, nu, F] = size(G); 0054 W = zeros(ny, ny, nu, F); 0055 dummy1 = zeros(ny, nu, F); 0056 dummy2 = zeros(ny, ny, 1, F); 0057 for ee = 1:NumberExp 0058 dummy1(:,:,:) = data.CYU(:,:,ee,:); 0059 dummy2(:,:,1,:) = Mat_Mult(G, Mat_Mult(squeeze(data.CU(:,:,ee,:)), Conj_Trans(G))) ... 0060 - 2*herm(Mat_Mult(dummy1, Conj_Trans(G))); 0061 W(:,:,ee,:) = data.CY(:,:,ee,:) + dummy2; 0062 end % ee, MIMO experiments 0063 0064 else % one MIMO experiment 0065 0066 W = data.CY + Mat_Mult(G, Mat_Mult(data.CU, Conj_Trans(G))) - 2*herm(Mat_Mult(data.CYU, Conj_Trans(G))); 0067 0068 end % if more than one MIMO experiment