Guest User

Untitled

a guest
Jul 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. function x = ttsolve(h,y)
  2. n = size(h,1);
  3. l = floor(log2(n));
  4. m = 2^l;
  5.  
  6. y1 = y(1:m);
  7. y2 = y(m+1:n);
  8.  
  9. h1 = h(1:m);
  10. h2 = h(m+1:n);
  11.  
  12. x1 = ttrecsolve(h1,y1,l);
  13.  
  14. if (m < n)
  15. A = zeros(n-m,m);
  16.  
  17. for i=1:m
  18. A(:,i) = h(m-i+2:n-i+1);
  19. end
  20.  
  21. x2 = ttsolve(h2,y2-A*x1);
  22. x = [x1;x2];
  23. else
  24. x = x1;
  25. end
  26. end
Add Comment
Please, Sign In to add comment