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 - Detailed description

Advance Signal Processing in JETDSP

M.Walters, S.Bird, D.Kinna

Contents

Introduction

Creating a new Signal

Variables available to a Signal Processing expression

The JETDSP signal that is created

Interpolation

 

Introduction

This document describes the details of how JETDSP creates a processed signal.   Some knowledge of IDL is assumed.  For a more simple view of this subject, see the Introduction.

The aim of the signal processing code is to make the JET data that the program holds available to the full range of IDL commands, and to make the results of these commands available for plotting. 

Creating a new Signal

To create a processed signal, JETDSP requires input of the following form in the 'IDL expression:' box:

    newsignal = expression

where:

  • newsignal is the desired new signal name chosen by the user. This must only contain the characters 'a'-'z','A'-'Z','0'-'9' and '_'.
  • expression is an IDL expression in terms of variables created from the data that program is holding.

JETDSP's signal processing dialog and functions will not allow multiple lines using the continuation character ($).  The maximum length of the input, including the newsignal component, is 255 characters.

The expression can be created by typing the parts of the expression into the four individual text boxes. These are then used to create the 'IDL expression'.

JETDSP:

  • makes the data available as IDL variables
  • passes this expression directly to IDL for execution
  • looks at variables which are the result of the expression and attempts to transfer them back into the internal format that JETDSP uses to hold a signal
  • gives the new signal the internal name provided, modifying this name if it conflicts with existing internal names or reserved names.

IDL Variables available to a Signal Processing expression

JETDSP searches the input for internal names of the signals that the program is holding.

For each signal present with internal name name, the program makes the following IDL variables available:

  • an array variable with the name name holding the interpolated data vector
  • an array variable with the name name_raw holding the actual data vector (if it is available for name)
  • an array variable with the name name_time holding the interpolated time vector (if it is available for name)
  • an array variable with the name name_x holding the X vector (if it is available for name)
  • an array variable with the name name_time_raw holding the actual time vector (if it is available for name)
  • an array variable with the name name_x_raw holding the actual X vector (if it is available for name)

The size of the name vector may not correspond to their size in the originating PPF or in the program as they are currently held.  This is because the expression may refer to signals on different timebases.  See Interpolation below.

The IDL Variable that the expression creates

Given the input:

    newsignal = expression

expression must be an IDL function (user or system) or operator, or combination of functions and operators, acting on the above variables to return a value that is one of the following:

  • a scalar value
  • a vector (one-dimensional array)
  • a two-dimensional array

with type byte, integer, longword, floating point or double precision.  See the IDL documentation for a description of these types.

The JETDSP Signal that is created

JETDSP examines the result of the expression (called here the 'output variable') and creates a signal for plotting based on it.

A JETDSP signal

A JETDSP signal for plotting - that is, the object that holds the data inside the program and which appears in the list of signals - has up to five components of relevance here:

  • internal name         - this is the name by which the signal will be referred once created - for example, in further signal processing expressions.
  • type - 'Single-valued', '2D' or '3D'.  This classification refers to the way the data will be represented on screen.  Single-valued signals will be plotted as text or markers.  2D signals will be plotted as a line. 3D signals will be plotted using a pseudo-3D representation - i.e., a contour plot of surface.
  • data component   - this a vector, array or scalar.  In a raw signal read from a PPF, this holds the data vector of the PPF.
  • 'time' vector component     - this a vector, array or scalar.   In a raw signal read from a PPF, this holds the time vector of the PPF.  In a 2D plot, this component is plotted on the horizontal axis against the data component on the vertical axis.  The 'time' component need not contain a time vector - it is a convention for referring to the horizontal axis of the plot.
  • X vector component - this is a vector, array or scalar.  In a raw signal read from a PPF, this holds the X vector of the PPF.  It is only used by '3D' signals.

The signal created from vector output

Given a vector (one-dimensional array) output variable, JETDSP sets the data vector of the new signal to this vector.  The signal's type is assigned as '2D' - i.e., it can be plotted using a standard plot of data against time.

The time vector of the new signal is, by default, the interpolated time vector (see Interpolation below).  JETDSP calls the vector represented on the horizontal axis the time vector - it can in fact contain any vector you create (see Specifying an explicit time vector below).

Note that you must create a genuine vector variable for JETDSP to assign it as '2D'.   Some IDL commands and operators assign a spurious extra dimension, of length 1, to their results.  An example is the taking of an array subset from a 2D array signal using signal[*,1], illustrated with the following output captured from the IDL output window:

