|
Correlation Library
1.0
|
A class that computes the cross-correlation for two vectors of time stamps (Binary - Binary). More...
#include <CrossCorrelation-BB.h>
Public Member Functions | |
| CCrossCorrelationBB (int piCorrelationWindow, int piTrialLength, int &piIsError) | |
| Constructor. | |
| ~CCrossCorrelationBB () | |
| Destructor. | |
| void | ComputeCrossCorrelation (int *piaTimeStampsA, int piNrTimeStampsInA, int *piaTimeStampsB, int piNrTimeStampsInB, int pbNormalizeCorrelogram) |
| Compute the cross-correlation of two vectors of time stamps. | |
| void | ComputeWindowedCrossCorrelationPerTrial (int *piaTimeStampsA, int piNrTimeStampsInA, int *piaTimeStampsB, int piNrTimeStampsInB, int piFromOffsetInTrial, int piToOffsetInTrial, int pbNormalizeCorrelogram) |
| Compute the cross-correlation of two vectors of time stamps, on a partial window of the trial. ONLY ACCEPTS ONE TRIAL!!! | |
| 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 two vectors of time stamps (Binary - Binary).
Cross-correlation is computed in the classical way by counting.
| CCrossCorrelationBB::CCrossCorrelationBB | ( | 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 of your time stamps |
| piTrialLength | - The size of the trial in sampling units of the time stamps |
| 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 CCrossCorrelationBB::ComputeCrossCorrelation | ( | int * | piaTimeStampsA, |
| int | piNrTimeStampsInA, | ||
| int * | piaTimeStampsB, | ||
| int | piNrTimeStampsInB, | ||
| int | pbNormalizeCorrelogram | ||
| ) |
Compute the cross-correlation of two vectors of time stamps.
| piaTimeStampsA | - The vector holding the time stamps of the first binary variable |
| piNrTimeStampsInA | - Number of time stamps in the first vector |
| piaTimeStampsB | - The vector holding the time stamps of the second binary variable |
| piNrTimeStampsInB | - Number of time stamps in the second vector |
| pbNormalizeCorrelogram | - Set to 1 to normalize the correlogram; normalization is made by dividing the correlogram to the number of time stamps in the first buffer (rate-normalized correlogram) |
| void CCrossCorrelationBB::ComputeWindowedCrossCorrelationPerTrial | ( | int * | piaTimeStampsA, |
| int | piNrTimeStampsInA, | ||
| int * | piaTimeStampsB, | ||
| int | piNrTimeStampsInB, | ||
| int | piFromOffsetInTrial, | ||
| int | piToOffsetInTrial, | ||
| int | pbNormalizeCorrelogram | ||
| ) |
Compute the cross-correlation of two vectors of time stamps, on a partial window of the trial. ONLY ACCEPTS ONE TRIAL!!!
| piaTimeStampsA | - The vector holding the time stamps of the first binary variable |
| piNrTimeStampsInA | - Number of time stamps in the first vector |
| piaTimeStampsB | - The vector holding the time stamps of the second binary variable |
| piNrTimeStampsInB | - Number of time stamps in the second vector |
| piFromOffsetInTrial | - The start offset in the trial where the desired window starts (time stamp) |
| piToOffsetInTrial | - The end offset in the trial where the desired window stops (time stamp) |
| pbNormalizeCorrelogram | - Set to 1 to normalize the correlogram |
Get the size of the correlation window.
| float * CCrossCorrelationBB::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 CCrossCorrelationBB::ModifyAllParameters | ( | int | piNewCorrelationWindow, |
| int | piNewTrialLength | ||
| ) |
Sets all parameters at once.
| piNewCorrelationWindow | - The new correlation window |
| piNewTrialLength | - The new length of the trial |
| int CCrossCorrelationBB::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 | - The new correlation window |
| int CCrossCorrelationBB::ModifyTrialLength | ( | int | piNewTrialLength | ) |
Set the length of the trial in original sampling units.
| piNewTrialLength | - The new length of the trial |