Jetdsp
JETDSP Homepage
Manual Homepage
Signal Processing Homepage
 
Signal processing
Basic guide
Advanced guide
IBM NEWDSP-syntax
Use your code
Signal slicing
Simple expressions
 
Tutorial
Introduction
Internals
IDL commands
Interpolation
Writing your own code
Adding functions to the Simple dialogue
 
How to...
Read data
Define structure
 
Functions
jetSmooth
jetint
jetsubset
jetmerge
fixgrid
jetwindowpoints
 
Signal Processing in JETDSP

Basic Signal Processing in JETDSP

This is an introduction to creating processed signals in Jetdsp.  A more comprehensive guide is given here.

The signal processing dialogs

The signal processing features of JETDSP are accessed via the Signal Processing menu of both the main JETDSP window and the View/Print window. The 'Create processed signal' option launches the Signal Processing dialog, which may look like this:

sigproc.gif (3768 bytes)

Along the top are three buttons which specify what type of processing expression you want to use, Simple expressions allows shortcuts to commonly used IDL expressions whilst IBM expression allows the use of expressions from IBM-JETDSP. At the bottom is row of boxes to enter the unit labels for the new signal

IDL expression

To create a new signal:

  1. Enter the internal name you want it to have (the program may change this if you choose a reserved name such as 'NE' or the name of an existing signal.) Names are case insensitive and should only contain the characters 'a'-'z','A'-'Z','0'-'9' and '_'.
  2. Enter an IDL expression for its data vector
  3. (OPTIONAL) Enter an expression for its Horizontal axis vector (Time)
  4. (OPTIONAL) Enter an expression for its Horizontal axis vector (X)
  5. Click the 'Create signal' button

The data vector for the new signal may be an IDL expression using zero or more existing signals.

For example, suppose that the plasma currents for 2 shots have been created in JETDSP through the read signal dialogue as IPLA and IPLA1. Using these, create a processed signal DIFF by entering 'DIFF' in the new internal name field and IPLA-IPLA1 in the Data vector field . 

The program will fill in the IDL command field automatically with:

DIFF = IPLA - IPLA1

Clicking on 'Create signal' creates the signal and adds it to the main JETDSP table, from where it may be plotted.

You could achieve the same result by typing DIFF = IPLA - IPLA1 directly into the IDL command field yourself.

Note that the Data vector field does not need to include an existing signal.  For example, the following generates a sine wave.

Data vector: SIN(FINDGEN(200))

Other possible IDL commands are the SMOOTH command. For example:

Data vector: SMOOTH(IPLA,5)

will create a smoothed version of the IPLA signal.

IDL commands

IDL has many useful commands that JETDSP supports. Simple examples are :

  • NEWSIGNAL = SIGNAL1 + SIGNAL2. The operators +, -, /, and * are all supported
  • NEWSIGNAL = SIGNAL1 ## SIGNAL2 will perform matrix multiplication (row of SIGNAL1 multiplied by column of SIGNAL2) and # will return column of SIGNAL1 multiplied by row of SIGNAL2
  • NEWSIGNAL = SIGNAL1^2 will produce the square of SIGNAL1
  • NEWSIGNAL = EXP(SIGNAL1) will return the natural exponential of SIGNAL1. The functions EXP, ALOG, 10^ and ALOG10 are all available
  • NEWSIGNAL = SIN(SIGNAL1) . The trigonometric functions SIN, COS, TAN, ASIN, ACOS, ATAN, SINH, COSH and TANH are all supported
  • NEWSIGNAL = SMOOTH(SIGNAL1, 5) will return a smoothed version of SIGNAL1. The value 5 indicates the width of the boxcar average used for the smoothing.
  • NEWSIGNAL = ABS(SIGNAL1) will return the absolute value of SIGNAL1. The functions MAX, MIN, MEAN, MEDIAN, TOTAL, TRACE and MOD are also supported
  • NEWSIGNAL = DERIV(SIGNAL_TIME,SIGNAL) will return the derivative of the signal with respect to its time vector
  • NEWSIGNAL = FFT(SIGNAL1, -1) will take the Fourier transform of SIGNAL1. NEWSIGNAL2 = FFT(NEWSIGNAL, 1) will take the inverse transform

This list is by no means exhaustive. More details are given in the IDL manual. Combinations of these commands may also be used, e.g. NEWSIGNAL = EXP(SIGNAL1 + SIGNAL2) . IDL is not case sensitive, so EXP and exp are both valid commands. The use of parentheses to indicate the command is recommended; e.g. NEWSIGNAL = (SIGNAL1 + SIGNAL2)/SIGNAL2 is clear but NEWSIGNAL = SIGNAL1 + SIGNAL2 / SIGNAL2 is not.

It is also possible to create simple signals directly through the signal processing dialogue. The command

NEWSIGNAL = 2.1

creates floating point signal, of value 2.1. The command

NEWSIGNAL = FINDGEN(200)

will produce a floating point vector of 200 elements, with each element set equal to its index in the vector. Since IDL uses C indexing, NEWSIGNAL(0) will have the value 0 and NEWSIGNAL(199) will have the value 199: NEWSIGNAL(200) is undefined. This FINDGEN function can be useful for producing other simple functions, e.g. NEWSIGNAL = SIN(FINDGEN(200)) will produce a sine wave. FINDGEN and the related functions DINDGEN (for double precision), LINDGEN (for long integers) and BINDGEN (for short integers) are available in the form FINDGEN(x) or FINDGEN(x,y) resulting in 2D and 3D signal respectively.

Note that whilst it is possible to reference a single element of a vector or an array, such as NEWSIGNAL2 = NEWSIGNAL[23] , it is not possible at present to access ranges of an array without using the jetSubset function.

Simple Expressions

By selecting the 'Simple Expression' button in the top line of the window the simple expression dialog is displayed:

sigproc2.gif

This dialog allow quick entry of commonly used expressions. User expressions can be added to this dialog by following the steps described here.

The processing options are split into 4 types, shown in the upper droplist.

  1. Unary
  2. Functions which require only one signal.
  3. Binary
  4. Functions which require two signals.
  5. f(t)
  6. Functions which require 2D signals only.
  7. f(t,x)
  8. Functions which require 3D signals only.
For each type of processing there is a list of available functions. These are shown in the lower droplist and in the adjacent box the IDL expression is shown. This could contain both signals and parameters. The correct number of boxes/lists is automatically displayed on selecting the operation. Once the required values have been set then the processed signal can be created.

To subtract one signal from another as before;

  1. Enter the new name 'diff'
  2. Select 'Binary' from the top droplist
  3. Select '-' from the bottom
  4. Select 'IPLA' and 'IPLA1' from the two signal boxes.
  5. Clicking on 'Create Signal'

sigproc3.gif

Signal Slicing (Profiles)

A profile of a signal can be created using signal slicing, see here.

Further details of possible IDL commands are given in the IDL manual. The processed signal dialogue supports all common commands in IDL5.2.

Interpolation

In the case of 2 or more existing signals being processed, then a decision has to be made about the positioning of the data points. If the data points coincide in time (which is usually the x-axis for JET signals), then the time points which are used are the existing ones. If the time points do not coincide, then the default is to take a linear interpolation onto the superset of the time points of the 2 (or more) signals. If a signal does not exist in a certain range, then no interpolation will be possible in that range.

By clicking on the 'Interpolation...' button, the user may use the Interpolation dialogue to define their own time points, by specifying a range and the number of data points. If the start and end of the specified range are equal, then the superset of the time points of the signals is used. The spacing of the data points can also be set (NB: only equal point spacing available as of 28/05/1999). The user may also use cubic interpolation rather than linear interpolation.


Top  JETDSP Home Page  Manual  FAQ 
Please send comments to: data-and-coding-support@ccfe.ac.uk