|
Correlation Library
1.0
|
A class that computes the cross-correlation for a vector of time stamps and a continuous signal (Binary - Continuous). More...
#include <CrossCorrelation-BC.h>
Public Member Functions | |
| CCrossCorrelationBC (int piCorrelationWindow, int piTrialLength, int &piIsError) | |
| Constructor. | |
| ~CCrossCorrelationBC () | |
| Destructor. | |
| void | ComputeCrossCorrelation (int *piaTimeStampsA, int piNrTimeStampsInA, float *pfaSamplesB, int piNrSamplesInB, int pbNormalizeCorrelogram) |
| Compute the cross-correlation of one binary signal with one continuos signal. | |
| float * | GetCrossCorrelogram () |
| Returns the buffer with the computed cross-correlogram; returns NULL if there was an error; please check the buffer for NULL before using it!! | |
| int | ModifyCorrelationWindow (int piNewCorrelationWindow) |
| Set the size of the correlation window; the parameter specifies the correlation window; for example for a window of -100..+100 pass 100 as a parameter;. | |
| int | ModifyTrialLength (int piNewTrialLength) |
| Set the length of the trial in original sampling units. | |
| int | ModifyAllParameters (int piNewCorrelationWindow, int piNewTrialLength) |
| Sets all parameters at once. | |
| int | GetCorrelationWindow () |
| Get the size of the correlation window. | |
| int | GetTrialLength () |
| Get the trial length in original sampling units. | |
A class that computes the cross-correlation for a vector of time stamps and a continuous signal (Binary - Continuous).
Cross-correlation is computed in the classical way.
For pairs of spikes and LFP signals in neuroscience, this measure is also known as "spike-triggered LFP average".
Timestamps corresponding to events of one binary signal and one continuous signal must be provided. The time stamps of the binary signal must match the samples of the continuous signal, i.e. the first sample of the continuous signal corresponds to time stamp 0.
| CCrossCorrelationBC::CCrossCorrelationBC | ( | int | piCorrelationWindow, |
| int | piTrialLength, | ||
| int & | piIsError | ||
| ) |
Constructor.
| piCorrelationWindow | - The size of the cross-correlation window (eg. 80 for a cross-correlation with lags of -80..+80); use the same units as the sampling units |
| piTrialLength | - The size of the trial in original sampling units |
| piIsError | - A return parameter, set to 0 on success. It is set to -1 by the constructor if there is a mismatch of window sizes and the GetCrossCorrelogram() function will return NULL; |
Destructor.
| void CCrossCorrelationBC::ComputeCrossCorrelation | ( | int * | piaTimeStampsA, |
| int | piNrTimeStampsInA, | ||
| float * | pfaSamplesB, | ||
| int | piNrSamplesInB, | ||
| int | pbNormalizeCorrelogram | ||
| ) |
Compute the cross-correlation of one binary signal with one continuos signal.
| piaTimeStampsA | - The vector holding the time stamps of the binary variable |
| piNrTimeStampsInA | - Number of time stamps in the first vector |
| pfaSamplesB | - The vector holding samples of the continuous signal |
| piNrSamplesInB | - Number of samples in the second vector |
| pbNormalizeCorrelogram | - Set to 1 to normalize the correlogram; ; normalization is made by dividing to the number of time stamps used to compute the correlogram |
Get the size of the correlation window.
| float * CCrossCorrelationBC::GetCrossCorrelogram | ( | ) |
Returns the buffer with the computed cross-correlogram; returns NULL if there was an error; please check the buffer for NULL before using it!!
The size of the cross correlogram buffer is (2*iCorrelationWindow+1), and element with lag 0 is at position iCorrelationWindow.
Get the trial length in original sampling units.
| int CCrossCorrelationBC::ModifyAllParameters | ( | int | piNewCorrelationWindow, |
| int | piNewTrialLength | ||
| ) |
Sets all parameters at once.
| piNewCorrelationWindow | - The new correlation window |
| piNewTrialLength | - The new length of the trial |
| int CCrossCorrelationBC::ModifyCorrelationWindow | ( | int | piNewCorrelationWindow | ) |
Set the size of the correlation window; the parameter specifies the correlation window; for example for a window of -100..+100 pass 100 as a parameter;.
| piNewCorrelationWindow | - Specifies the new correlation window |
| int CCrossCorrelationBC::ModifyTrialLength | ( | int | piNewTrialLength | ) |
Set the length of the trial in original sampling units.
| piNewTrialLength | - The new length of the trial |