Skip to content

AFNI and NIfTI Server for NIMH/NIH/PHS/DHHS/USA/Earth

Sections
Personal tools
You are here: Home » AFNI » Documentation » FAQs » What functions are used in program waver?

What functions are used in program waver?

Document Actions
Up to table of contents

Q17. What functions are used in program waver?
There is no documentation or publication describing the "Cox" (or -WAV default) waveform generated by program waver. The formula for the impulse response function is as follows:
for t in (-infinity .. delaytime)
  waver = 0

for t in (delaytime .. delaytime+risetime)
  waver = peak * z( (t-delaytime)/risetime )

for t in (delaytime+risetime .. delaytime+risetime+falltime)
  waver = (1+undershoot) * peak * z( (delaytime+risetime+falltime-t) / falltime ) - undershoot

for t in (delaytime+risetime+falltime .. delaytime+risetime+falltime+restoretime)
  waver = -undershoot * peak * z( (delaytime+risetime+falltime+restoretime-t) / restoretime )


for t in (delaytime+risetime+falltime+restoretime .. infinity)
  waver = 0
This is pretty straightforward, allowing the user to control the time breakpoints of the function: delay part, rise part, fall part (including a post-undershoot), and a restoration part (from the undershoot).

The function z(x) above is a function that rises smoothly from z=0 for x<0 to z=1 for x>1. In waver.c, this function is programmed as

for x in (-infinity .. 0 )
  z = 0

for x in ( 0 .. 1 )
  z = 0.50212657 * ( tanh(tan(0.5*PI * (1.6*x-0.8))) + 0.99576486 )

for x in ( 1 .. infinity )
  z = 1
The peculiar looking formula for the meaty part of z(x) was chosen partly by trial and error graphing, and partly because I think that the combination tanh(tan()) is a cool function. It looks OK, and there really isn't enough data to distinguish between different types of curves that make this 0->1 transition used to model the rise and fall of the BOLD response. The graph below shows z(x) for x between -0.5 and 1.5.

[Graph]

The -GAM gamma variate waveform option is derived from Mark Cohen's work (NeuroImage 6:93-103, 1997). Here is a comparison plot:

[Graph]

The -WAV and -GAM data for this graph were produced with the commands

  waver -dt 0.25 -xyout -inline 1 20@0 -undershoot 0 -delay 1 -rise 4 -fall 5
  waver -dt 0.25 -xyout -inline 1 20@0 -GAM
The actual graph was produced with program xmgr, available here.

If you use the gamma variate waveform t**b * exp(-t/c), note that the time-to-peak is b*c and the FWHM of the peak is approximately 2.4 * sqrt(b) * c (the approximation is valid for b > 1). Mark Cohen's values are b = 8.6 and c = 0.547, giving time-to-peak = 4.7 s and FWHM = 3.8 s.

This FAQ applies to: Any version.

Created by Robert Cox
Last modified 2005-07-31 10:30
 

Powered by Plone

This site conforms to the following standards: