Hi,
I have another question regarding FFT. I am trying to use it as a tool for deconvolution. So if I transform the system response, s -> S, and the ouput after convolution, h -> H, I can recover the transform of the input distribution I with:
I = H / S.
So, for example, if h and s were the histograms in time space:
TH1F hTrans = new TH1F(“h in frequecy space”, “h in frequecy space”, iter, 0, iter);
hTrans = (TH1F)h->FFT(hTrans, “MAG R2C M”);
hTrans->Draw();
hTrans->SetStats(kFALSE);
Double_t H = new Double_t[2((iter)/2+1)];
TVirtualFFT *current = TVirtualFFT::GetCurrentTransform();
current->GetPoints(H);
TH1F STrans = new TH1F(“h in frequecy space”, “h in frequecy space”, iter, 0, iter);
STrans = (TH1F)s->FFT(STrans, “MAG R2C M”);
STrans->Draw();
STrans->SetStats(kFALSE);
Double_t S = new Double_t[2((iter)/2+1)];
TVirtualFFT *current = TVirtualFFT::GetCurrentTransform();
current->GetPoints(S);
But when I transform to get H and S, the imaginary parts are also included so I can not simply do :
for (int i=0; i< NoBins; i++)
I[i] = H[i] / S[i]
Infact this breaks down because some values of S[n] = 0. Do you have any ideas how this can be acheived?
Many thanks.
Ben