EDIT:
Thanks @yoda and @morispaa. You are right, and the @morispaa solution works, that is, my processing of converted coefficients based on the assumptions about space stretched over Z and the order and "orientation" of the vectors Z gives the correct result if I update the sign of the columns of Q so that the diagonal R has positive elements.
For more information on the conversion I'm working on, see this ; Z below = sampled Zernike polynomials, known as not , orthogonal or complete in the discrete case (our case).
Intuition about why the solution proposed by @morispaa works. I would like to hear your input on this:
My intuition is that somehow the implementation of real non-negative diagonals in R gives rise to Q , which aligns βbetter with vectors in Z (which, as I said earlier, is not unitary), and therefore options 1 and 2 below, even if they represent various transformations, the output coefficients are likely to be in a similar space.
In particular, I think that Z is "almost" unitary, and perhaps this leads to a QR decomposition to return a basis close enough to Z ? Only then can I imagine that my processing of the converted coefficients, based on the assumptions about the specifications of the vectors in Z , works when the diagonal Q is completely positive, but not when it has negative entries. What do you think?
Background
I have both MATLAB R2011a and R2010b installed on my machine.
One of the changes from R2010b to R2011a affects the implementation of qr()
(see the release notes for this specific change here ).
An important part of one of my projects uses qr()
to evaluate the orthogonal basis for the forward and reverse transforms. My code applies this conversion to the input signal, processes the converted coefficients, and returns the processed signal. In other words, the changes made in R2011a to qr()
made the block that processes the coefficients of this transform stop working (the inverse transform does not return the expected inverse transform of the processed signal).
Somehow, the matrix Q , which is now returned from qr()
, differs from the old version in such a way that prevents the correct processing of the converted coefficients.
First question
In light of the above, can you tell R2011a to use qr()
from R2010b ?
Second question
I use Q and Q ' to compute the forward and reverse transforms; You can see more details here . More specifically, I use y = Q * x and x = Q '* y to calculate the direct and inverse transforms, respectively. Another way to calculate the direct transform is to use the least squares. In other words, we have two options:
Option 1: Forward and inverse using QR factorization:
% Direct: [QR] = qr(Z); y = Q' * x; % Some processing of the y coefficients % ... % Inverse: x = Q*y;
Option 2: Forward and Inverse Least Squares Conversion
% Direct: y = Z \ x; % Some processing of the y coefficients % ... % Inverse: x = Z*y;
where are our variables:
% x = Input vector % y = Direct transformation of x % Z = Matrix with sampled basis
In R2011a, option 1 above stops working (it works in R2010b ). I really like the idea of ββusing qr()
for direct and inverse transforms (this is much faster than calculating the least squares for each new vector). If I wanted to use the new qr()
for my project, does anyone know how to make my transformation again with the new Q ?