1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2025-06-17 14:57:05 +01:00

correlator transform utilities

This commit is contained in:
2020-02-02 19:43:14 +01:00
parent f014003593
commit 3e70792a06
3 changed files with 89 additions and 20 deletions

View File

@ -105,28 +105,14 @@ int main(int argc, char *argv[])
DMatSample tmp, corr;
Index nSample, nt;
tmp = Io::load<DMatSample>(corrFileName);
nSample = tmp.size();
nt = tmp[central].rows();
tmp = tmp.block(0, 0, nt, 1);
corr = tmp;
FOR_STAT_ARRAY(corr, s)
{
for (Index t = 0; t < nt; ++t)
{
corr[s]((t - shift + nt)%nt) = tmp[s](t);
}
}
corr = Io::load<DMatSample>(corrFileName);
nSample = corr.size();
nt = corr[central].rows();
corr = corr.block(0, 0, nt, 1);
corr = CorrelatorUtils::shift(corr, shift);
if (fold)
{
tmp = corr;
FOR_STAT_ARRAY(corr, s)
{
for (Index t = 0; t < nt; ++t)
{
corr[s](t) = 0.5*(tmp[s](t) + tmp[s]((nt - t) % nt));
}
}
corr = CorrelatorUtils::fold(corr);
}
// make model //////////////////////////////////////////////////////////////