Difference between revisions of "Amp tanh.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(Restore pre-bulk-edit wiki content)
(Normalise sequential blank lines)
Line 33: Line 33:
 
==See also==
 
==See also==
 
[[Optimal_control_module#Optimal_control_function_list:_distortions_and_penalties|Optimal_control_function_list:_distortions_and_penalties]]
 
[[Optimal_control_module#Optimal_control_function_list:_distortions_and_penalties|Optimal_control_function_list:_distortions_and_penalties]]
−
 
  
 
''Version 2.11, authors: [[Uluk Rasulov]], [[Ilya Kuprov]]''
 
''Version 2.11, authors: [[Uluk Rasulov]], [[Ilya Kuprov]]''

Revision as of 12:23, 25 April 2026

Amplifier compression distortion model. Applies a saturating hyperbolic tangent distortion to the user-supplied waveform:

   y=a*tanh(x/a)

Treats odd channels of multi-channel waveform as X and even ones as Y components; the autodiff Jacobian is returned for the vectorisation of the input array.

Syntax

   [w,J]=amp_tanh(w,sat_lvls)

Arguments

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

   sat_lvls  - saturation levels beyond which the amplifier 
               cannot go, one value per X,Y pair in w, giving
               the maximum output sqrt(X^2+Y^2)

Outputs

   w         - distorted waveform in the same units and 
               layout as the input

   J         - distortion Jacobian matrix with respect 
               to the vectorisation of the input, sparse

See also

Optimal_control_function_list:_distortions_and_penalties

Version 2.11, authors: Uluk Rasulov, Ilya Kuprov