cartesian2polar.m

From Spinach Documentation Wiki
Revision as of 10:59, 18 September 2026 by Kuprov (talk | contribs) (sync with Spinach main 3975f139: row vector requirement for second derivatives)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Converts the [RF_x, RF_y] representation of a pulse waveform and the derivatives of any function with respect to those RF values into the [RF_amplitude, RF_phase] representation and the derivatives of the function with respect to amplitudes and phases.

Syntax

    [r,p,Dr,Dp,Drr,Drp,Dpr,Dpp]=...
                      cartesian2polar(x,y,Dx,Dy,Dxx,Dxy,Dyx,Dyy)

Parameters

   x    - vector of waveform amplitudes along X

   y    - vector of waveform amplitudes along Y

   Dx   - optional vector of derivatives of a scalar function
          with respect to the waveform amplitudes along X

   Dy   - optional vector of derivatives of a scalar function
          with respect to the waveform amplitudes along Y

   Dxx  - optional matrix of second derivatives of a scalar function
          with respect to the waveform amplitudes along X

   Dxy  - optional matrix of second derivatives of a scalar function
          with respect to the waveform amplitudes along X and Y

   Dyx  - optional matrix of second derivatives of a scalar function
          with respect to the waveform amplitudes along Y and X

   Dyy  - optional matrix of second derivatives of a scalar function
          with respect to the waveform amplitudes along Y

Outputs

   r    - vector of waveform amplitudes

   p    - vector of waveform phases

   Dr   - vector of derivatives of the function with respect
          to the waveform amplitudes.

   Dp   - vector of derivatives of the function with respect
          to the waveform phases.

   Drr  - matrix of second derivatives of the function with respect
          to the waveform amplitudes.

   Drp  - matrix of second derivatives of the function with respect
          to the waveform amplitudes and phases.

   Dpr  - matrix of second derivatives of the function with respect
          to the waveform phases and amplitudes.

   Dpp  - matrix of second derivatives of the function with respect
          to the waveform phases.

Notes

When second derivatives are requested, x, y, Dx, and Dy must be row vectors.

See also

polar2cartesian.m, shaped_pulse_xy.m, shaped_pulse_af.m, bruker_write.m, chirp_pulse.m, grad_pulse.m, grad_sandw.m, pmlg5.m, pulse_shape.m, read_wave.m, restrans.m, rseq_compiler.m, rsequence.m, sawtooth.m, sech_pulse.m, spinal.m, triwave.m, vg_pulse.m, wave_basis.m, Kernel_functions

Version 2.4, authors: David Goodwin, Ilya Kuprov