mn2tn_wav_() - JaneliaSciComp/JRCLUST GitHub Wiki
Returns event waveforms from raw and filtered traces for given spike times (viTime_spk) and sites (viSite_spk). Spike duration is specified in P.spkLim_ms centered at the negative (or positive) peak. Neighboring sites are included within a fixed radius (P.maxDist_site_spk_um, r2 in the figure).

Syntax
- [tnWav_raw, tnWav_spk, viTime_spk] = mn2tn_wav_(
mnWav_raw,mnWav_spk, viSite_spk, viTime_spk, P)
Input
mnWav_raw: Raw traces (nSamples_load x nSites: int16)mnWav_spk: Filtered traces (nSamples_load x nSites: int16)- viSite_spk: Peak sites for each spiking event
- viTime_spk: Spike times at the negative peak sample in ADC time unit
- P: Parameters struct (P)
Ouptut
- tnWav_raw: Raw spike waveforms (nSamples_spk x nSites_spk x nSpikes: int16)
- tnWav_spk: Filtered spike waveforms (nSamples_spk x nSites_spk x nSpikes: int16)
- viTime_spk: Shifted spike times only if P.fRealign_spk==1. Disabled by default.
- spkwav_car_(): performs local common average reference to find the shifted spike time if P.fRealign_spk==1