Files
openairinterface5g/targets/PROJECTS/TDDREC/f_tls_svd.m
T
jiangx 20d52e1953 ICC 2015 version
git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5910 818b1a75-f10b-46b9-bf7c-635c3b92a50f
2014-10-20 10:26:02 +00:00

50 lines
1.4 KiB
Matlab
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
%
% PURPOSE : TLS solution for AX = B based on SVD
%
% ARGUMENTS :
%
% A : observation of A
% B : observation of B
%
% OUTPUTS :
%
% X : TLS solution for X
%
%**********************************************************************************************
% EURECOM - All rights reserved
%
% AUTHOR : Xiwen JIANG, Florian Kaltenberger
%
% DEVELOPMENT HISTORY :
%
% Date Name(s) Version Description
% ----------- ------------- ------- ------------------------------------------------------
% Apr-30-2014 X. JIANG 0.1 creation of code
%
% REFERENCES/NOTES/COMMENTS :
%
% - I. Markovsky and S. V. Huffel, “Overview of total least-squares methods,” Signal Processing, vol. 87, pp.
% 2283–2302, 2007
%
%**********************************************************************************************
function [X_est A_est B_est]= f_tls_svd(A,B)
C = [A B];
n = size(A,2);
d = size(B,2);
[U S V] = svd(C,0);
V12 = V(1:n,n+1:end);
V22 = V(n+1:end,n+1:end);
S1 = S(1:n,1:n);
Z12 = zeros(n,d);
Z22 = zeros(d);
Z21 = zeros(d,n);
X_est = - V12/V22;
C_est = U*[S1 Z12;Z21 Z22]*V';
A_est = C_est(:,1:n);
B_est = C_est(:,n+1:end);
% delta_C = -U*diag([zeros(n,1);diag(S(n+1:end,n+1:end))])*V';
% delta_C = [A_est-A B_est-B]; %same as the previous calculation
% err = norm(delta_C,'fro')^2/norm(C,'fro')^2;:w
end