spkwav_car_() - JaneliaSciComp/JRCLUST GitHub Wiki
Subtract local CAR from the spike waveform to reduce background spiking activities. Local CAR (common average referencing) signal is computed by averaging the far half of the sites (within the green circle) from the peak site (s1 in the figure). Note that spiking event is extracted for sites within P.maxDist_site_spk_um (r2 in the figure).

Syntax
[trWav2, mrWav_ref] = spkwav_car_(trWav2, P, nSites_spk, viSite2_spk)
Input
- trWav2: Filtered spike waveforms (nSamples_spk x nSites_spk x nSpikes: int16)
- P: Parameters struct (P)
- nSites_spk: Number of sites to extract spikes (optional, default: [])
- viSite2_spk: List of sites to use to compute local CAR (optional, default: [])
Output
- trWav2: LCAR-subtracted spike waveforms ((nSamples_spk x nSites_spk x nSpikes: int16))
- mrWav_ref: LCAR waveforms (nSamples_spk x nSpikes: int16)
Operations
- Perform the operation only if P.vcSpkRef == 'nmean' (nearest mean). Do not subtract LCAR otherwise.
- Compute LCAR by averaging far half of the sites from the peak site for each spiking event.