User:Sintel/CTE tuning: Difference between revisions
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
== Definition == | == Definition == | ||
Given a temperament [[mapping]] | 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{ | & \underset{g}{\text{minimize}} && \left\| g\mathrm{MW} - j\mathrm{W} \right\|^2 \\ | ||
& \text{subject to} && g\mathrm{ | & \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 | 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{ | \begin{align} | ||
\mathrm{ | \mathrm{A} &= (\mathrm{MW})^{\mathsf T} | ||
\mathrm{( | &b &= (j\mathrm{W})^{\mathsf T} \\ | ||
\end{ | \mathrm{C} &= (\mathrm{MV})^{\mathsf T} | ||
&d &= (j\mathrm{V})^{\mathsf T} \\ | |||
\end{align} | |||
</math> | |||
The problem then becomes: | |||
\begin{ | <math> | ||
g | \begin{align} | ||
& \underset{g}{\text{minimize}} && \left\| \mathrm{A}g^{\mathsf T} - b \right\|^2 \\ | |||
\ | & \text{subject to} && \mathrm{C}g^{\mathsf T} = d \\ | ||
\end{align} | |||
\ | |||
\mathrm{ | |||
\mathrm{ | |||
\end{ | |||
</math> | </math> | ||
The solution can be found by solving the dual problem: | |||
<math> | <math> | ||
\begin{bmatrix} | \begin{bmatrix} | ||
\mathrm{A}^{\mathsf T}\mathrm{A} & \mathrm{C}^{\mathsf T} \\ | |||
\end{bmatrix} | \mathrm{C} & 0 | ||
\end{bmatrix} | |||
\begin{bmatrix} | \begin{bmatrix} | ||
g^{\mathsf T} \\ | |||
\lambda^{\mathsf T} | |||
\end{bmatrix} | \end{bmatrix} | ||
= | = | ||
\begin{bmatrix} | \begin{bmatrix} | ||
\mathrm{A}^{\mathsf T} b\\ | |||
d | |||
\end{bmatrix} | \end{bmatrix} | ||
</math> | </math> | ||
The problem is feasible if | The problem is feasible if rank (V) ≤ rank (M). | ||
== Computation == | == Computation == |