Difference between revisions of "Wave basis.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(Notes)
(Sync syntax/arguments/outputs with current Spinach source)
Line 1: Line 1:
 
{{DISPLAYTITLE:wave_basis.m}} __NOTOC__
 
{{DISPLAYTITLE:wave_basis.m}} __NOTOC__
 +
 
Common basis sets for the expansion of pulse waveforms. Returns the waveform basis functions as columns of a matrix.
 
Common basis sets for the expansion of pulse waveforms. Returns the waveform basis functions as columns of a matrix.
  
 
==Syntax==
 
==Syntax==
  
    basis_waves=wave_basis(basis_type,n_functions,n_steps)
+
basis_waves=wave_basis(basis_type,n_func,n_points)
  
 
==Arguments==
 
==Arguments==
  
      basis_type    - may be set to 'sine_waves', 'cosine_waves',
+
basis_type    - may be set to 'sine_waves', 'cosine_waves',
 
                         and 'legendre'. The sine and the cosine op-
 
                         and 'legendre'. The sine and the cosine op-
 
                         tions return the corresponding functions in
 
                         tions return the corresponding functions in
Line 14: Line 15:
 
                         turns legendre polynomials in the [-1,1] in-
 
                         turns legendre polynomials in the [-1,1] in-
 
                         terval.
 
                         terval.
+
 
       n_functions    - the number of functions to return (integer
+
       n_func        - the number of functions to return (integer
 
                         frequencies starting from zero on the case
 
                         frequencies starting from zero on the case
                         of cosines, integer frequencies starting  
+
                         of cosines, integer frequencies starting
 
                         from 1 inthe case of sines, legendre poly-
 
                         from 1 inthe case of sines, legendre poly-
 
                         nomial ranks in the case of legendre func-
 
                         nomial ranks in the case of legendre func-
 
                         tion basis set.
 
                         tion basis set.
+
 
 
       n_points      - number of discretization points.
 
       n_points      - number of discretization points.
  
 
==Outputs==
 
==Outputs==
  
      basis_waves    - a matrix with the basis waves in columns
+
basis_waves    - a matrix with the basis waves in columns
 +
 
 +
Note: because the resulting waveforms are discretised, they are not pre-
 +
      cisely orthogonal under the standard scalar multiplication. An ex-
 +
      tra orthogonalisation step is therefore applied to make them ortho-
 +
      gonal as vectors. As a result, some functions may be upside-down.
 +
 
 +
ilya.kuprov@weizmann.ac.il
  
 
==Examples==
 
==Examples==
 +
 
First three Legendre polynomials, normalised to have a unit 2-norm:
 
First three Legendre polynomials, normalised to have a unit 2-norm:
  
Line 36: Line 45:
  
 
==Notes==
 
==Notes==
 +
 
Because the resulting waveforms are discretised, they are not precisely orthogonal under the standard scalar multiplication. An extra orthogonalisation step is therefore applied to make them orthogonal as vectors. As a result, some functions may be upside-down.
 
Because the resulting waveforms are discretised, they are not precisely orthogonal under the standard scalar multiplication. An extra orthogonalisation step is therefore applied to make them orthogonal as vectors. As a result, some functions may be upside-down.
  
 
==See also==
 
==See also==
 +
 
[[sawtooth.m]], [[triwave.m]], [[shaped_pulse_af.m]], [[shaped_pulse_xy.m]], [[pulse_shape.m]]
 
[[sawtooth.m]], [[triwave.m]], [[shaped_pulse_af.m]], [[shaped_pulse_xy.m]], [[pulse_shape.m]]
  
  
 
''Version 2.4, authors: [[Ilya Kuprov]]''
 
''Version 2.4, authors: [[Ilya Kuprov]]''

Revision as of 15:04, 5 April 2026


Common basis sets for the expansion of pulse waveforms. Returns the waveform basis functions as columns of a matrix.

Syntax

basis_waves=wave_basis(basis_type,n_func,n_points)

Arguments

basis_type - may be set to 'sine_waves', 'cosine_waves',

                       and 'legendre'. The sine and the cosine op-
                       tions return the corresponding functions in
                       the [-pi,pi] interval, legendre option re-
                       turns legendre polynomials in the [-1,1] in-
                       terval.
      n_func         - the number of functions to return (integer
                       frequencies starting from zero on the case
                       of cosines, integer frequencies starting
                       from 1 inthe case of sines, legendre poly-
                       nomial ranks in the case of legendre func-
                       tion basis set.
      n_points       - number of discretization points.

Outputs

basis_waves - a matrix with the basis waves in columns

Note: because the resulting waveforms are discretised, they are not pre-
      cisely orthogonal under the standard scalar multiplication. An ex-
      tra orthogonalisation step is therefore applied to make them ortho-
      gonal as vectors. As a result, some functions may be upside-down.
ilya.kuprov@weizmann.ac.il

Examples

First three Legendre polynomials, normalised to have a unit 2-norm:

    a=wave_basis('legendre',3,200); plot(a);

Legendres.png

Notes

Because the resulting waveforms are discretised, they are not precisely orthogonal under the standard scalar multiplication. An extra orthogonalisation step is therefore applied to make them orthogonal as vectors. As a result, some functions may be upside-down.

See also

sawtooth.m, triwave.m, shaped_pulse_af.m, shaped_pulse_xy.m, pulse_shape.m


Version 2.4, authors: Ilya Kuprov