Changeset 3125 for trunk/MagicSoft/Mars/mtools
- Timestamp:
- 02/12/04 19:56:16 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mtools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtools/MFFT.cc
r3084 r3125 700 700 701 701 702 // 703 // Power Spectrum Density calculation for TArrayI 704 // 705 TArrayF* MFFT::PowerSpectrumDensity(const TArrayI *array) 706 { 707 708 fDim = array->GetSize(); 709 CheckDim(fDim); 710 711 fDataF.Set(fDim); 712 // 713 // Copy the hist into an array 714 // 715 for (Int_t i=0;i<fDim;i++) 716 fDataF[i] = (Float_t)array->At(i); 717 718 RealFTF(1); 719 720 const Int_t dim2 = fDim*fDim; 721 const Int_t dim05 = fDim/2; 722 Float_t c02; 723 Float_t ck2; 724 Float_t cn2; 725 726 TArrayF *newarray = new TArrayF(dim05); 727 728 // 729 // Fill the new histogram: 730 // 731 // 1) P(0) = 1/(N*N) |C(0)|*|C(0)| 732 // 733 c02 = (fDataF[0]*fDataF[0]); 734 // newarray->AddAt(c02/dim2,0); 735 // 736 // 2) P(k) = 1/(N*N) (|C(k)|*|C(k)|)) 737 // 738 for (Int_t k=1;k<dim05-1;k++) 739 { 740 const Int_t k2 = k+k; 741 ck2 = (fDataF[k2]*fDataF[k2] + fDataF[k2+1]*fDataF[k2+1]); 742 newarray->AddAt(ck2/dim2,k); 743 } 744 // 745 // 3) P(N) = 1/(N*N) (|C(n/2)|*|C(n/2)|) 746 // 747 cn2 = (fDataF[1]*fDataF[1]); 748 // newarray->AddAt(cn2,dim05-1); 749 750 return newarray; 751 } 752 753 702 754 TArrayD* MFFT::PowerSpectrumDensity(const TArrayD *array) 703 755 { -
trunk/MagicSoft/Mars/mtools/MFFT.h
r3084 r3125 74 74 TH1D* PowerSpectrumDensity(const TH1D *hist); 75 75 76 TArrayF* PowerSpectrumDensity(const TArrayI *array); 76 77 TArrayF* PowerSpectrumDensity(const TArrayF *array); 77 78 TArrayD* PowerSpectrumDensity(const TArrayD *array);
Note:
See TracChangeset
for help on using the changeset viewer.