IDL> sig = [[1,2,3],[1,2,3]]                             ; Create a 2D array

IDL> help, sig

SIG INT = Array[3, 2]

IDL> help, sig[*,1]                                         ; Take a slice in one direction

<Expression> INT = Array[3]

IDL> help, sig[1,*]                                         ; Take a slice in the other direction: note the extra dimension in the output

<Expression> INT = Array[1, 2]

In this example the result can be forced into a vector by using TRANSPOSE, which strips the argument of this redundant dimension:

IDL> help, transpose(sig[1,*])

<Expression> INT = Array[2]

Scalar output

Given a scalar output variable, JETDSP sets the data component of the new signal to this value.  The signal's type is assigned as 'Single-valued' - i.e., JETDSP will represent it as text or as a marker against one of the axes.

Two dimensional array outputs

A 2D array output variable results in the signal's type being set to '3D' - i.e., it will be plotted as a contour plot or surface.

Interpolation

When JETDSP performs signal processing, it checks to see how many existing signals are present in the IDL expression and makes them available to IDL. If there are two or more existing signals in the expression, then JETDSP will instruct IDL to perform an interpolation of the data onto a new interpolated time vector. If there is only one signal, then the time vector of that signal is taken as the time vector of the result.

The interpolated time vector is defined by the following set of parameters:

  • Start of time range for result
  • End of time range for result
  • Number of data points in time range
  • Spacing of points in that time range
  • Interpolation mathod

The default interpolated time vector is the superset of the input time vectors, within the common time range of all the input signals. The data vector of each signal is then interpolated onto the interpolated time vector using linear interpolation, and the result is made available to IDL. The expression is then evaluated. If a result is valid, then a new signal of the appropriate dimension is created and the interpolated time vector is taken as the time vector of this result. If the result is a 3D signal, then the X vector of the first signal in the expression is taken as the X vector of the result.

The signal processing dialogue provides an interface to the interpolation parameters dialogue. A brief introduction may be found here or in the Tutorial.

This dialogue allows the user to define a specific time range in which the new signal exists, to choose the number of data points in that range, and whether they should be equally spaced or not. It is also possible to choose a cubic interpolation rather than linear interpolation. Note that the defualt parameters will be used if this dialogue is left unchanged. Some of the parameters are only available under certain situations. For example, the point spacing parameter may only be changed if the number of points parameter is non-zero. It is possible to change some parameters and to use the default settings for the others.

In all cases, the interpolated time vector is constructed first, using the parameters mentioned above. The IDL interpolation routines are then used to construct data vectors which exist in the same time range and have the same number of data points as the interpolated time vector. The original data vectors are still available to JETDSP during the interpolation, and may be accessed by specifying signal1_raw. Similarly the original 'TIME' and 'X' vectors are accessible using signal1_time_raw and signal1_x_raw respectively.

For certain combinations of signals, interpolation may not be possible. An obvious example is the case where two signals do not have a common time range. If two signals of different dimensions are used, say a 1D signal and a 2D signal, then the result will be a 1D signal. In these cases merging the signals may be more appropriate.

 

Specifying an explicit time vector

The process described so far gives the new signal the interpolated time vector whether or not this is appropriate.  For example, the following takes a slice of 3D signal signal in the X-direction, but results in an unplottable new signal because the associated horizontal axis 'time' vector is the default interpolated time - in this case, the time vector of signal:

         newsignal = transpose(signal[50,*])

What we really want to construct is a 2D signal of data against the 'X' vector. To do this, concatenate a second IDL expression onto the end of the first using the standard IDL '&' operator:

            newsignal = transpose(signal[50,*]) & newsignal_time = signal_x

Or alternatively use the 'time_vector' box on the dialog.

This will result in the required output. Note that in the most general case, the number of elements in the 'time' and 'X' vectors will not be the same, so it is very important to select the correct horizontal axis to match the number of data points. Failure to do so will result in an unplottable signal. The slices described above may also be constructed using the 'Slice Signal' dialog of the view window. See the Signal Slicing documentation.

Signal versus signal

It is possible to plot one data signal against another using the '&' operator as above:

newsignal = signal1 & newsignal_time = signal2

will plot signal1 against signal2 (i.e. signal2 is treated as the 'time' axis). Note that signal1 and signal2 will be interpolated onto a common time base (based on signal1_time and signal2_time). To use the actual data use '_raw' as described above.


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