## psth

Make plots of mean firing rate across trials as a function of time relative to a marker, e.g., stimulus onset.

## Options

The output type (on the third line of the .nda file) can be

simple- plain plot of PSTH values.simple_matlab- single column of float valueshistogram- writes a plot file with three points that form a histogram box for every data bin.power- compute the power spectrum of the PSTH using data-windowing. Uses Numerical Recipes in C "spctrm" routine, where 'ovrlap' is set to 1. The routine will use as many overlapping (by half the window length) data windows as fit into the length (in bins) of the PSTH, and will discard the rest of the PSTH.## Parameters

Examples are given below.

start- start time for binning (sampling units).period- duration of plot (sampling units).binsize- width of histogram bins, default is 20 (sampling units) for outtypehistogram, 1 forsimple. The total number of bins is determined by period/binsize.sigma- SD for Gaussian smoothing, default is 0.0 (no smoothing), inbinsizeunits.toffset- added to PSTH time axis.yscale- multiply PSTH value by this before plotting.

Variable start timevar_start_param- parameter name for variable start time valuevar_start_mult- multiply the variable start value by this numbervar_start_add- add this to variabe start value after multiplying

POWERpwr_win_size- (128) window size for power spectrum, must be a power of two. Default is 128. This will determine the number of bins in the spectrum.pwr_zero_mean- (0) set to 1 to subtract the mean from the PSTH## Example

# # Post-stimulus time histogram. # psth all simple start 0 period 2000 binsize 1 sigma 2.0## Example

# # Post-stimulus time histogram. # psth group 0 histogram start 0 period 2000 binsize 100## Example

# # Power spectrum of PSTH # psth all power binsize 5 # PSTH binsize (affects the *range* of the frequency axis) # e.g, 5ms = 200Hz, thus a 0-100 Hz frequency range # will apply to the resulting power spectrum pwr_win_size 256 # Window size (this affects *frequency* binsize # but *not* the frequency range # E.g., there will be 256 bins from 0 to cutoff, thus, your # freq. resolution (or power binsize) is 100Hz/256 = 0.39Hz pwr_zero_mean 1 # 1-Subtract mean from PSTH; 0-Do not subtract mean.## Example

psth group 1 stn simple start -500 period 16000 var_start_param stn var_start_mult 1000.0 # Convert seconds to msec var_start_add 100.0 # Account for st0 = 100ms (added after mult) binsize 1 sigma 4.0