Guest User

Untitled

a guest
Apr 21st, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. % A transfer complex transfer function T = [a b] transforms
  2. % two complex inputs x= [X and Y] into z
  3. % Z = T*x
  4. % or
  5. % Z = [a b]*[X; Y] where a = T(1) and b=T(2)
  6. %
  7. % There is something defined in a book that is supposed to be real, but
  8. % I can't get it to be real
  9. %
  10. % Here we just make up an exmaple
  11.  
  12. clear;
  13. % Compute the bivariate residuum (wtf is a residuum)?
  14.  
  15. i = sqrt(-1);
  16.  
  17. %% Make up a complex transfer function T
  18. a = 1 + i; b = 3-4*i;
  19. T = [a b];
  20.  
  21. %% Create a random complex input - create an Mx2 complex matrix
  22. % In the notation of the paper x = [X Y]
  23.  
  24. % Create two random complex vectors X and Y
  25. X = randn(10,1)+i*rand(10,1);
  26. Y = 2*randn(10,1)-i*rand(10,1);
  27.  
  28. x=[X Y];
  29.  
  30. %% Compute Z=T*x to generate the "synthetic" output of the transfer function
  31. % given the inputs
  32. z = T*x';
  33. z = z(:);
  34.  
  35. % Now compute the coherency bivariate residuum (?)
  36. % \epsilon^2 = 1 - \psi^2 = ( T<ZX*>* + T<ZY*>* ) / <ZZ*>
  37. %
  38. % the notation is that <.> = sum(.), and * = complex conjugate
  39.  
  40. ZX = conj(sum(z.*conj(X)));
  41.  
  42. ZY = conj(sum(z.*conj(Y)));
  43.  
  44. ZZ = conj(sum(z.*conj(z)));
  45.  
  46. % according to the book, these should be real?
  47. e = 1 - (T*ZX + T*ZY)/ZZ;
  48. e1 = 1 - (T(1)*ZX + T(1)*ZY)/ZZ;
  49. e2 = 1 - (T(2)*ZX + T(2)*ZY)/ZZ;
Add Comment
Please, Sign In to add comment