Copyright © 1995-2010 MZA Associates Corporation

WaveTrain Examples Library

This document describes examples of WaveTrain systems and run sets which are delivered with WaveTrain.  The purpose of the examples is to provide working systems which involve application of WaveTrain concepts and to give users a start on building more complex systems.  The example systems are distributed with standard WaveTrain installations, and may be found in the subdirectory "wavetrain\examples\" of the WaveTrain installation directory.  (Disclaimer:  it should not be assumed that the examples provided here are fully valid for any particular user application).

The following list gives very brief descriptions of some of the systems provided in "\wavetrain \examples\".

WtDemo.tsd  (in wavetrain\examples\wtdemo\)

WtDemo is the system which is built in the WaveTrain User Guide tutorial chapter, as well as in the WaveTrain Workshop tutorial.  Users can access this system to compare to the system they built while going through the tutorials themselves.  Caution: the parameter settings and runsets in "example\WtDemo.tsd" may differ from the tutorials.

This is a good starter system for point source imaging.

GtoS.tsd  (in wavetrain\examples\GtoS\)

GtoS sets up a ground-based telescope which perfoms compensated imaging of a space-based point source.

BLAT01.tsd  (in wavetrain\examples\BLAT01\)

BLAT (Baseline Adaptive Optics and Tracking) is a model intended to give WaveTrain users a start in implementing their own closed-loop adaptive optics (AO) systems.  BLAT is flexible enough so that users can implement a variety of scenarios by modifying just the runset, as opposed to the block diagram itself. 


Directory MliDemo\ contains three different models, each meant to demonstrate various features of the Matlab interface.  demoa.tsd is a standard point source propagation similar to wtdemo.tsd.  demob.tsd uses m-systems to display data in Matlab in real time.  democ.tsd is configured as a mex-system and as a Simulink t-function (see tdemo.m and democ.mdl).

The following examples provide further illustrations of running a WaveTrain system from Matlab as a "mex-system":

PSTrack.tsd  (in wavetrain\examples\PSTrack\)

PSTrack is a point source tracking and beam projection system which is set up to be implemented as a closed-loop mex-system within Matlab.

PSAOTrack.tsd   (in wavetrain\examples\PSAOTrack\)

PSAOTrack is a point source compensated tracking and adaptive optics system set up to be manipulated as a closed-loop mex-system within Matlab.

Miscellaneous special-purpose examples:


Using two of the phase unwrapping techniques described in:

"Two-Dimensional Phase Unwrapping: Theory, Algorithms, and Software", by Dennis C. Ghiglia and Mark D. Pritt, Wiley-Interscience, New York, ISBN:0-471-24935-1.

this set of examples demonstrates the following features within WaveTrain:

  1. Implementation of m-systems which call mex-files.
  2. Use of m-systems to manipulate phase information of WaveTrain.
  3. Implementation of a mex-system which calls m-systems.
  4. Two-dimensional phase-unwrapping implemented as mex-files within Matlab.

The directory is set up in a series of five steps. If you are not interested in the mechanics, but you want to use the phase unwrapping techniques right away skip steps 1-4 and go right to 5. Although the steps are incremental, they do not directly depend on one another.

Here are the basic instructions:

  1. Buy the book by Ghiglia above. Their software is only available for people who own the book.
  2. Download the software. The book indicates where you can get it.
  3. Compile the software, storing the object code in a .lib file.
  4. Edit the file in this same directory called ghiglia-config.bat. Change the values of the environment variables specified.
  5. Open a command line window.
  6. cd to this same directory.
  7. Execute 'setupwt'.
  8. Now you can look at the contents of each step_n directory. Look at the democ system using the tve. When you attempt to load it you will have to specify the location of your wtlib. For each step:

Here is a decription of each step:

It turns out that the mask-cut algorithm seems to work better here. The Goldstein seems to have some artifacts. However, both would probably be better if a better mask were given.

You can modify the parameters (and the block diagram for that matter) to do different cases of interest. Once you've figured out how this works, we suggest that you copy the contents of the step_5 directory to a working directory in order to perform mods.