Calculates the noise weighting of the linear least squares cost function function W = MIMO_Calc_IQML_Weight(data, PolyTrans); 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 nexp MIMO experiments (nexp >= 1): ny x ny x nexp x F data.CU = (sample) noise covariance matrix of U 1 MIMO experiment: nu x nu x F nexp MIMO experiments (nexp >= 1): nu x nu x nexp x F data.CYU = (sample) noise covariance matrix of U 1 MIMO experiment: ny x nu x F nexp MIMO experiments (nexp >= 1): ny x nu x nexp x F data.G = frequency response matrix, size ny x nu x F PolyTrans = structure containing the polynomials and transfer functions evaluated in x PolyTrans.A = denominator polynomial plant transfer function evaluated in x.Plant, size 1 x F PolyTrans.G = plant transfer matrix evaluated in x.Plant, 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. Version 24 October 2011
0001 function W = MIMO_Calc_IQML_Weight(data, PolyTrans); 0002 % 0003 % Calculates the noise weighting of the linear least squares cost function 0004 % 0005 % function W = MIMO_Calc_IQML_Weight(data, PolyTrans); 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 % nexp MIMO experiments (nexp >= 1): ny x ny x nexp x F 0020 % data.CU = (sample) noise covariance matrix of U 0021 % 1 MIMO experiment: nu x nu x F 0022 % nexp MIMO experiments (nexp >= 1): nu x nu x nexp x F 0023 % data.CYU = (sample) noise covariance matrix of U 0024 % 1 MIMO experiment: ny x nu x F 0025 % nexp MIMO experiments (nexp >= 1): ny x nu x nexp x F 0026 % 0027 % data.G = frequency response matrix, size ny x nu x F 0028 % 0029 % PolyTrans = structure containing the polynomials and transfer functions evaluated in x 0030 % PolyTrans.A = denominator polynomial plant transfer function evaluated in x.Plant, size 1 x F 0031 % PolyTrans.G = plant transfer matrix evaluated in x.Plant, size ny x nu x F 0032 % 0033 % Copyright (c) Rik Pintelon, Vrije Universiteit Brussel - dept. ELEC, 26 November 2009 0034 % All rights reserved. 0035 % Software can be used freely for non-commercial applications only. 0036 % Version 24 October 2011 0037 % 0038 0039 0040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0041 % Calculate the weighting matrix W % 0042 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0043 0044 % determine the size of the covariance matrices 0045 NumberDim = length(size(data.CY)); 0046 0047 [ny, nu, F] = size(PolyTrans.G); 0048 if NumberDim == 4 % nexp MIMO experiments 0049 0050 nexp = size(data.CY, 3); 0051 W = zeros(ny, ny, nexp, F); 0052 dummy0 = zeros(nu, nu, F); 0053 dummy1 = zeros(ny, nu, F); 0054 dummy2 = zeros(ny, ny, 1, F); 0055 for ee = 1:nexp 0056 dummy0(:,:,:) = data.CU(:,:,ee,:); 0057 dummy1(:,:,:) = data.CYU(:,:,ee,:); 0058 dummy2(:,:,1,:) = Mat_Mult(PolyTrans.G, Mat_Mult(dummy0, Conj_Trans(PolyTrans.G))) ... 0059 - 2*herm(Mat_Mult(dummy1, Conj_Trans(PolyTrans.G))); 0060 W(:,:,ee,:) = data.CY(:,:,ee,:) + dummy2; 0061 end % ee, nexp MIMO experiments 0062 W = W .* repmat(reshape(abs(PolyTrans.A.^2), [1,1,1,F]), [ny,ny,nexp,1]); 0063 0064 elseif NumberDim == 3 % one MIMO experiment 0065 0066 W = data.CY + Mat_Mult(PolyTrans.G, Mat_Mult(data.CU, Conj_Trans(PolyTrans.G))) ... 0067 - 2*herm(Mat_Mult(data.CYU, Conj_Trans(PolyTrans.G))); 0068 W = W .* repmat(reshape(abs(PolyTrans.A.^2), [1,1,F]), [ny,ny,1]); 0069 0070 end % if