Table of Contents
normerp_manual - Normerp Tutorial and Manual (ERP manuals)
Tutorial Introduction and Reference Manual
Jonathan C. Hansen
Event-Related Potential Laboratory
University of California, San Diego
3. Command Line Options
4. Normalization Parameters
4.2. Cal Pulse Size
5. Interactive Use
5.1. Entering Commands and Arguments
5.2. (S)caling the Plot
5.3. (N)umber of Points to Average
5.4. (Q)uit Immediately
5.5. (?) Help
5.6. (O)K to Normalize
Normerp is a program used to "normalize" averaged ERP
data in the ERPSS
format. Normalization standardizes
ERPSS data files so that numerical
values represent definite voltages, since the gain of recording apparatus
can vary with experimental setups as well as between channels. This
is performed by measuring the size of a known calibration
for each channel, and then scaling each data channel, given
data resolution. Normalization also establishes
the polarity of the data,
inverting it if necessary so that positive values
represent positive voltages.
Averaged data from averaging programs requires
normalization prior to
plotting, measurement, and other forms of data
manipulation. By convention,
one records calibration pulses of a known size
simultaneously on all channels
of a recording configuration, and averages these
pulses together in bin
0 of an averaged data file.
Note that differences in gains between channels can arise at the
an analog instrumentation recorder (if employed),
or any other intermediate
signal processing step. Hence, it is always necessary to record
pulses and process them in exactly the same way
as the ERPs themselves.
If all the processing steps are
linear operations and the calibration
pulses of reasonable size,
normerp will properly normalize all channels
to the same gain
and fix the resolution of the stored digital data.
One generally employs normerp with a display device so that the
pulses can be viewed and cursors placed on the waveform
measure the size of the pulses.
If desired, one can
average a number of
points around the cursors to achieve higher accuracy
if the pulses are
The latencies for the low and high cursors is requested from the
standard input; these are demarcated on the display of the data
The size of the calibration pulses, the
polarity of the data (positive
or negative "up"), and the desired
resolution of the output data (as a
number of "points" per microvolt)
are then requested.
An interactive session
then begins wherein one can alter various
parameters relating to the normalization
process and the display of
the data. When satisfied that the parameters
One can also invoke normerp in a non-display, non-interactive, "silent"
mode, if desired,
where the required parameters are supplied on the command
should only be done if one is certain
that the parameters are
appropriate for the
data at hand.
normerp is invoked thusly:
normerp disp_dev in_data_file out_data_file [opts]
disp_dev is the graphics device on which one wishes
to view the
calibration pulses (e.g. mvc, mx).
in_data_file is the un-normalized ERPSS
data file containing the input
data to normerp, and
the name of the data file in which
the normalized output data will be
placed. If one wants a synopsis of the
invocation and implemented options
for normerp, just type normerp
and a usage message will be printed.
Even though it is possible to renormalize previously normalized
normerp employs separate input and output data files.
This maneuver is
designed to allow one to backtrack if
valuable averaged data is accidentally
supplying invalid or incorrect parameters to normerp.
in_data_file is not altered by normerp, and can thus be
reused as input
to normerp, if necessary.
Once one has verified that the data are
normalized and intact, it is relatively safe to remove the
data file; doing so conserves disk space.
Options for normerp are selected by supplying additional arguments on
invocation line that begin with "-". An option may have none, one, or
arguments of its own. In the case of normerp, each option has a specified
number of arguments as described below. Since there is no easy way to detect
omitted option arguments if more than one option is requested, be sure
the invocation line is correct. Many of the options duplicate functions
that can be invoked once the interactive session begins.
They are available
on the invocation line both
so that one can, for example, view the
with a better display magnification or select the channels to be
at the outset, as well as so that data can be measured
with certain other options in effect.
Here are the options that are currently implemented:
The -a option causes normerp to average lobeavgpts on
both sides of the
cursors and the cursor itself to calculate the data
values. This can reduce
the error if noisy calibration pulses have been
recorded. Since the argument
is a count for a single side, the total
number of points averaged will
be 2 * lobeavgpts + 1. This
parameter can also be changed in interactive
One can select a magnification for the data display by supplying an integer
scaleplot with this option. This factor is multiplied by the data, and
the result divided by 100 when the data are displayed on the disp_dev.
Since the display of data involves certain arbitrary translations and
scalings in any case, and changes in the plotted data do not affect the
normalization or measurements, one should select a plotting scale
that facilitates accurate placement of the cursors and an easily
display. The actual scaling factor is (thus) scaleplot / 100.
The use of
an integer in place of an actual floating point magnification
drawing calculations. The plotting scale factor
can also the altered with
an interactive mode command.
One can normalize one data file using the unnormalized calibration
from another file, caldatafile.
This is useful in a number of situations,
as when the calibration pulses had to be recorded post-hoc or failed
to be recorded, and one wishes to employ pulses recorded in another file.
Although bin 0, by convention, contains the calibration pulses in an
unnormalized ERPSS data file, the enforcement of this convention is
and it may be useful on occasion to have more than one bin
calibration data. This -c options allows one to
specify the bin which contains
the appropriate calibration data.
This bin, calbin, refers to the input
data file, unless the
-f option is in effect, in which case the specified
bin in the
calibration data file is used.
-n lo_cursor hi_cursor cal_size polarity resolution
This option prevents normerp from entering an interactive session,
the display device is not opened (and hence does not need to be valid).
The information needed to perform the normalization is taken from the five
arguments for this option, and consist of the latencies for the low and
cursors (lo_cursor and hi_cursor),
the size of the calibration
pulses (cal_size) as an integer,
the polarity of the data (polarity) as
either a + or -,
and the desired resolution of the output file (resolution)
as an integer
number of points per microvolt.
These parameters are the
same as would be supplied during
interactive acquisition, and hence the
same considerations apply.
While normerp will complain if the parameters
are out of range,
inaccuracy during the data normalization will occur
if the parameters are
not appropriate for the data at hand. Thus, care
should be used when
the -n is employed.
Four basic parameters control the normalization of data by normerp.
are the size of the calibration pulses in the recorded data (this
differs form channel to channel), the
actual size, in microvolts,
the calibration pulses when the data were recorded, the
polarity of the
data, and the desired resolution for the data in the output
file, in points
per 10 microvolts. The size of the calibration pulses
in the recorded data
is derived separately for each channel
by measuring the data values at
hence normerp requires that five parameters be set before
normalization can occur, whether it be by interactive adjustment of
while viewing the data, or by way of the -n invocation
In either case, given the normalization parameters,
the absolute values
of the difference between the data measured at the
cursors is used, along
with the specified polarity, desired resolution,
and size of the calibration
pulses, to determine the scaling constant
for each channel. Normerp then
multiplies the data for each channel
by the corresponding normalization
constant. This is repeated for each
bin in the input data file, and the
in the output data file. The verpos element of the bin header
is set to 1 or
-1 depending on the specified the proper polarity to indicate
that the data
to indicate that the data are normalized.
Tips and suggestions on how to specify the normalization parameters are
contained in the detailed descriptions below.
It should be stressed at this point that the actual size of the calibration
pulses delivered to the recording system and the manner in which the
device was connected in comparison to the manner in which
was connected are critical pieces of information that cannot
solely from viewing the data. Careful written records
or notes about the
recording from each subject are recommended.
In addition to these parameters,
the recording settings (e.g. filter
settings, etc) and a list of abnormal
events that occurred can be very
helpful down the line, and can often
save considerable grief later.
Since the amplification accuracy of the data ultimately relies on the
size of the calibration pulses as they are measured in the unnormalized
data file, one should be careful when setting the low and high measurement
cursors. The goal is to accurately assess the size of the pulse in all
channels simultaneously. One should ensure that the cursors do not lie
on a portion of the waveform that contains overshoot or noise. Since
high-pass filtering will cause square pulses to decay towards the
usually one will attempt to get as close as possible to the
of the pulse with the low cursor while still measuring the
value, and also attempting to stay as close to the
leading edge of the
pulse with the high cursor
but after it has attained its active value.
In some cases it may be
advantageous to measure the falling edge of the
if, for instance, the leading edges have excessive
contamination, or overshoot that is not present on
the falling edge.
Small random variations in the data values from point
to point can be
mitigated by averaging a number of points in the vicinity
of the cursors
together to obtain the data values. This can be accomplished
-a invocation option, or selected interactively.
This parameter is straightforward, but its accuracy is crucial to the
normalization process. One supplies the size of the calibration pulse
to the recording apparatus when the pulses were recorded.
This value must
be an integer, and since one is the smallest integer,
of this requirement may be necessary if the calibration
supply arbitrary voltages.
The question of the polarity of the recorded data can be confusing, but
need not be. A simple rule will allow an accurate determination of the
polarity of the data, regardless of whether interposed devices invert
the data or not before digitization, or how the various connectors
labeled on the polygraph.
If the active lead of the amplifier (e.g. vertex)
connected to the positive side of the calibration source, then
the pulses are displayed going upward on the plot, positive is up,
a 1; else negative is up, type a -1;
else if the active lead of the polygraph
amplifier was connected
to the negative side of the calibration source,
if the pulses are displayed going upward, negative is up,
a -1; else positive is up, type a 1.
This rule always works for referential
recordings and, indeed, no other
type of recording need be made, as the
ERP software allows computation
of arbitrary derivations from "referential"
However, if a number of "bipolar" data channels are included
in the data,
one should take care that they are recorded in a manner that
them to be properly normalized with normerp.
The resolution with which the data in the output file will be stored
is set by this parameter. It is a tradeoff between the range of voltages
that can be represented in a signed 16 bit integer (-32767 to 32767),
the precision of the smallest difference in data values that can be
Many of the ERP programs employ a default value of 100 points
allowing a data range of -327.67 to 327.67 microvolts.
This is on the safe
side in terms of probability of a data overflow,
since even single trials
will almost never be this large for scalp-recorded
data, and implies a
precision of .01
microvolts. A value of 500 gives .002 microvolt precision,
allows a range of -65.5 to 65.5 microvolts, generally plenty for
ERPs. Nonetheless, the resolution should be chosen according to
type of data and experiment. In any case, it is not too important as
long as information is not degraded, as all ERP programs consider the
data resolution for each file separately when the data are processed,
adjusting the values internally if necessary.
In interactive use, the following sequence of steps is performed by
after invocation. First, the input data file is opened,
the output data
file created, and
a description of the data is printed on the standard
If the -f option is in effect,
the calibration data file is opened
and checked to ensure that it has the
same number of channels as the input
data file. Next, the display
device is opened and the data are plotted,
along with a time base and
descriptions of the channels. Note that if a
different file is being
used for the calibration pulse data, the descriptions
will refer to those
data, not the input data file, although the descriptions
form the input data file will be transferred to the output
At this point, normerp requests
the required parameters. The data
are then re-drawn with the cursor
locations (along with any possible averaging
of neighboring points)
shown with short vertical lines, to enable easy
identification of the
data that would be used to determine the size of
the cal pulse.
An interactive mode is then entered, where normerp accepts
commands from the standard input that alter various
parameters. When accepting
commands, one does not need to type
a return; however, when arguments
or parameters are being gathered
for a command, a return is needed. When
one is satisfied that the
parameters are correct, indicate that it’s OK
to normalize the data.
The plot device is then closed, and the input data
normalized and placed in the output data file. The total number
is then printed to indicate that normalization is complete.
In interactive mode, the five required parameters are requested from the
standard input; these take values as described above in the
Normalization Parameters. The interactive session
then begins, and one
selects various functions using single letters
without carriage returns.
The five required parameters can, of course, be
commands can be invoked to perform
certain optional functions or set optional
When a command
requires an argument, normerp prints a brief
prompt and waits
for input which must be terminated with a carraige return.
If the argument
is out of range, either in an absolute sense or in relation
current parameters, normerp repeats the request. Whenever a
that affects the display of the data is changed, the plot
is re-drawn. In
any case where a parameter is changed, normerp
prints a summary of the
current values of the parameters on the standard
output. If an unimplemented
command is typed, a brief synopsis of the
implemented commands is printed
on the standard output.
Here follows a detailed description of the optional
and their functions.
The size with which the unnormalized data are plotted on the display device
can be changed interactively by using the s command. The argument
same as described above under Command Line Options. The value
chosen to maximize the utility of the plot on the display
The parameter, again, is the same as described
above under Command Line
Options. Remember that this parameter is the
number of points on each side
of the cursors, and hence the total number
of points being averaged is
twice this value plus one, centered on each cursor.
One should take care
that all the points being averaged together are
propitiously located on
the calibration pulses.
This command immediately exits from normerp, removing the output file.
By typing a question mark, a breif description of the purpose of
and the various parameters is printed on the standard output.
When one is certain that all the parameters have appropriate values,
invoke this command. Normerp will ask "Are you sure?", and,
if one is sure,
type Y, yes, or anything beginning with a y. Any
other characters cause
normerp to revert to the interactive session.
There are hundreds of primitive operations that can generate errors
the operation of normerp, and a detailed description of each
is not worthwhile,
as most are self-explanatory. In all cases each
nested routine prints the
proximal cause of the error, thus given
substantial diagnostic information.
most errors are fatal, and cause the removal of the output
data file. In addition, during execution, most signals are caught and
cause pre-mature termination with the removal of the output data
Three common problems should be discussed. First, to prevent inadvertent
destruction of a data file, normerp will not create a data file
exists. The solution to this is to remove it, if it is no longer
or to use another name for the output data file. The second
can crop up is a data overflow. This can be solved by reducing the
output resolution. Third, if the measured sizes of the calibration
is too small, normerp will complain. This is best corrected by
the gain of the amplification system during the recording
Except for parameters being out of range,
other errors generally indicate
something is seriously wrong.
Table of Contents