User:Sintel/CTE tuning: Difference between revisions

Sintel (talk | contribs)
No edit summary
Sintel (talk | contribs)
No edit summary
Line 4: Line 4:


== Definition ==
== Definition ==
Given a temperament [[mapping]] A, the CTE tuning is equivalent to the following optimization problem:  
Given a temperament [[mapping]] M, the CTE tuning is equivalent to the following optimization problem:  


<math>
<math>
\begin{align}
\begin{align}
& \underset{g}{\text{minimize}}  && \left\|  g\mathrm{AW} - j\mathrm{W}  \right\|^2  \\
& \underset{g}{\text{minimize}}  && \left\|  g\mathrm{MW} - j\mathrm{W}  \right\|^2  \\
& \text{subject to} &&  g\mathrm{AB}  = j\mathrm{B} \\
& \text{subject to} &&  g\mathrm{MV}  = j\mathrm{V} \\
\end{align}
\end{align}
</math>
</math>


where ''g'' is the (unknown) generator list, W the diagonal Tenney-Euclidean weighting matrix, ''j'' is the [[JIP]], and B is a matrix obtained by stacking the monzos that we want to be pure. This problem can be solved using the method of lagrange multipliers:
where ''g'' is the (unknown) generator list, W the diagonal Tenney-Euclidean weighting matrix, ''j'' is the [[JIP]], and V is a matrix obtained by stacking the monzos that we want to be pure. Since this is a convex problem, it can be solved using the method of lagrange multipliers. Let's first simplify:


<math>
<math>
\begin{bmatrix}
\begin{align}
\mathrm{AW^2A}^{\mathsf T} & \mathrm{AB} \\
\mathrm{A} &= (\mathrm{MW})^{\mathsf T}  
\mathrm{(AB)}^{\mathsf T} & 0
&b &= (j\mathrm{W})^{\mathsf T} \\
\end{bmatrix}
\mathrm{C} &= (\mathrm{MV})^{\mathsf T}
&d &= (j\mathrm{V})^{\mathsf T} \\
\end{align}
</math>
 
The problem then becomes:


\begin{bmatrix}
<math>
g^{\mathsf T} \\
\begin{align}
\lambda^{\mathsf T}
& \underset{g}{\text{minimize}}   && \left\\mathrm{A}g^{\mathsf T} - b  \right\|^2  \\
\end{bmatrix}
& \text{subject to} &&  \mathrm{C}g^{\mathsf T} = d \\
=
\end{align}
\begin{bmatrix}
\mathrm{AW}^2j^{\mathsf T} \\
\mathrm{B}^{\mathsf T}j^{\mathsf T}
\end{bmatrix}
</math>
</math>


or equivalently:
The solution can be found by solving the dual problem:


<math>
<math>
\begin{bmatrix}
\begin{bmatrix}
g & \lambda
\mathrm{A}^{\mathsf T}\mathrm{A} & \mathrm{C}^{\mathsf T} \\
\end{bmatrix}  
\mathrm{C} & 0
\end{bmatrix}


\begin{bmatrix}
\begin{bmatrix}
\mathrm{A}^{\mathsf T}\mathrm{W^2A} & \mathrm{(AB)}^{\mathsf T} \\
g^{\mathsf T} \\
\mathrm{AB} & 0
\lambda^{\mathsf T}
\end{bmatrix}
\end{bmatrix}
=
=
\begin{bmatrix}
\begin{bmatrix}
j\mathrm{W}^2 \mathrm{A}^{\mathsf T} &
\mathrm{A}^{\mathsf T} b\\
j\mathrm{B}
d
\end{bmatrix}
\end{bmatrix}
</math>
</math>


The problem is feasible if
The problem is feasible if rank (V) ≤ rank (M).
# rank (B) ≤ rank (A), and
# A has full rank.


== Computation ==
== Computation ==