non_orth.m

From Spinach Documentation Wiki
Revision as of 10:12, 30 August 2026 by Kuprov (talk | contribs) (version fragment to 2.13 per IK 2026-08-30)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Non-orthogonal channel distortion model. Treats odd rows of multi-row waveform arrays as in-phase channels, and even rows as out-of-phase channels. The in-phase channel is kept fixed; the out-of-phase channel is tilted so that its true angle to the in-phase channel is user-specified.

For control channel pair number n, occupying rows 2n-1 and 2n of the waveform array, the distorted rows are obtained as x_new=x+cos(a)*y and y_new=sin(a)*y, where a is the angle specified for that pair. An angle of 90 degrees therefore leaves the waveform unchanged. A scalar angle specification is expanded to all channel pairs. When a second output is requested, the per-channel mixing matrix is assembled as a sparse matrix holding 1, cos(a) and sin(a) at the (x,x), (x,y) and (y,y) positions of each pair, and the Jacobian with respect to the column-wise vectorisations of the input and the output arrays is the Kronecker product of a unit matrix of the size of the time grid with that mixing matrix. The Jacobian is not built when only one output is requested.

Syntax

    [w,J]=non_orth(w,xy_ang)

Parameters

    w        - waveform, one time slice per column, and
               rows arranged as XYXY... with respect to
               in-phase and quadrature parts on each
               control channel

    xy_ang   - true angle, in degrees, between the instru-
               ment output directions of each X,Y control
               pair; may be a scalar or one value per pair,
               with 90 degrees corresponding to no distortion

Outputs

    w        - distorted waveform, same dimension as the
               input waveform

    J        - Jacobian matrix with respect to vectorisa-
               tions of the output and the input arrays

Notes

The waveform must have an even number of rows, and the angles must be strictly between 0 and 180 degrees; the transformation becomes singular at both ends of that interval, where sin(a) vanishes and the two output directions become collinear.

See also

no_dist.m, amp_root.m, amp_tanh.m, spf.m, szf.m, restrans.m, transfermat.m, Optimal control module

Version 2.13, authors: Ilya Kuprov