Commit bd910cab authored by thomas.forbriger's avatar thomas.forbriger
Browse files

libpsdxx [FIX]: actually sum results for segments

parent 7a299218
......@@ -233,6 +233,11 @@ namespace psd {
retval.psd2.interval=df;
retval.cpsd.interval=df;
// set results initially to zero (because we will add each segment)
psd1=0.;
psd2=0.;
cpsd=Tcseries::Tvalue(0.);
// prepare processing containers
// padding is done by filling paddedseries through a reference subarray
Tseries paddedseries1(nsegsamples*this->Mpadfactor);
......@@ -330,7 +335,7 @@ namespace psd {
while(S.valid() && C.valid())
{
*S = C->real()*C->real()+C->imag()*C->imag();
*S += C->real()*C->real()+C->imag()*C->imag();
++S; ++C;
}
}
......@@ -342,7 +347,7 @@ namespace psd {
while(S.valid() && C.valid())
{
*S = C->real()*C->real()+C->imag()*C->imag();
*S += C->real()*C->real()+C->imag()*C->imag();
++S; ++C;
}
}
......@@ -355,7 +360,7 @@ namespace psd {
while(S.valid() && C1.valid() && C2.valid())
{
*S = *C1 * conj(*C2);
*S += *C1 * conj(*C2);
++S; ++C1; ++C2;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment