├── 2009-01-25I ├── 2009-01-25@01-38-41.000800.cfg ├── 2009-01-25@01-38-41.000800.dat ├── 2009-01-25@01-38-41.000800.inf ├── 2009-01-25@01-38-41.000800.rpt ├── 2009-01-25@01-38-41.000800.txt ├── 2009-01-25@01-38-41.000800.xml ├── 2009年01月25日01时38分41秒.CON ├── 2009年01月25日01时38分41秒.ZYD ├── 2009年01月25日01时38分41秒.cfg ├── 2009年01月25日01时38分41秒.dat ├── 2009年01月25日01时38分41秒.inf ├── 2009年01月25日01时38分41秒.mod ├── 2009年01月25日01时38分41秒.rpt ├── 2009年01月25日01时38分41秒.sti ├── 2009年01月25日01时38分41秒.txt ├── 2009年01月25日01时38分41秒.xml ├── aaa.zef ├── asy.zef └── 南乐_乐平变.mod ├── AChannel.cpp ├── AChannel.h ├── AView.cpp ├── AView.cpp.bak ├── AView.h ├── AView.h.bak ├── Boundry.cpp ├── Boundry.h ├── ChildFrm.cpp ├── ChildFrm.h ├── ComTime.cpp ├── ComTime.h ├── Comtrade.cpp ├── Comtrade.cpp.bak ├── Comtrade.h ├── Comtrade.h.bak ├── Cross.cur ├── Cross1.cur ├── DView.cpp ├── DView.h ├── Debug └── FA2013.log ├── DlgBdChild.cpp ├── DlgBdChild.h ├── DlgBoundry.cpp ├── DlgBoundry.h ├── DlgBusDiff.cpp ├── DlgBusDiff.h ├── DlgBusDiffData.cpp ├── DlgBusDiffData.h ├── DlgForm.cpp ├── DlgForm.h ├── DlgHarmo.cpp ├── DlgHarmo.h ├── DlgImp.cpp ├── DlgImp.h ├── DlgImpChanSel.cpp ├── DlgImpChanSel.h ├── DlgPhase.cpp ├── DlgPhase.h ├── DlgPower.cpp ├── DlgPower.h ├── DlgSeqComp.cpp ├── DlgSeqComp.h ├── DlgVName.cpp ├── DlgVName.h ├── DrawCube.cpp ├── FA2013.APS ├── FA2013.cpp ├── FA2013.h ├── FA2013.idc ├── FA2013.rc ├── FA2013.reg ├── FA2013.vcxproj ├── FA2013.vcxproj.filters ├── FA2013.vcxproj.user ├── FA2013Doc.cpp ├── FA2013Doc.cpp.bak ├── FA2013Doc.h ├── FA2013Doc.h.bak ├── ImpView.cpp ├── ImpView.h ├── MainFrm.cpp ├── MainFrm.h ├── POINTER.cur ├── ReadMe.txt ├── Release ├── FA2013.Build.CppClean.log └── FA2013.log ├── Test Data ├── 2009-01-25@01-38-41.000800.cfg ├── 2009-01-25@01-38-41.000800.dat ├── 2009-01-25@01-38-41.000800.inf ├── 2009-01-25@01-38-41.000800.rpt ├── 2009-01-25@01-38-41.000800.txt ├── 2009-01-25@01-38-41.000800.xml ├── 2009年01月25日01时38分41秒.CON ├── 2009年01月25日01时38分41秒.ZYD ├── 2009年01月25日01时38分41秒.cfg ├── 2009年01月25日01时38分41秒.dat ├── 2009年01月25日01时38分41秒.inf ├── 2009年01月25日01时38分41秒.mod ├── 2009年01月25日01时38分41秒.rpt ├── 2009年01月25日01时38分41秒.sti ├── 2009年01月25日01时38分41秒.txt ├── 2009年01月25日01时38分41秒.xml ├── aaa.zef ├── asy.zef └── 南乐_乐平变.mod ├── ThreadFunc.h ├── UserImages.bmp ├── calc.cpp ├── calc.h ├── drawcube.h ├── fftpf.h ├── res ├── FA2013.ico ├── FA2013.rc2 ├── FA2013Doc.ico ├── Thumbs.db ├── Toolbar.bmp ├── Toolbar256.bmp ├── bitmap1.bmp └── cursor1.cur ├── resource.h ├── resource.h.bak ├── splab_vector.h ├── stdafx.cpp ├── stdafx.h ├── targetver.h └── uniclass.h /2009-01-25I/2009-01-25@01-38-41.000800.cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/2009-01-25@01-38-41.000800.cfg -------------------------------------------------------------------------------- /2009-01-25I/2009-01-25@01-38-41.000800.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/2009-01-25@01-38-41.000800.dat -------------------------------------------------------------------------------- /2009-01-25I/2009-01-25@01-38-41.000800.inf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/2009-01-25@01-38-41.000800.inf -------------------------------------------------------------------------------- /2009-01-25I/2009-01-25@01-38-41.000800.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/2009-01-25@01-38-41.000800.rpt -------------------------------------------------------------------------------- /2009-01-25I/2009-01-25@01-38-41.000800.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/2009-01-25@01-38-41.000800.txt -------------------------------------------------------------------------------- /2009-01-25I/2009-01-25@01-38-41.000800.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/2009-01-25@01-38-41.000800.xml -------------------------------------------------------------------------------- /2009-01-25I/2009年01月25日01时38分41秒.CON: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/2009年01月25日01时38分41秒.CON -------------------------------------------------------------------------------- /2009-01-25I/2009年01月25日01时38分41秒.ZYD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/2009年01月25日01时38分41秒.ZYD -------------------------------------------------------------------------------- /2009-01-25I/2009年01月25日01时38分41秒.cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/2009年01月25日01时38分41秒.cfg -------------------------------------------------------------------------------- /2009-01-25I/2009年01月25日01时38分41秒.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/2009年01月25日01时38分41秒.dat -------------------------------------------------------------------------------- /2009-01-25I/2009年01月25日01时38分41秒.inf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/2009年01月25日01时38分41秒.inf -------------------------------------------------------------------------------- /2009-01-25I/2009年01月25日01时38分41秒.mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/2009年01月25日01时38分41秒.mod -------------------------------------------------------------------------------- /2009-01-25I/2009年01月25日01时38分41秒.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/2009年01月25日01时38分41秒.rpt -------------------------------------------------------------------------------- /2009-01-25I/2009年01月25日01时38分41秒.sti: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/2009年01月25日01时38分41秒.sti -------------------------------------------------------------------------------- /2009-01-25I/2009年01月25日01时38分41秒.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/2009年01月25日01时38分41秒.txt -------------------------------------------------------------------------------- /2009-01-25I/2009年01月25日01时38分41秒.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/2009年01月25日01时38分41秒.xml -------------------------------------------------------------------------------- /2009-01-25I/aaa.zef: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/aaa.zef -------------------------------------------------------------------------------- /2009-01-25I/asy.zef: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/asy.zef -------------------------------------------------------------------------------- /2009-01-25I/南乐_乐平变.mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/2009-01-25I/南乐_乐平变.mod -------------------------------------------------------------------------------- /AChannel.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/AChannel.cpp -------------------------------------------------------------------------------- /AChannel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/AChannel.h -------------------------------------------------------------------------------- /AView.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/AView.cpp -------------------------------------------------------------------------------- /AView.cpp.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/AView.cpp.bak -------------------------------------------------------------------------------- /AView.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/AView.h -------------------------------------------------------------------------------- /AView.h.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/AView.h.bak -------------------------------------------------------------------------------- /Boundry.cpp: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | #include "FA2013.h" 3 | #include "Boundry.h" 4 | #include 5 | #include "splab_vector.h" 6 | 7 | using splab::PI; 8 | 9 | CBoundry::CBoundry(void) 10 | : Rset1(0) 11 | , Rset2(0) 12 | , Xset1(0) 13 | , Xset2(0) 14 | , Alpha(0) 15 | , Beta(0) 16 | , Theta(0) 17 | , Name(_T("")) 18 | , Type(_T("")) 19 | , defaultZPS(0.5) 20 | , ZPS(0.5) 21 | , isVisible(0) 22 | , Color(0x00cdcdcd) 23 | { 24 | } 25 | 26 | 27 | CBoundry::~CBoundry(void) 28 | { 29 | } 30 | 31 | 32 | int CBoundry::drawBd(CDC* pDC, const CPoint& mid, const CRect& rect) 33 | { 34 | CPen BdPen; 35 | BdPen.CreatePen(PS_SOLID,1,Color); 36 | CPen* pOld = pDC->SelectObject(&BdPen); 37 | switch(Type[0]) 38 | { 39 | case _T('P'): 40 | { 41 | drawPoly(pDC, mid); 42 | break; 43 | } 44 | case _T('L'): 45 | { 46 | drawLine(pDC, mid, rect); 47 | break; 48 | } 49 | case _T('C'): 50 | { 51 | drawCircle(pDC, mid); 52 | break; 53 | } 54 | case _T('R'): 55 | { 56 | drawRect(pDC, mid); 57 | break; 58 | } 59 | } 60 | pDC->SelectObject(pOld); 61 | BdPen.DeleteObject(); 62 | return 0; 63 | } 64 | 65 | 66 | int CBoundry::drawPoly(CDC* pDC, const CPoint& mid) 67 | { 68 | CPoint A,B,C,D,O; 69 | O = mid; 70 | int x = mid.x; 71 | int y = mid.y; 72 | double xa,ya,xb,yb,xc,yc,xd,yd; 73 | double tA = Alpha/180*PI; 74 | double tT = Theta/180*PI; 75 | xa = Xset1/(Beta-1/tan(tA)); 76 | ya = -xa*(1/tan(tA)); 77 | xb = (Xset1+Rset1*tan(tT))/(tan(tT)+Beta); 78 | yb = (xb-Rset1)*tan(tT); 79 | xc = Rset1; 80 | yc = 0; 81 | xd = Rset1; 82 | yd = -Rset1*tan(tA); 83 | 84 | A.x = (int)(x + xa/ZPS); 85 | A.y = (int)(y - ya/ZPS); 86 | B.x = (int)(x + xb/ZPS); 87 | B.y = (int)(y - yb/ZPS); 88 | C.x = (int)(x + xc/ZPS); 89 | C.y = (int)(y - yc/ZPS); 90 | D.x = (int)(x + xd/ZPS); 91 | D.y = (int)(y - yd/ZPS); 92 | 93 | pDC->MoveTo(O); 94 | pDC->LineTo(A); 95 | pDC->MoveTo(A); 96 | pDC->LineTo(B); 97 | pDC->MoveTo(B); 98 | pDC->LineTo(C); 99 | pDC->MoveTo(C); 100 | pDC->LineTo(D); 101 | pDC->MoveTo(D); 102 | pDC->LineTo(O); 103 | 104 | return 0; 105 | } 106 | 107 | 108 | int CBoundry::drawLine(CDC* pDC, const CPoint& mid, const CRect& rect) 109 | { 110 | CPoint A,B; 111 | double tB = Beta/180*PI; 112 | A.x = 0; 113 | A.y = (int)(mid.y-Xset1+(mid.x+Rset1) * tan(tB)); 114 | B.x = rect.Width(); 115 | B.y = mid.y-Xset1-(rect.Width()-mid.x-Rset1) * tan(tB); 116 | pDC->MoveTo(A); 117 | pDC->LineTo(B); 118 | return 0; 119 | } 120 | 121 | 122 | int CBoundry::drawCircle(CDC* pDC, const CPoint& mid) 123 | { 124 | CRect Rect; 125 | CPoint s,e; 126 | double R = (1+Alpha)*sqrt(pow(Rset1,2)+pow(Xset1,2))/2/ZPS; 127 | Rect.left = (int)((1-Alpha)*Rset1/ZPS/2+mid.x-R); 128 | Rect.right = (int)((1-Alpha)*Rset1/ZPS/2+mid.x+R); 129 | Rect.top = (int)(-(1-Alpha)*Xset1/ZPS/2+mid.y-R); 130 | Rect.bottom = (int)(-(1-Alpha)*Xset1/ZPS/2+mid.y+R); 131 | s = Rect.TopLeft(); 132 | e = s; 133 | pDC->Arc(Rect,s,e); 134 | return 0; 135 | } 136 | 137 | 138 | int CBoundry::drawRect(CDC* pDC, const CPoint& mid) 139 | { 140 | CPoint A,B,C,D; 141 | A.x = mid.x+(int)(Rset2/ZPS); 142 | A.y = mid.y-(int)(Xset1/ZPS); 143 | B.x = mid.x+(int)(Rset1/ZPS); 144 | B.y = mid.y-(int)(Xset1/ZPS); 145 | C.x = mid.x+(int)(Rset1/ZPS); 146 | C.y = mid.y-(int)(Xset2/ZPS); 147 | D.x = mid.x+(int)(Rset2/ZPS); 148 | D.y = mid.y-(int)(Xset2/ZPS); 149 | pDC->MoveTo(D); 150 | pDC->LineTo(A); 151 | pDC->MoveTo(A); 152 | pDC->LineTo(B); 153 | pDC->MoveTo(B); 154 | pDC->LineTo(C); 155 | pDC->MoveTo(C); 156 | pDC->LineTo(D); 157 | return 0; 158 | } 159 | -------------------------------------------------------------------------------- /Boundry.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Boundry.h -------------------------------------------------------------------------------- /ChildFrm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/ChildFrm.cpp -------------------------------------------------------------------------------- /ChildFrm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/ChildFrm.h -------------------------------------------------------------------------------- /ComTime.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/ComTime.cpp -------------------------------------------------------------------------------- /ComTime.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | class CComTime 3 | { 4 | public: 5 | CComTime(void); 6 | ~CComTime(void); 7 | friend CComTime operator+(const CComTime& time1, const int& offset); 8 | CComTime(CString Time1); 9 | CString PrintTimeWithDate(void); 10 | CString PrintTime(void); 11 | protected: 12 | int yyyy; 13 | int mm; 14 | int dd; 15 | int h; 16 | int min; 17 | int s; 18 | int us; 19 | }; 20 | 21 | -------------------------------------------------------------------------------- /Comtrade.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Comtrade.cpp -------------------------------------------------------------------------------- /Comtrade.cpp.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Comtrade.cpp.bak -------------------------------------------------------------------------------- /Comtrade.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Comtrade.h -------------------------------------------------------------------------------- /Comtrade.h.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Comtrade.h.bak -------------------------------------------------------------------------------- /Cross.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Cross.cur -------------------------------------------------------------------------------- /Cross1.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Cross1.cur -------------------------------------------------------------------------------- /DView.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DView.cpp -------------------------------------------------------------------------------- /DView.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DView.h -------------------------------------------------------------------------------- /Debug/FA2013.log: -------------------------------------------------------------------------------- 1 | 生成启动时间为 2013/6/9 9:34:47。 2 | 3 | 生成成功。 4 | 5 | 已用时间 00:00:00.01 6 | -------------------------------------------------------------------------------- /DlgBdChild.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgBdChild.cpp -------------------------------------------------------------------------------- /DlgBdChild.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgBdChild.h -------------------------------------------------------------------------------- /DlgBoundry.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgBoundry.cpp -------------------------------------------------------------------------------- /DlgBoundry.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgBoundry.h -------------------------------------------------------------------------------- /DlgBusDiff.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgBusDiff.cpp -------------------------------------------------------------------------------- /DlgBusDiff.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgBusDiff.h -------------------------------------------------------------------------------- /DlgBusDiffData.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgBusDiffData.cpp -------------------------------------------------------------------------------- /DlgBusDiffData.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgBusDiffData.h -------------------------------------------------------------------------------- /DlgForm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgForm.cpp -------------------------------------------------------------------------------- /DlgForm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgForm.h -------------------------------------------------------------------------------- /DlgHarmo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgHarmo.cpp -------------------------------------------------------------------------------- /DlgHarmo.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgHarmo.h -------------------------------------------------------------------------------- /DlgImp.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgImp.cpp -------------------------------------------------------------------------------- /DlgImp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgImp.h -------------------------------------------------------------------------------- /DlgImpChanSel.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgImpChanSel.cpp -------------------------------------------------------------------------------- /DlgImpChanSel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgImpChanSel.h -------------------------------------------------------------------------------- /DlgPhase.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgPhase.cpp -------------------------------------------------------------------------------- /DlgPhase.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgPhase.h -------------------------------------------------------------------------------- /DlgPower.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgPower.cpp -------------------------------------------------------------------------------- /DlgPower.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgPower.h -------------------------------------------------------------------------------- /DlgSeqComp.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgSeqComp.cpp -------------------------------------------------------------------------------- /DlgSeqComp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgSeqComp.h -------------------------------------------------------------------------------- /DlgVName.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgVName.cpp -------------------------------------------------------------------------------- /DlgVName.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/DlgVName.h -------------------------------------------------------------------------------- /DrawCube.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "drawcube.h" 3 | 4 | 5 | #define COLOR_WHITE RGB(255,255,255) 6 | #define COLOR_BLACK RGB(0,0,0) 7 | #define NCOLORSHADES 128 // this many shades in gradient 8 | 9 | static void PaintRect(CDC* pDC, int x, int y, int w, int h, COLORREF color) 10 | { 11 | CBrush brush(color); 12 | CBrush* pOldBrush = pDC->SelectObject(&brush); 13 | pDC->PatBlt(x, y, w, h, PATCOPY); 14 | pDC->SelectObject(pOldBrush); 15 | brush.DeleteObject(); 16 | } 17 | 18 | void PaintGradiantRect(CDC *pDC, const RECT &rect,COLORREF clrFrom, COLORREF clrTo =RGB(255,255,255), 19 | BOOL hori = true, BOOL ascend = true) 20 | { 21 | int cxCap = rect.right - rect.left; 22 | int cyCap = rect.bottom - rect.top; 23 | 24 | // Get the intensity values for the ending color 25 | int r1 = GetRValue(clrTo); // red 26 | int g1 = GetGValue(clrTo); // green 27 | int b1 = GetBValue(clrTo); // blue 28 | 29 | // Get the intensity values for the begining color 30 | int r2 = GetRValue(clrFrom); // red 31 | int g2 = GetGValue(clrFrom); // green 32 | int b2 = GetBValue(clrFrom); // blue 33 | 34 | int r, g, b; 35 | 36 | if(hori) //paint horizontal rect; 37 | { 38 | int x = cxCap; 39 | int w = x; // width of area to shade 40 | int xDelta= max(w/NCOLORSHADES,1); // width of one shade band 41 | 42 | 43 | while (x >= xDelta) { 44 | x -= xDelta; 45 | if (r1 > r2) 46 | r = r1 - (r1-r2)*(w-x)/w; 47 | else 48 | r = r1 + (r2-r1)*(w-x)/w; 49 | 50 | if (g1 > g2) 51 | g = g1 - (g1-g2)*(w-x)/w; 52 | else 53 | g = g1 + (g2-g1)*(w-x)/w; 54 | 55 | if (b1 > b2) 56 | b = b1 - (b1-b2)*(w-x)/w; 57 | else 58 | b = b1 + (b2-b1)*(w-x)/w; 59 | 60 | if(ascend) // Paint from left to right; 61 | PaintRect(pDC, rect.left+x, rect.top, xDelta, cyCap, RGB(r, g, b)); 62 | else // Paint from right to left; 63 | PaintRect(pDC, rect.right-x-xDelta, rect.top, xDelta, cyCap, RGB(r, g, b)); 64 | } 65 | } 66 | else //paint vertical rect; 67 | { 68 | int y = cyCap; 69 | int w = y; // height of area to shade 70 | int yDelta= max(w/NCOLORSHADES,1); // height of one shade band 71 | 72 | 73 | //while (y >= yDelta) { 74 | while (y > 0) { 75 | y -= yDelta; 76 | if (r1 > r2) 77 | r = r1 - (r1-r2)*(w-y)/w; 78 | else 79 | r = r1 + (r2-r1)*(w-y)/w; 80 | 81 | if (g1 > g2) 82 | g = g1 - (g1-g2)*(w-y)/w; 83 | else 84 | g = g1 + (g2-g1)*(w-y)/w; 85 | 86 | if (b1 > b2) 87 | b = b1 - (b1-b2)*(w-y)/w; 88 | else 89 | b = b1 + (b2-b1)*(w-y)/w; 90 | 91 | if(ascend) // Paint from top to bottom; 92 | PaintRect(pDC, rect.left, rect.top+y, cxCap, yDelta, RGB(r, g, b)); 93 | else // Paint from bottom to top; 94 | PaintRect(pDC, rect.left, rect.bottom-y-yDelta, cxCap, yDelta, RGB(r, g, b)); 95 | } 96 | } 97 | 98 | } 99 | 100 | void DrawColorCube(CDC* pDC, CRect& rect, COLORREF colorFrom, COLORREF colorTo /*= RGB(255,255,255)*/, 101 | BOOL IsHori /*= true*/) 102 | { 103 | CRect newRect; 104 | COLORREF color; 105 | CPen* oldPen; 106 | //CBrush* oldBr; 107 | 108 | /* 109 | * If value as 0, draw a line here; 110 | */ 111 | if(rect.Width()<=0 ) 112 | rect.right = rect.left +2; 113 | else if(rect.Height() <=0) 114 | rect.top-=2; 115 | 116 | BOOL backHori = IsHori; 117 | IsHori = true; 118 | 119 | /* 120 | * draw first 1/3 part; 121 | */ 122 | if(IsHori) 123 | { 124 | newRect.SetRect(rect.left,rect.top,(rect.right - rect.left)/3+rect.left,rect.bottom); 125 | PaintGradiantRect(pDC,newRect,colorFrom, colorTo); 126 | } 127 | else 128 | { 129 | newRect.SetRect(rect.left,rect.bottom - (rect.bottom-rect.top)/3,rect.right,rect.bottom); 130 | PaintGradiantRect(pDC,newRect,colorFrom, colorTo, IsHori, false); 131 | } 132 | 133 | /* 134 | * then left 2/3 part; 135 | */ 136 | if(IsHori) 137 | { 138 | newRect.SetRect((rect.right - rect.left)/3+rect.left,rect.top,rect.right,rect.bottom); 139 | PaintGradiantRect(pDC,newRect,colorFrom, colorTo, IsHori, false); 140 | } 141 | else 142 | { 143 | newRect.SetRect(rect.left,rect.top, rect.right, rect.bottom - (rect.bottom-rect.top)/3); 144 | PaintGradiantRect(pDC,newRect,colorFrom, colorTo, IsHori, true); 145 | } 146 | 147 | // /* 148 | // * Frame the rect with colorFrom, with look better; 149 | // */ 150 | // CPen pen(PS_SOLID,1,colorFrom); 151 | // oldPen = (CPen*)pDC->SelectObject(&pen); 152 | // oldBr = (CBrush*)pDC->SelectStockObject(NULL_BRUSH); 153 | // //pDC->Rectangle(&rect); 154 | // pDC->SelectObject(oldPen); 155 | // pDC->SelectObject(oldBr); 156 | //pen.DeleteObject(); 157 | 158 | /* 159 | * Draw Shadow next; 160 | */ 161 | if(backHori)//hori 162 | { 163 | color = RGB(170,170,170); 164 | CPen pen1(PS_SOLID,2,color); 165 | oldPen = (CPen*)pDC->SelectObject(&pen1); 166 | pDC->MoveTo(rect.left, rect.bottom+1); 167 | pDC->LineTo(rect.right+1, rect.bottom+1); 168 | pDC->LineTo(rect.right+1, rect.top); 169 | 170 | color = RGB(190,190,190); 171 | CPen pen2(PS_SOLID,2,color); 172 | pDC->SelectObject(&pen2); 173 | pDC->MoveTo(rect.left+1, rect.bottom+2); 174 | pDC->LineTo(rect.right+2, rect.bottom+2); 175 | pDC->LineTo(rect.right+2, rect.top+1); 176 | 177 | pDC->SelectObject(oldPen); 178 | pen1.DeleteObject(); 179 | pen2.DeleteObject(); 180 | } 181 | else//vert 182 | { 183 | #if 0 184 | color = RGB(170,170,170); 185 | CPen pen1(PS_SOLID,1,color); 186 | oldPen = (CPen*)pDC->SelectObject(&pen1); 187 | pDC->MoveTo(rect.left, rect.top-2); 188 | pDC->LineTo(rect.right+1, rect.top-2); 189 | pDC->LineTo(rect.right+1, rect.bottom); 190 | 191 | color = RGB(190,190,190); 192 | CPen pen2(PS_SOLID,1,color); 193 | pDC->SelectObject(&pen2); 194 | pDC->MoveTo(rect.left+1, rect.top-3); 195 | pDC->LineTo(rect.right+1, rect.top-3); 196 | pDC->LineTo(rect.right+1, rect.bottom-1); 197 | 198 | pDC->SelectObject(oldPen); 199 | pen1.DeleteObject(); 200 | pen2.DeleteObject(); 201 | #endif 202 | } 203 | 204 | } 205 | 206 | 207 | -------------------------------------------------------------------------------- /FA2013.APS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/FA2013.APS -------------------------------------------------------------------------------- /FA2013.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/FA2013.cpp -------------------------------------------------------------------------------- /FA2013.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/FA2013.h -------------------------------------------------------------------------------- /FA2013.idc: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /FA2013.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/FA2013.rc -------------------------------------------------------------------------------- /FA2013.reg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/FA2013.reg -------------------------------------------------------------------------------- /FA2013.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {6FDC0A28-1A9B-43E4-8A62-FF1645AE1D3F} 15 | FA2013 16 | MFCProj 17 | 18 | 19 | 20 | Application 21 | true 22 | Unicode 23 | Static 24 | 25 | 26 | Application 27 | false 28 | true 29 | Unicode 30 | Static 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | true 44 | 45 | 46 | false 47 | 48 | 49 | 50 | Use 51 | Level3 52 | Disabled 53 | WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) 54 | 55 | 56 | Windows 57 | true 58 | 59 | 60 | false 61 | true 62 | _DEBUG;%(PreprocessorDefinitions) 63 | 64 | 65 | 0x0804 66 | _DEBUG;%(PreprocessorDefinitions) 67 | $(IntDir);%(AdditionalIncludeDirectories) 68 | 69 | 70 | 71 | 72 | Level3 73 | Use 74 | MaxSpeed 75 | true 76 | true 77 | WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) 78 | 79 | 80 | Windows 81 | true 82 | true 83 | true 84 | 85 | 86 | false 87 | true 88 | NDEBUG;%(PreprocessorDefinitions) 89 | 90 | 91 | 0x0804 92 | NDEBUG;%(PreprocessorDefinitions) 93 | $(IntDir);%(AdditionalIncludeDirectories) 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | Create 171 | Create 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | -------------------------------------------------------------------------------- /FA2013.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 资源文件 22 | 23 | 24 | 资源文件 25 | 26 | 27 | 资源文件 28 | 29 | 30 | 资源文件 31 | 32 | 33 | 资源文件 34 | 35 | 36 | 资源文件 37 | 38 | 39 | 资源文件 40 | 41 | 42 | 资源文件 43 | 44 | 45 | 资源文件 46 | 47 | 48 | 资源文件 49 | 50 | 51 | 资源文件 52 | 53 | 54 | 55 | 56 | 头文件 57 | 58 | 59 | 头文件 60 | 61 | 62 | 头文件 63 | 64 | 65 | 头文件 66 | 67 | 68 | 头文件 69 | 70 | 71 | 头文件 72 | 73 | 74 | 头文件 75 | 76 | 77 | 头文件 78 | 79 | 80 | 头文件 81 | 82 | 83 | 头文件 84 | 85 | 86 | 头文件 87 | 88 | 89 | 头文件 90 | 91 | 92 | 头文件 93 | 94 | 95 | 头文件 96 | 97 | 98 | 头文件 99 | 100 | 101 | 头文件 102 | 103 | 104 | 头文件 105 | 106 | 107 | 头文件 108 | 109 | 110 | 头文件 111 | 112 | 113 | 头文件 114 | 115 | 116 | 头文件 117 | 118 | 119 | 头文件 120 | 121 | 122 | 头文件 123 | 124 | 125 | 头文件 126 | 127 | 128 | 头文件 129 | 130 | 131 | 头文件 132 | 133 | 134 | 头文件 135 | 136 | 137 | 头文件 138 | 139 | 140 | 头文件 141 | 142 | 143 | 头文件 144 | 145 | 146 | 头文件 147 | 148 | 149 | 150 | 151 | 源文件 152 | 153 | 154 | 源文件 155 | 156 | 157 | 源文件 158 | 159 | 160 | 源文件 161 | 162 | 163 | 源文件 164 | 165 | 166 | 源文件 167 | 168 | 169 | 源文件 170 | 171 | 172 | 源文件 173 | 174 | 175 | 源文件 176 | 177 | 178 | 源文件 179 | 180 | 181 | 源文件 182 | 183 | 184 | 源文件 185 | 186 | 187 | 源文件 188 | 189 | 190 | 源文件 191 | 192 | 193 | 源文件 194 | 195 | 196 | 源文件 197 | 198 | 199 | 源文件 200 | 201 | 202 | 源文件 203 | 204 | 205 | 源文件 206 | 207 | 208 | 源文件 209 | 210 | 211 | 源文件 212 | 213 | 214 | 源文件 215 | 216 | 217 | 源文件 218 | 219 | 220 | 源文件 221 | 222 | 223 | 源文件 224 | 225 | 226 | 227 | 228 | 资源文件 229 | 230 | 231 | -------------------------------------------------------------------------------- /FA2013.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /FA2013Doc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/FA2013Doc.cpp -------------------------------------------------------------------------------- /FA2013Doc.cpp.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/FA2013Doc.cpp.bak -------------------------------------------------------------------------------- /FA2013Doc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/FA2013Doc.h -------------------------------------------------------------------------------- /FA2013Doc.h.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/FA2013Doc.h.bak -------------------------------------------------------------------------------- /ImpView.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/ImpView.cpp -------------------------------------------------------------------------------- /ImpView.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/ImpView.h -------------------------------------------------------------------------------- /MainFrm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/MainFrm.cpp -------------------------------------------------------------------------------- /MainFrm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/MainFrm.h -------------------------------------------------------------------------------- /POINTER.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/POINTER.cur -------------------------------------------------------------------------------- /ReadMe.txt: -------------------------------------------------------------------------------- 1 | COMTRADE format decoder and visualization project 2 | 3 | for bachelor's degree 4 | 5 | Contributer: 6 | 7 | Yankan Song 8 | Fan Yi 9 | 10 | Basic Math Library 11 | 12 | Signal Process ++ 3.0 https://my.oschina.net/zmjerry/blog/13049 13 | 14 | Language: Chinese 15 | 16 | Functions: 17 | 18 | 1. Importing data files with COMTRADE format 19 | 2. Visualize the fault data channel in the COMTRADE file 20 | 3. Phasor and Symmetrical Component Analysis 21 | 4. Fault Process Analysis and Visualization 22 | 5. Protection Analysis 23 | 5.1 Bus Differential Analysis 24 | 5.2 Impedance Analysis 25 | 6. Active/reactive Power Computing 26 | 7. FFT and Harmonic Analysis 27 | 8. Formula editor (contributed by Fan Yi) -------------------------------------------------------------------------------- /Release/FA2013.Build.CppClean.log: -------------------------------------------------------------------------------- 1 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\ACHANNEL.OBJ 2 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\AVIEW.OBJ 3 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\BOUNDRY.OBJ 4 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\CALC.OBJ 5 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\CHILDFRM.OBJ 6 | C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\Release\cl.command.1.tlog 7 | C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\Release\CL.read.1.tlog 8 | C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\Release\CL.write.1.tlog 9 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\COMTIME.OBJ 10 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\COMTRADE.OBJ 11 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\DLGBDCHILD.OBJ 12 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\DLGBOUNDRY.OBJ 13 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\DLGBUSDIFF.OBJ 14 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\DLGBUSDIFFDATA.OBJ 15 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\DLGFORM.OBJ 16 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\DLGHARMO.OBJ 17 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\DLGIMP.OBJ 18 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\DLGIMPCHANSEL.OBJ 19 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\DLGPHASE.OBJ 20 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\DLGPOWER.OBJ 21 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\DLGSEQCOMP.OBJ 22 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\DLGVNAME.OBJ 23 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\DRAWCUBE.OBJ 24 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\DVIEW.OBJ 25 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\FA2013.EXE.INTERMEDIATE.MANIFEST 26 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\FA2013.OBJ 27 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\FA2013.PCH 28 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\FA2013.RES 29 | C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\Release\FA2013.vcxprojResolveAssemblyReference.cache 30 | C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\Release\FA2013.write.1.tlog 31 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\FA2013DOC.OBJ 32 | C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\Release\link.command.1.tlog 33 | C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\Release\link.read.1.tlog 34 | C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\Release\link.write.1.tlog 35 | C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\Release\link-cvtres.read.1.tlog 36 | C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\Release\link-cvtres.write.1.tlog 37 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\MAINFRM.OBJ 38 | C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\Release\mt.command.1.tlog 39 | C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\Release\mt.read.1.tlog 40 | C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\Release\mt.write.1.tlog 41 | C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\Release\rc.command.1.tlog 42 | C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\Release\rc.read.1.tlog 43 | C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\Release\rc.write.1.tlog 44 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\STDAFX.OBJ 45 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\FA2013\RELEASE\VC100.PDB 46 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\RELEASE\FA2013.EXE 47 | C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\RELEASE\FA2013.PDB 48 | -------------------------------------------------------------------------------- /Release/FA2013.log: -------------------------------------------------------------------------------- 1 | 生成启动时间为 2013/6/9 9:34:39。 2 | 1>项目“C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\FA2013.vcxproj”在节点 2 上(clean 个目标)。 3 | 1>_PrepareForClean: 4 | 正在删除文件“Release\FA2013.lastbuildstate”。 5 | 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppClean.targets(74,5): warning : 对路径“C:\USERS\炎侃\DESKTOP\FA20130522 - 副本\RELEASE\FA2013.EXE”的访问被拒绝。 6 | 1>已完成生成项目“C:\Users\炎侃\Desktop\fa20130522 - 副本\FA2013\FA2013.vcxproj”(clean 个目标)的操作。 7 | 8 | 生成成功。 9 | 10 | 已用时间 00:00:00.74 11 | -------------------------------------------------------------------------------- /Test Data/2009-01-25@01-38-41.000800.cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/2009-01-25@01-38-41.000800.cfg -------------------------------------------------------------------------------- /Test Data/2009-01-25@01-38-41.000800.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/2009-01-25@01-38-41.000800.dat -------------------------------------------------------------------------------- /Test Data/2009-01-25@01-38-41.000800.inf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/2009-01-25@01-38-41.000800.inf -------------------------------------------------------------------------------- /Test Data/2009-01-25@01-38-41.000800.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/2009-01-25@01-38-41.000800.rpt -------------------------------------------------------------------------------- /Test Data/2009-01-25@01-38-41.000800.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/2009-01-25@01-38-41.000800.txt -------------------------------------------------------------------------------- /Test Data/2009-01-25@01-38-41.000800.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/2009-01-25@01-38-41.000800.xml -------------------------------------------------------------------------------- /Test Data/2009年01月25日01时38分41秒.CON: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/2009年01月25日01时38分41秒.CON -------------------------------------------------------------------------------- /Test Data/2009年01月25日01时38分41秒.ZYD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/2009年01月25日01时38分41秒.ZYD -------------------------------------------------------------------------------- /Test Data/2009年01月25日01时38分41秒.cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/2009年01月25日01时38分41秒.cfg -------------------------------------------------------------------------------- /Test Data/2009年01月25日01时38分41秒.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/2009年01月25日01时38分41秒.dat -------------------------------------------------------------------------------- /Test Data/2009年01月25日01时38分41秒.inf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/2009年01月25日01时38分41秒.inf -------------------------------------------------------------------------------- /Test Data/2009年01月25日01时38分41秒.mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/2009年01月25日01时38分41秒.mod -------------------------------------------------------------------------------- /Test Data/2009年01月25日01时38分41秒.rpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/2009年01月25日01时38分41秒.rpt -------------------------------------------------------------------------------- /Test Data/2009年01月25日01时38分41秒.sti: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/2009年01月25日01时38分41秒.sti -------------------------------------------------------------------------------- /Test Data/2009年01月25日01时38分41秒.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/2009年01月25日01时38分41秒.txt -------------------------------------------------------------------------------- /Test Data/2009年01月25日01时38分41秒.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/2009年01月25日01时38分41秒.xml -------------------------------------------------------------------------------- /Test Data/aaa.zef: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/aaa.zef -------------------------------------------------------------------------------- /Test Data/asy.zef: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/asy.zef -------------------------------------------------------------------------------- /Test Data/南乐_乐平变.mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/Test Data/南乐_乐平变.mod -------------------------------------------------------------------------------- /ThreadFunc.h: -------------------------------------------------------------------------------- 1 | #include "FA2013Doc.h" 2 | #include 3 | class CFA2013Doc; 4 | class CComtrade; 5 | 6 | unsigned int ThreadFunc(LPVOID pParam) 7 | { 8 | CFA2013Doc* pDoc = (CFA2013Doc*)pParam; 9 | int NUMA = pDoc->pFile->m_ANumber; 10 | int NUMDATA = pDoc->pFile->AVector[0]->AData.size(); 11 | for (int i=0; iexit==0) 14 | { 15 | pDoc->pThread=NULL; 16 | return 0; 17 | } 18 | pDoc->pFile->AVector[i]->AmpData.resize(NUMDATA); 19 | pDoc->pFile->AVector[i]->PhData.resize(NUMDATA); 20 | pDoc->ThreadPro = (i*100.0)/NUMA; 21 | for(int j=0; jexit==0) 24 | { 25 | pDoc->pThread=NULL; 26 | return 0; 27 | } 28 | pDoc->pFile->AVector[i]->GetCurrentPhasor(j+1,pDoc->pFile->m_SampleRate); 29 | pDoc->pFile->AVector[i]->AmpData[j] = pDoc->pFile->AVector[i]->APhasor.Amplitude; 30 | pDoc->pFile->AVector[i]->PhData[j] = pDoc->pFile->AVector[i]->APhasor.phase; 31 | } 32 | pDoc->pFile->AVector[i]->ThreadFlag = 1; 33 | } 34 | pDoc->ThreadPro = 100.0; 35 | return 0; 36 | } -------------------------------------------------------------------------------- /UserImages.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/UserImages.bmp -------------------------------------------------------------------------------- /calc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Songyk13/FA2013/474e254867b5d34fe543b1f21bc72d567f90e7ae/calc.cpp -------------------------------------------------------------------------------- /calc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "Comtrade.h" 5 | #include "AChannel.h" 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | 12 | //std::stack Operator; 13 | //std::stack Operand; 14 | //CString Expression(_T("(3+abs((2-6/2)*5))")); 15 | //bool quit; 16 | //std::locale loc ( "English" ); 17 | //std::map opPri; 18 | //std::map Constants; 19 | 20 | int exam(CString* result, CString& inputExp,CComtrade* inputFile); 21 | AChannel EVA(const CString& inputExp, CComtrade* inputFile); 22 | //void pushChannel(AChannel Channel); 23 | void pushChannel(double num, int len); 24 | //AChannel Chan_abs(AChannel* Channel); 25 | AChannel Chan_Fx(AChannel* Channel, const CString& Fx); 26 | void Multi_Fx(CComtrade* inputFile); -------------------------------------------------------------------------------- /drawcube.h: -------------------------------------------------------------------------------- 1 | #ifndef _Draw_CUBE_H 2 | #define _Draw_CUBE_H 3 | 4 | void DrawColorCube(CDC* pDC, CRect& rect, COLORREF colorFrom, COLORREF colorTo = RGB(255,255,255), BOOL IsHori = true); 5 | 6 | #endif -------------------------------------------------------------------------------- /fftpf.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef FFTPF_H 3 | #define FFTPF_H 4 | 5 | 6 | #include "splab_vector.h" 7 | 8 | #define PRIMEFACTOR 37 9 | #define PRIMEFACTORHALF (PRIMEFACTOR+1)/2 10 | #define PRIMECOUNT 20 11 | 12 | 13 | namespace splab 14 | { 15 | 16 | template 17 | class FFTPF 18 | { 19 | 20 | public: 21 | 22 | FFTPF(); 23 | ~FFTPF(); 24 | 25 | void fft( const Vector &xn, Vector< complex > &Xk ); 26 | void ifft( const Vector< complex > &Xk, Vector &xn ); 27 | 28 | void fft( const Vector< complex > &xn, 29 | Vector< complex > &Xk ); 30 | void ifft( const Vector< complex > &Xk, 31 | Vector< complex > &xn ); 32 | 33 | private: 34 | 35 | bool bAlloc; 36 | int mNOldSize, mNFactor, nNewFactorSize, nHalfFactorSize, 37 | groupOffset, dataOffset, blockOffset, adr, groupNo, 38 | dataNo, blockNo, twNo; 39 | int mSofarRadix[PRIMECOUNT], mActualRadix[PRIMECOUNT], 40 | mRemainRadix[PRIMECOUNT]; 41 | 42 | Type tPI, t2PI, tIRT2, tIRT3, omega, twRe, twIim; 43 | Type *pftwRe, *pftgRe, *pfzRe, *pfvRe, *pfwRe, *pftwIm, *pftgIm, 44 | *pfzIm, *pfvIm, *pfwIm; 45 | Type twiddleRe[PRIMEFACTOR], trigRe[PRIMEFACTOR], zRe[PRIMEFACTOR], 46 | twiddleIm[PRIMEFACTOR], trigIm[PRIMEFACTOR], zIm[PRIMEFACTOR], 47 | vRe[PRIMEFACTORHALF], wRe[PRIMEFACTORHALF], 48 | vIm[PRIMEFACTORHALF], wIm[PRIMEFACTORHALF]; 49 | 50 | Type c3_1, 51 | c5_1, c5_2, c5_3, c5_4, c5_5, 52 | c7_1, c7_2, c7_3, c7_4, c7_5, c7_6, 53 | c9_2, c9_3, c9_4, c9_5, c9_6, c9_7, c9_8, c9_9, 54 | c11_1, c11_2, c11_3, c11_4, c11_5, c11_6, c11_7, c11_8, 55 | c11_9, c11_10, c13_1, c13_2, c13_3, c13_4, c13_5, c13_6, 56 | c13_7, c13_8, c13_9, c13_10, c13_11, c13_12, c16_2, c16_3, 57 | c16_4, c16_5; 58 | 59 | Type ttmp, 60 | t1_re, t1_im, t2_re, t2_im, t3_re, t3_im, t4_re, t4_im, 61 | t5_re, t5_im, t6_re, t6_im, t7_re, t7_im, t8_re, t8_im, 62 | t9_re, t9_im, t10_re, t10_im, t11_re, t11_im, t12_re, t12_im, 63 | t13_re, t13_im, t14_re, t14_im, t15_re, t15_im, t16_re, t16_im, 64 | t17_re, t17_im, t18_re, t18_im, t19_re, t19_im, t20_re, t20_im, 65 | t21_re, t21_im, t22_re, t22_im, 66 | m1_re, m1_im, m2_re, m2_im, m3_re, m3_im, m4_re, m4_im, 67 | m5_re, m5_im, m6_re, m6_im, m7_re, m7_im, m8_re, m8_im, 68 | m9_re, m9_im, m10_re, m10_im, m11_re, m11_im, m12_re, m12_im; 69 | 70 | void releaseMem(); 71 | void allocateMem(); 72 | void factorize( int n, int &nFact, int *fact); 73 | void primeSetup( int nPoints ); 74 | void permute( const Vector &xn, Vector< complex > &yn ); 75 | void permute( const Vector< complex > &xn, Vector< complex > &yn, 76 | bool bTrans=true ); 77 | void initTrig( int radix ); 78 | void radix2( Type *aRe, Type *aIm ); 79 | void radix3( Type *aRe, Type *aIm ); 80 | void radix4( Type *aRe, Type *aIm ); 81 | void radix5( Type *aRe, Type *aIm ); 82 | void radix7( Type *aRe, Type *aIm ); 83 | void radix8( Type *aRe, Type *aIm ); 84 | void radix9( Type *aRe, Type *aIm ); 85 | void radix10( Type *aRe, Type *aIm ); 86 | void radix11( Type *aRe, Type *aIm ); 87 | void radix13( Type *aRe, Type *aIm ); 88 | void radix16( Type *aRe, Type *aIm ); 89 | void radixOther( int radix ); 90 | void twiddleFFT( int sofarRadix, int radix, int remainRadix, 91 | Vector< complex > &yn ); 92 | 93 | }; 94 | // class FFTPF 95 | 96 | template 97 | FFTPF::FFTPF() 98 | { 99 | bAlloc = false; 100 | mNOldSize = nNewFactorSize = nHalfFactorSize = 0; 101 | 102 | pftwRe = twiddleRe; 103 | pftwIm = twiddleIm; 104 | pftgRe = trigRe; 105 | pftgIm = trigIm; 106 | pfzRe = zRe; 107 | pfzIm = zIm; 108 | pfvRe = vRe; 109 | pfvIm = vIm; 110 | pfwRe = wRe; 111 | pfwIm = wIm; 112 | 113 | tIRT2 = Type(sqrt(2.0)/2); 114 | tIRT3 = Type(sqrt(3.0)/2); 115 | tPI = Type(4*atan(1.0)); 116 | t2PI = 2*tPI; 117 | Type tphi = t2PI/5; 118 | 119 | c3_1 = -1.5; 120 | c5_1 = Type((cos(tphi)-cos(2*tphi))/2); 121 | c5_2 = Type(sin(tphi)); 122 | c5_3 = Type(sin(2*tphi)); 123 | c5_4 = Type((c5_3+c5_2)); 124 | c5_3 = c5_2-c5_3; 125 | c5_5 = 1.25; 126 | 127 | tphi = t2PI/7; 128 | c7_1 = Type(cos(tphi)); 129 | c7_2 = Type(cos(2*tphi)); 130 | c7_3 = Type(cos(3*tphi)); 131 | c7_4 = Type(sin(tphi)); 132 | c7_5 = Type(sin(2*tphi)); 133 | c7_6 = Type(sin(3*tphi)); 134 | 135 | tphi = t2PI/9; 136 | c9_4 = Type(cos(tphi)); 137 | c9_8 = Type(sin(8*tphi)); 138 | c9_3 = Type(cos(2*tphi)); 139 | c9_7 = Type(sin(2*tphi)); 140 | c9_5 = Type(cos(3*tphi)); 141 | c9_2 = Type(cos(4*tphi)); 142 | c9_6 = Type(sin(5*tphi)); 143 | 144 | tphi = t2PI/11; 145 | c11_1 = Type(cos(tphi)); 146 | c11_2 = Type(cos(2*tphi)); 147 | c11_3 = Type(cos(3*tphi)); 148 | c11_4 = Type(cos(4*tphi)); 149 | c11_5 = Type(cos(5*tphi)); 150 | c11_6 = Type(sin(tphi)); 151 | c11_7 = Type(sin(2*tphi)); 152 | c11_8 = Type(sin(3*tphi)); 153 | c11_9 = Type(sin(4*tphi)); 154 | c11_10 = Type(sin(5*tphi)); 155 | 156 | tphi = t2PI/13; 157 | c13_1 = Type(cos(tphi)); 158 | c13_2 = Type(cos(2*tphi)); 159 | c13_3 = Type(cos(3*tphi)); 160 | c13_4 = Type(cos(4*tphi)); 161 | c13_5 = Type(cos(5*tphi)); 162 | c13_6 = Type(cos(6*tphi)); 163 | c13_7 = Type(sin(tphi)); 164 | c13_8 = Type(sin(2*tphi)); 165 | c13_9 = Type(sin(3*tphi)); 166 | c13_10 = Type(sin(4*tphi)); 167 | c13_11 = Type(sin(5*tphi)); 168 | c13_12 = Type(sin(6*tphi)); 169 | 170 | tphi = t2PI/16; 171 | c16_2 = Type(sin(tphi)); 172 | c16_5 = Type(cos(tphi)); 173 | c16_3 = c16_2+c16_5; 174 | c16_4 = c16_5-c16_2; 175 | } 176 | 177 | 178 | template 179 | FFTPF::~FFTPF() 180 | { 181 | releaseMem(); 182 | } 183 | 184 | 185 | template 186 | void FFTPF::releaseMem() 187 | { 188 | if ( !bAlloc) 189 | return; 190 | 191 | if ( NULL != pftwRe ) 192 | delete []pftwRe; 193 | if ( NULL != pftwIm ) 194 | delete []pftwIm; 195 | if ( NULL != pftgRe ) 196 | delete []pftgRe; 197 | if ( NULL != pftgIm ) 198 | delete []pftgIm; 199 | if ( NULL != pfzRe ) 200 | delete []pfzRe; 201 | if ( NULL != pfzIm ) 202 | delete []pfzIm; 203 | if ( NULL != pfvRe ) 204 | delete []pfvRe; 205 | if ( NULL != pfvIm ) 206 | delete []pfvIm; 207 | if ( NULL != pfwRe ) 208 | delete []pfwRe; 209 | if ( NULL != pfwIm ) 210 | delete []pfwIm; 211 | 212 | bAlloc = false; 213 | nNewFactorSize = nHalfFactorSize = 0; 214 | } 215 | 216 | 217 | /** 218 | * allocate memory 219 | */ 220 | template 221 | inline void FFTPF::allocateMem() 222 | { 223 | pftwRe = new Type[nNewFactorSize]; 224 | pftwIm = new Type[nNewFactorSize]; 225 | pftgRe = new Type[nNewFactorSize]; 226 | pftgIm = new Type[nNewFactorSize]; 227 | pfzRe = new Type[nNewFactorSize]; 228 | pfzIm = new Type[nNewFactorSize]; 229 | pfvRe = new Type[nHalfFactorSize]; 230 | pfvIm = new Type[nHalfFactorSize]; 231 | pfwRe = new Type[nHalfFactorSize]; 232 | pfwIm = new Type[nHalfFactorSize]; 233 | bAlloc = true; 234 | } 235 | 236 | 237 | /** 238 | * factoring the transformation length. 239 | */ 240 | template 241 | void FFTPF::factorize( int n, int &nFact, int *fact ) 242 | { 243 | int i, j=0, k, 244 | nRadix = 11, radices[12], 245 | factors[PRIMECOUNT]; 246 | 247 | radices[1] = 2; radices[2] = 3; radices[3] = 4; radices[4] = 5; 248 | radices[5] = 7; radices[6] = 8; radices[7] = 9; radices[8] = 10; 249 | radices[9] = 11; radices[10] = 13; radices[11] = 16; 250 | 251 | if( 1 == n ) 252 | { 253 | j = 1; 254 | factors[1] = 1; 255 | } 256 | 257 | i = nRadix; 258 | while( (n>1) && (i>0) ) 259 | { 260 | if( (n%radices[i]) != 0 ) 261 | --i; 262 | else 263 | { 264 | n = n/radices[i]; 265 | j++; 266 | factors[j] = radices[i]; 267 | } 268 | } 269 | 270 | if( 2 == factors[j] ) 271 | { 272 | i = j-1; 273 | while( (i>0) && (factors[i]!=8) ) 274 | i--; 275 | if( i > 0 ) 276 | { 277 | factors[j] = 4; 278 | factors[i] = 4; 279 | } 280 | } 281 | 282 | if( n > 1 ) 283 | { 284 | for( k=2; k 1 ) 292 | { 293 | j++; 294 | factors[j] = n; 295 | } 296 | } 297 | 298 | for( i=1; i<=j; ++i ) 299 | fact[i] = factors[j-i+1]; 300 | 301 | nFact = j; 302 | } 303 | 304 | 305 | /** 306 | * After N is factored the parameters that control the stages are generated. 307 | * For each stage we have: 308 | * mSofarRadix : the product of the radices so far. 309 | * mActualRadix : the radix handled in this stage. 310 | * mRemainRadix : the product of the remaining radices. 311 | */ 312 | template 313 | void FFTPF::primeSetup( int nPoints ) 314 | { 315 | factorize( nPoints, mNFactor, mActualRadix ); 316 | 317 | if( mActualRadix[1] > PRIMEFACTOR ) 318 | { 319 | bool bdone = true; 320 | if( bAlloc ) 321 | { 322 | if( mActualRadix[1] <= nNewFactorSize ) 323 | bdone=false; 324 | else 325 | { 326 | releaseMem(); 327 | bdone=true; 328 | } 329 | } 330 | 331 | if( bdone ) 332 | { 333 | nNewFactorSize = mActualRadix[1]; 334 | nHalfFactorSize = (nNewFactorSize+1)/2; 335 | allocateMem(); 336 | } 337 | } 338 | 339 | mSofarRadix[1] = 1; 340 | mRemainRadix[0] = nPoints; 341 | mRemainRadix[1] = nPoints/mActualRadix[1]; 342 | 343 | for( int i=2; i<=mNFactor; ++i ) 344 | { 345 | mSofarRadix[i] = mSofarRadix[i-1] * mActualRadix[i-1]; 346 | mRemainRadix[i] = mRemainRadix[i-1] / mActualRadix[i]; 347 | } 348 | 349 | mNOldSize = nPoints; 350 | } 351 | 352 | 353 | /** 354 | * The sequence "yn" is the permuted input sequence "xn" so that the 355 | * following transformations can be performed in-place,and the final 356 | * result is the normal order. 357 | */ 358 | template 359 | void FFTPF::permute( const Vector &xn, 360 | Vector< complex > &yn ) 361 | { 362 | int i, j, k=0, nPoint = xn.size(), 363 | count[PRIMECOUNT]; 364 | 365 | for( i=1; i<=mNFactor; ++i ) 366 | count[i] = 0; 367 | 368 | for( i=0; i<=nPoint-2; ++i ) 369 | { 370 | yn[i] = xn[k]; 371 | j = 1; 372 | k += mRemainRadix[j]; 373 | count[1] = count[1]+1; 374 | while( count[j] >= mActualRadix[j] ) 375 | { 376 | count[j] = 0; 377 | k = k - mRemainRadix[j-1] + mRemainRadix[j+1]; 378 | j++; 379 | count[j] = count[j] + 1; 380 | } 381 | } 382 | yn[nPoint-1] = xn[nPoint-1]; 383 | } 384 | 385 | template 386 | void FFTPF::permute( const Vector< complex > &xn, 387 | Vector< complex > &yn, 388 | bool bTrans ) 389 | { 390 | int i, j, k=0, nPoint = xn.size(), 391 | count[PRIMECOUNT]; 392 | 393 | for( i=1; i<=mNFactor; ++i ) 394 | count[i] = 0; 395 | 396 | for( i=0; i<=nPoint-2; ++i ) 397 | { 398 | yn[i] = xn[k]; 399 | j = 1; 400 | k += mRemainRadix[j]; 401 | count[1] = count[1]+1; 402 | while( count[j] >= mActualRadix[j] ) 403 | { 404 | count[j] = 0; 405 | k = k - mRemainRadix[j-1] + mRemainRadix[j+1]; 406 | j++; 407 | count[j] = count[j] + 1; 408 | } 409 | } 410 | yn[nPoint-1] = xn[nPoint-1]; 411 | 412 | if( !bTrans ) 413 | for( i=0; i< nPoint; ++i ) 414 | yn[i] = conj(yn[i]); 415 | } 416 | 417 | 418 | /** 419 | * initialise sine/cosine table. 420 | */ 421 | template 422 | inline void FFTPF::initTrig( int radix ) 423 | { 424 | Type w, xre, xim; 425 | 426 | w = 2*tPI/radix; 427 | pftgRe[0] = 1; 428 | pftgIm[0] = 0; 429 | xre = Type(cos(w)); 430 | xim = -Type(sin(w)); 431 | pftgRe[1] = xre; 432 | pftgIm[1] = xim; 433 | 434 | for( int i=2; i 446 | inline void FFTPF::radix2( Type *aRe, Type *aIm ) 447 | { 448 | t1_re = aRe[0]; 449 | aRe[0] = t1_re+aRe[1]; 450 | aRe[1] = t1_re-aRe[1]; 451 | 452 | t1_im = aIm[0]; 453 | aIm[0] = t1_im+aIm[1]; 454 | aIm[1] = t1_im-aIm[1]; 455 | } 456 | 457 | 458 | /** 459 | * length 3 DFT 460 | */ 461 | template 462 | inline void FFTPF::radix3( Type *aRe, Type *aIm ) 463 | { 464 | t1_re = aRe[1]+aRe[2]; 465 | t2_re = (aRe[2]-aRe[1])*tIRT3; 466 | aRe[0] = aRe[0]+t1_re; 467 | 468 | t1_re = aRe[0]+t1_re*c3_1; 469 | t1_im = aIm[1]+aIm[2]; 470 | t2_im = (aIm[2]-aIm[1])*tIRT3; 471 | aIm[0] = aIm[0]+t1_im; 472 | 473 | t1_im = aIm[0]+t1_im*c3_1; 474 | aRe[1] = t1_re-t2_im; 475 | aRe[2] = t1_re+t2_im; 476 | aIm[1] = t1_im+t2_re; 477 | aIm[2] = t1_im-t2_re; 478 | } 479 | 480 | 481 | /** 482 | * length 4 DFT 483 | */ 484 | template 485 | inline void FFTPF::radix4( Type *aRe, Type *aIm ) 486 | { 487 | t1_re = aRe[0]+aRe[2]; 488 | m2_re = aRe[0]-aRe[2]; 489 | t2_re = aRe[1]+aRe[3]; 490 | aRe[0] = t1_re+t2_re; 491 | aRe[2] = t1_re-t2_re; 492 | 493 | t1_re = aIm[0]+aIm[2]; 494 | m2_im = aIm[0]-aIm[2]; 495 | t2_re = aIm[1]+aIm[3]; 496 | aIm[0] = t1_re+t2_re; 497 | aIm[2] = t1_re-t2_re; 498 | 499 | t1_re = aRe[1]-aRe[3]; 500 | t2_re = aIm[1]-aIm[3]; 501 | aRe[1] = m2_re+t2_re; 502 | aRe[3] = m2_re-t2_re; 503 | aIm[1] = m2_im-t1_re; 504 | aIm[3] = m2_im+t1_re; 505 | } 506 | 507 | 508 | /** 509 | * length 5 DFT 510 | */ 511 | template 512 | inline void FFTPF::radix5( Type *aRe, Type *aIm ) 513 | { 514 | t1_re = aRe[1]+aRe[4]; 515 | t2_re = aRe[2]-aRe[3]; 516 | t3_re = aRe[1]-aRe[4]; 517 | t4_re = aRe[2]+aRe[3]; 518 | t5_re = (t1_re-t4_re)*c5_1; 519 | t1_re = t1_re+t4_re; 520 | 521 | aRe[0] = aRe[0]+t1_re; 522 | 523 | t1_re = aRe[0]-t1_re*c5_5; 524 | t4_re = t1_re-t5_re; 525 | t1_re = t1_re+t5_re; 526 | t5_re = (t3_re+t2_re)*c5_2; 527 | t3_re = t5_re-t3_re*c5_4; 528 | t2_re = t5_re-t2_re*c5_3; 529 | t1_im = aIm[1]+aIm[4]; 530 | t2_im = aIm[2]-aIm[3]; 531 | t3_im = aIm[1]-aIm[4]; 532 | t4_im = aIm[2]+aIm[3]; 533 | t5_re = (t1_im-t4_im)*c5_1; t1_im = t1_im+t4_im; 534 | 535 | aIm[0] = aIm[0]+t1_im; 536 | 537 | t1_im = aIm[0]-t1_im*c5_5; 538 | t4_im = t1_im-t5_re; 539 | t1_im = t1_im+t5_re; 540 | t5_re = (t3_im+t2_im)*c5_2; 541 | t3_im = t5_re-t3_im*c5_4; 542 | t2_im = t5_re-t2_im*c5_3; 543 | 544 | aRe[1] = t1_re+t2_im; 545 | aIm[1] = t1_im-t2_re; 546 | aRe[2] = t4_re-t3_im; 547 | aIm[2] = t4_im+t3_re; 548 | aRe[3] = t4_re+t3_im; 549 | aIm[3] = t4_im-t3_re; 550 | aRe[4] = t1_re-t2_im; 551 | aIm[4] = t1_im+t2_re; 552 | } 553 | 554 | 555 | /** 556 | * length 7 DFT 557 | */ 558 | template 559 | inline void FFTPF::radix7( Type *aRe, Type *aIm ) 560 | { 561 | t1_re = aRe[1]+aRe[6]; 562 | t1_im = aIm[1]+aIm[6]; 563 | t2_re = aRe[2]+aRe[5]; 564 | t2_im = aIm[2]+aIm[5]; 565 | t3_re = aRe[3]+aRe[4]; 566 | t3_im = aIm[3]+aIm[4]; 567 | t4_re = aRe[6]-aRe[1]; 568 | t4_im = aIm[6]-aIm[1]; 569 | t5_re = aRe[5]-aRe[2]; 570 | t5_im = aIm[5]-aIm[2]; 571 | t6_re = aRe[4]-aRe[3]; 572 | t6_im = aIm[4]-aIm[3]; 573 | t7_re = aRe[0]-Type(0.5*t3_re); 574 | t7_im = aIm[0]-Type(0.5*t3_im); 575 | t8_re = t1_re-t3_re; 576 | t8_im = t1_im-t3_im; 577 | t9_re = t2_re-t3_re; 578 | t9_im = t2_im-t3_im; 579 | 580 | m1_re = t7_re+c7_1*t8_re+c7_2*t9_re; 581 | m1_im = t7_im+c7_1*t8_im+c7_2*t9_im; 582 | m2_re = t7_re+c7_2*t8_re+c7_3*t9_re; 583 | m2_im = t7_im+c7_2*t8_im+c7_3*t9_im; 584 | m3_re = t7_re+c7_3*t8_re+c7_1*t9_re; 585 | m3_im = t7_im+c7_3*t8_im+c7_1*t9_im; 586 | m4_re = c7_6*t4_re-c7_4*t5_re+c7_5*t6_re; 587 | m4_im = c7_6*t4_im-c7_4*t5_im+c7_5*t6_im; 588 | m5_re = c7_5*t4_re-c7_6*t5_re-c7_4*t6_re; 589 | m5_im = c7_5*t4_im-c7_6*t5_im-c7_4*t6_im; 590 | m6_re = c7_4*t4_re+c7_5*t5_re+c7_6*t6_re; 591 | m6_im = c7_4*t4_im+c7_5*t5_im+c7_6*t6_im; 592 | 593 | aRe[0] = aRe[0]+t1_re+t2_re+t3_re; 594 | aIm[0] = aIm[0]+t1_im+t2_im+t3_im; 595 | aRe[1] = m1_re-m6_im; 596 | aIm[1] = m1_im+m6_re; 597 | aRe[2] = m2_re-m5_im; 598 | aIm[2] = m2_im+m5_re; 599 | aRe[3] = m3_re-m4_im; 600 | aIm[3] = m3_im+m4_re; 601 | aRe[4] = m3_re+m4_im; 602 | aIm[4] = m3_im-m4_re; 603 | aRe[5] = m2_re+m5_im; 604 | aIm[5] = m2_im-m5_re; 605 | aRe[6] = m1_re+m6_im; 606 | aIm[6] = m1_im-m6_re; 607 | } 608 | 609 | 610 | /** 611 | * length 8 DFT 612 | */ 613 | template 614 | inline void FFTPF::radix8( Type *aRe, Type *aIm ) 615 | { 616 | t1_re = aRe[0]+aRe[4]; 617 | t2_re = aRe[0]-aRe[4]; 618 | t3_re = aRe[1]-aRe[7]; 619 | t4_re = aRe[1]+aRe[7]; 620 | t7_re = aRe[2]+aRe[6]; 621 | t6_re = aRe[2]-aRe[6]; 622 | t5_re = aRe[3]+aRe[5]; 623 | t8_re = aRe[3]-aRe[5]; 624 | m2_re = t1_re+t7_re; 625 | m2_im = t1_re-t7_re; 626 | m1_re = t4_re+t5_re; 627 | t4_re = (t4_re-t5_re)*tIRT2; 628 | 629 | aRe[0] = m2_re+m1_re; 630 | aRe[4] = m2_re-m1_re; 631 | 632 | m2_re = t2_re+t4_re; 633 | m1_re = t2_re-t4_re; 634 | t1_im = t3_re-t8_re; 635 | t3_re = (t3_re+t8_re)*tIRT2; 636 | t2_im = t3_re+t6_re; 637 | t4_im = t3_re-t6_re; 638 | t1_re = aIm[0]+aIm[4]; 639 | t2_re = aIm[0]-aIm[4]; 640 | t3_re = aIm[1]-aIm[7]; 641 | t4_re = aIm[1]+aIm[7]; 642 | t5_re = aIm[3]+aIm[5]; 643 | t6_re = aIm[2]-aIm[6]; 644 | t7_re = aIm[2]+aIm[6]; 645 | t8_re = aIm[3]-aIm[5]; 646 | m1_im = t1_re+t7_re; 647 | t1_re = t1_re-t7_re; 648 | t7_re = t4_re+t5_re; 649 | t4_re = (t4_re-t5_re)*tIRT2; 650 | 651 | aIm[0] = m1_im+t7_re; 652 | aIm[4] = m1_im-t7_re; 653 | 654 | t7_re = t2_re+t4_re; 655 | t2_re = t2_re-t4_re; 656 | t4_re = t3_re-t8_re; 657 | t3_re = (t3_re+t8_re)*tIRT2; 658 | t5_re = t3_re+t6_re; 659 | t3_re = t3_re-t6_re; 660 | 661 | aRe[1] = m2_re+t5_re; 662 | aIm[1] = t7_re-t2_im; 663 | aRe[2] = m2_im+t4_re; 664 | aIm[2] = t1_re-t1_im; 665 | aRe[3] = m1_re+t3_re; 666 | aIm[3] = t2_re-t4_im; 667 | aRe[5] = m1_re-t3_re; 668 | aIm[5] = t2_re+t4_im; 669 | aRe[6] = m2_im-t4_re; 670 | aIm[6] = t1_re+t1_im; 671 | aRe[7] = m2_re-t5_re; 672 | aIm[7] = t7_re+t2_im; 673 | } 674 | 675 | 676 | /** 677 | * length 9 DFT 678 | */ 679 | template 680 | inline void FFTPF::radix9( Type *aRe, Type *aIm ) 681 | { 682 | t1_re = aRe[1]+aRe[8]; 683 | t2_re = aRe[1]-aRe[8]; 684 | t3_re = aRe[2]+aRe[7]; 685 | t4_re = aRe[2]-aRe[7]; 686 | t5_re = aRe[3]+aRe[6]; 687 | ttmp = aRe[0]+t5_re; 688 | t7_re = aRe[4]+aRe[5]; 689 | t8_re = aRe[4]-aRe[5]; 690 | t8_im = (aRe[6]-aRe[3])*tIRT3; 691 | t7_im = aRe[0]+t5_re*c9_5; 692 | t5_re = t1_re+t3_re+t7_re; 693 | 694 | aRe[0] = ttmp+t5_re; 695 | 696 | t5_im = ttmp+t5_re*c9_5; 697 | t3_im = (t7_re-t3_re)*c9_2; 698 | t7_re = (t7_re-t1_re)*c9_3; 699 | t3_re = (t1_re-t3_re)*c9_4; 700 | t1_im = t7_im+t3_im+t3_re; 701 | t3_im = t7_im-t3_im-t7_re; 702 | t7_im = t7_im+t7_re-t3_re; 703 | t6_im = (t4_re-t2_re-t8_re)*tIRT3; 704 | t4_im = (t4_re+t8_re)*c9_6; 705 | t8_re = (t8_re-t2_re)*c9_7; 706 | t2_re = (t2_re+t4_re)*c9_8; 707 | t2_im = t8_im+t4_im+t2_re; 708 | t4_im = t8_im-t4_im-t8_re; 709 | t8_im = t8_im+t8_re-t2_re; 710 | t1_re = aIm[1]+aIm[8]; 711 | t2_re = aIm[1]-aIm[8]; 712 | t3_re = aIm[2]+aIm[7]; 713 | t4_re = aIm[2]-aIm[7]; 714 | t5_re = aIm[3]+aIm[6]; 715 | t6_re = (aIm[6]-aIm[3])*tIRT3; 716 | t7_re = aIm[4]+aIm[5]; 717 | t8_re = aIm[4]-aIm[5]; 718 | ttmp = aIm[0]+t5_re; 719 | t9_im = aIm[0]+t5_re*c9_5; 720 | t5_re = t1_re+t3_re+t7_re; 721 | 722 | aIm[0] = ttmp+t5_re; 723 | 724 | t5_re = ttmp+t5_re*c9_5; 725 | ttmp = (t7_re-t3_re)*c9_2; 726 | t7_re = (t7_re-t1_re)*c9_3; 727 | t3_re = (t1_re-t3_re)*c9_4; 728 | t1_re = t9_im+ttmp+t3_re; 729 | ttmp = t9_im-ttmp-t7_re; 730 | t7_re = t9_im+t7_re-t3_re; 731 | t9_re = (t4_re-t2_re-t8_re)*tIRT3; 732 | t3_re = (t4_re+t8_re)*c9_6; 733 | t8_re = (t8_re-t2_re)*c9_7; 734 | t4_re = (t2_re+t4_re)*c9_8; 735 | t2_re = t6_re+t3_re+t4_re; 736 | t3_re = t6_re-t8_re-t3_re; 737 | t8_re = t6_re+t8_re-t4_re; 738 | 739 | aRe[1] = t1_im-t2_re; 740 | aIm[1] = t1_re+t2_im; 741 | aRe[2] = t3_im+t3_re; 742 | aIm[2] = ttmp-t4_im; 743 | aRe[3] = t5_im-t9_re; 744 | aIm[3] = t5_re+t6_im; 745 | aRe[4] = t7_im-t8_re; 746 | aIm[4] = t7_re+t8_im; 747 | aRe[5] = t7_im+t8_re; 748 | aIm[5] = t7_re-t8_im; 749 | aRe[6] = t5_im+t9_re; 750 | aIm[6] = t5_re-t6_im; 751 | aRe[7] = t3_im-t3_re; 752 | aIm[7] = ttmp+t4_im; 753 | aRe[8] = t1_im+t2_re; 754 | aIm[8] = t1_re-t2_im; 755 | } 756 | 757 | 758 | /** 759 | * length 10 DFT 760 | */ 761 | template 762 | inline void FFTPF::radix10( Type *aRe, Type *aIm ) 763 | { 764 | t1_re = aRe[2]+aRe[8]; 765 | t2_re = aRe[4]-aRe[6]; 766 | t3_re = aRe[2]-aRe[8]; 767 | t4_re = aRe[4]+aRe[6]; 768 | t5_re = (t1_re-t4_re)*c5_1; 769 | t1_re = t1_re+t4_re; 770 | m9_re = aRe[0]+t1_re; 771 | t1_re = m9_re-t1_re*c5_5; 772 | t4_re = t1_re-t5_re; 773 | t1_re = t1_re+t5_re; 774 | t5_re = (t3_re+t2_re)*c5_2; 775 | t3_re = t5_re-t3_re*c5_4; 776 | t2_re = t5_re-t2_re*c5_3; 777 | t1_im = aIm[2]+aIm[8]; 778 | t2_im = aIm[4]-aIm[6]; 779 | t3_im = aIm[2]-aIm[8]; 780 | t4_im = aIm[4]+aIm[6]; 781 | t5_re = (t1_im-t4_im)*c5_1; 782 | t1_im = t1_im+t4_im; 783 | m9_im = aIm[0]+t1_im; 784 | t1_im = m9_im-t1_im*c5_5; 785 | t4_im = t1_im-t5_re; 786 | t1_im = t1_im+t5_re; 787 | t5_re = (t3_im+t2_im)*c5_2; 788 | t3_im = t5_re-t3_im*c5_4; 789 | t2_im = t5_re-t2_im*c5_3; 790 | m1_re = t1_re+t2_im; 791 | m1_im = t1_im-t2_re; 792 | m2_re = t4_re-t3_im; 793 | m2_im = t4_im+t3_re; 794 | m3_re = t4_re+t3_im; 795 | m3_im = t4_im-t3_re; 796 | m4_re = t1_re-t2_im; 797 | m4_im = t1_im+t2_re; 798 | t1_re = aRe[7]+aRe[3]; 799 | t2_re = aRe[9]-aRe[1]; 800 | t3_re = aRe[7]-aRe[3]; 801 | t4_re = aRe[9]+aRe[1]; 802 | t5_re = (t1_re-t4_re)*c5_1; 803 | t1_re = t1_re+t4_re; 804 | t9_re = aRe[5]+t1_re; 805 | t1_re = t9_re-t1_re*c5_5; 806 | t4_re = t1_re-t5_re; 807 | t1_re = t1_re+t5_re; 808 | t5_re = (t3_re+t2_re)*c5_2; 809 | t3_re = t5_re-t3_re*c5_4; 810 | t2_re = t5_re-t2_re*c5_3; 811 | t1_im = aIm[7]+aIm[3]; 812 | t2_im = aIm[9]-aIm[1]; 813 | t3_im = aIm[7]-aIm[3]; 814 | t4_im = aIm[9]+aIm[1]; 815 | t5_re = (t1_im-t4_im)*c5_1; 816 | t1_im = t1_im+t4_im; 817 | t9_im = aIm[5]+t1_im; 818 | t1_im = t9_im-t1_im*c5_5; 819 | t4_im = t1_im-t5_re; 820 | t1_im = t1_im+t5_re; 821 | t5_re = (t3_im+t2_im)*c5_2; 822 | t3_im = t5_re-t3_im*c5_4; 823 | t2_im = t5_re-t2_im*c5_3; 824 | m5_re = t1_re+t2_im; 825 | m5_im = t1_im-t2_re; 826 | m6_re = t4_re-t3_im; 827 | m6_im = t4_im+t3_re; 828 | m7_re = t4_re+t3_im; 829 | m7_im = t4_im-t3_re; 830 | m8_re = t1_re-t2_im; 831 | m8_im = t1_im+t2_re; 832 | 833 | aRe[0] = m9_re+t9_re; 834 | aIm[0] = m9_im+t9_im; 835 | aRe[1] = m1_re-m5_re; 836 | aIm[1] = m1_im-m5_im; 837 | aRe[2] = m2_re+m6_re; 838 | aIm[2] = m2_im+m6_im; 839 | aRe[3] = m3_re-m7_re; 840 | aIm[3] = m3_im-m7_im; 841 | aRe[4] = m4_re+m8_re; 842 | aIm[4] = m4_im+m8_im; 843 | aRe[5] = m9_re-t9_re; 844 | aIm[5] = m9_im-t9_im; 845 | aRe[6] = m1_re+m5_re; 846 | aIm[6] = m1_im+m5_im; 847 | aRe[7] = m2_re-m6_re; 848 | aIm[7] = m2_im-m6_im; 849 | aRe[8] = m3_re+m7_re; 850 | aIm[8] = m3_im+m7_im; 851 | aRe[9] = m4_re-m8_re; 852 | aIm[9] = m4_im-m8_im; 853 | } 854 | 855 | 856 | /** 857 | * length 11 DFT 858 | */ 859 | template 860 | inline void FFTPF::radix11( Type *aRe, Type *aIm ) 861 | { 862 | t1_re = aRe[1]+aRe[10]; 863 | t1_im = aIm[1]+aIm[10]; 864 | t2_re = aRe[2]+aRe[9]; 865 | t2_im = aIm[2]+aIm[9]; 866 | t3_re = aRe[3]+aRe[8]; 867 | t3_im = aIm[3]+aIm[8]; 868 | t4_re = aRe[4]+aRe[7]; 869 | t4_im = aIm[4]+aIm[7]; 870 | t5_re = aRe[5]+aRe[6]; 871 | t5_im = aIm[5]+aIm[6]; 872 | t6_re = aRe[10]-aRe[1]; 873 | t6_im = aIm[10]-aIm[1]; 874 | t7_re = aRe[9]-aRe[2]; 875 | t7_im = aIm[9]-aIm[2]; 876 | t8_re = aRe[8]-aRe[3]; 877 | t8_im = aIm[8]-aIm[3]; 878 | t9_re = aRe[7]-aRe[4]; 879 | t9_im = aIm[7]-aIm[4]; 880 | t10_re = aRe[6]-aRe[5]; 881 | t10_im = aIm[6]-aIm[5]; 882 | t11_re = aRe[0]-Type(0.5*t5_re); 883 | t11_im = aIm[0]-Type(0.5*t5_im); 884 | t12_re = t1_re-t5_re; 885 | t12_im = t1_im-t5_im; 886 | t13_re = t2_re-t5_re; 887 | t13_im = t2_im-t5_im; 888 | t14_re = t3_re-t5_re; 889 | t14_im = t3_im-t5_im; 890 | t15_re = t4_re-t5_re; 891 | t15_im = t4_im-t5_im; 892 | 893 | m1_re = t11_re+c11_1*t12_re+c11_2*t13_re+c11_3*t14_re+c11_4*t15_re; 894 | m1_im = t11_im+c11_1*t12_im+c11_2*t13_im+c11_3*t14_im+c11_4*t15_im; 895 | m2_re = t11_re+c11_2*t12_re+c11_4*t13_re+c11_5*t14_re+c11_3*t15_re; 896 | m2_im = t11_im+c11_2*t12_im+c11_4*t13_im+c11_5*t14_im+c11_3*t15_im; 897 | m3_re = t11_re+c11_3*t12_re+c11_5*t13_re+c11_2*t14_re+c11_1*t15_re; 898 | m3_im = t11_im+c11_3*t12_im+c11_5*t13_im+c11_2*t14_im+c11_1*t15_im; 899 | m4_re = t11_re+c11_4*t12_re+c11_3*t13_re+c11_1*t14_re+c11_5*t15_re; 900 | m4_im = t11_im+c11_4*t12_im+c11_3*t13_im+c11_1*t14_im+c11_5*t15_im; 901 | m5_re = t11_re+c11_5*t12_re+c11_1*t13_re+c11_4*t14_re+c11_2*t15_re; 902 | m5_im = t11_im+c11_5*t12_im+c11_1*t13_im+c11_4*t14_im+c11_2*t15_im; 903 | m6_re = c11_10*t6_re-c11_6*t7_re+c11_9*t8_re-c11_7*t9_re+c11_8*t10_re; 904 | m6_im = c11_10*t6_im-c11_6*t7_im+c11_9*t8_im-c11_7*t9_im+c11_8*t10_im; 905 | m7_re = c11_9*t6_re-c11_8*t7_re+c11_6*t8_re+c11_10*t9_re-c11_7*t10_re; 906 | m7_im = c11_9*t6_im-c11_8*t7_im+c11_6*t8_im+c11_10*t9_im-c11_7*t10_im; 907 | m8_re = c11_8*t6_re-c11_10*t7_re-c11_7*t8_re+c11_6*t9_re+c11_9*t10_re; 908 | m8_im = c11_8*t6_im-c11_10*t7_im-c11_7*t8_im+c11_6*t9_im+c11_9*t10_im; 909 | m9_re = c11_7*t6_re+c11_9*t7_re-c11_10*t8_re-c11_8*t9_re-c11_6*t10_re; 910 | m9_im = c11_7*t6_im+c11_9*t7_im-c11_10*t8_im-c11_8*t9_im-c11_6*t10_im; 911 | m10_re = c11_6*t6_re+c11_7*t7_re+c11_8*t8_re+c11_9*t9_re+c11_10*t10_re; 912 | m10_im = c11_6*t6_im+c11_7*t7_im+c11_8*t8_im+c11_9*t9_im+c11_10*t10_im; 913 | 914 | aRe[0] = aRe[0]+t1_re+t2_re+t3_re+t4_re+t5_re; 915 | aIm[0] = aIm[0]+t1_im+t2_im+t3_im+t4_im+t5_im; 916 | aRe[1] = m1_re-m10_im; 917 | aIm[1] = m1_im+m10_re; 918 | aRe[2] = m2_re-m9_im; 919 | aIm[2] = m2_im+m9_re; 920 | aRe[3] = m3_re-m8_im; 921 | aIm[3] = m3_im+m8_re; 922 | aRe[4] = m4_re-m7_im; 923 | aIm[4] = m4_im+m7_re; 924 | aRe[5] = m5_re-m6_im; 925 | aIm[5] = m5_im+m6_re; 926 | aRe[6] = m5_re+m6_im; 927 | aIm[6] = m5_im-m6_re; 928 | aRe[7] = m4_re+m7_im; 929 | aIm[7] = m4_im-m7_re; 930 | aRe[8] = m3_re+m8_im; 931 | aIm[8] = m3_im-m8_re; 932 | aRe[9] = m2_re+m9_im; 933 | aIm[9] = m2_im-m9_re; 934 | aRe[10] = m1_re+m10_im; 935 | aIm[10] = m1_im-m10_re; 936 | } 937 | 938 | 939 | /** 940 | * length 13 DFT 941 | */ 942 | template 943 | inline void FFTPF::radix13( Type *aRe, Type *aIm ) 944 | { 945 | t1_re = aRe[1]+aRe[12]; 946 | t1_im = aIm[1]+aIm[12]; 947 | t2_re = aRe[2]+aRe[11]; 948 | t2_im = aIm[2]+aIm[11]; 949 | t3_re = aRe[3]+aRe[10]; 950 | t3_im = aIm[3]+aIm[10]; 951 | t4_re = aRe[4]+aRe[9]; 952 | t4_im = aIm[4]+aIm[9]; 953 | t5_re = aRe[5]+aRe[8]; 954 | t5_im = aIm[5]+aIm[8]; 955 | t6_re = aRe[6]+aRe[7]; 956 | t6_im = aIm[6]+aIm[7]; 957 | t7_re = aRe[12]-aRe[1]; 958 | t7_im = aIm[12]-aIm[1]; 959 | t8_re = aRe[11]-aRe[2]; 960 | t8_im = aIm[11]-aIm[2]; 961 | t9_re = aRe[10]-aRe[3]; 962 | t9_im = aIm[10]-aIm[3]; 963 | t10_re = aRe[9]-aRe[4]; 964 | t10_im = aIm[9]-aIm[4]; 965 | t11_re = aRe[8]-aRe[5]; 966 | t11_im = aIm[8]-aIm[5]; 967 | t12_re = aRe[7]-aRe[6]; 968 | t12_im = aIm[7]-aIm[6]; 969 | t13_re = aRe[0]-Type(0.5*t6_re); 970 | t13_im = aIm[0]-Type(0.5*t6_im); 971 | t14_re = t1_re-t6_re; 972 | t14_im = t1_im-t6_im; 973 | t15_re = t2_re-t6_re; 974 | t15_im = t2_im-t6_im; 975 | t16_re = t3_re-t6_re; 976 | t16_im = t3_im-t6_im; 977 | t17_re = t4_re-t6_re; 978 | t17_im = t4_im-t6_im; 979 | t18_re = t5_re-t6_re; 980 | t18_im = t5_im-t6_im; 981 | 982 | m1_re = t13_re + c13_1*t14_re + c13_2*t15_re + c13_3*t16_re + 983 | c13_4*t17_re + c13_5*t18_re; 984 | m1_im = t13_im + c13_1*t14_im + c13_2*t15_im + c13_3*t16_im + 985 | c13_4*t17_im + c13_5*t18_im; 986 | m2_re = t13_re + c13_2*t14_re + c13_4*t15_re + c13_6*t16_re + 987 | c13_5*t17_re + c13_3*t18_re; 988 | m2_im = t13_im + c13_2*t14_im + c13_4*t15_im + c13_6*t16_im + 989 | c13_5*t17_im + c13_3*t18_im; 990 | m3_re = t13_re + c13_3*t14_re + c13_6*t15_re + c13_4*t16_re + 991 | c13_1*t17_re + c13_2*t18_re; 992 | m3_im = t13_im + c13_3*t14_im + c13_6*t15_im + c13_4*t16_im + 993 | c13_1*t17_im + c13_2*t18_im; 994 | m4_re = t13_re + c13_4*t14_re + c13_5*t15_re + c13_1*t16_re + 995 | c13_3*t17_re + c13_6*t18_re; 996 | m4_im = t13_im + c13_4*t14_im + c13_5*t15_im + c13_1*t16_im + 997 | c13_3*t17_im + c13_6*t18_im; 998 | m5_re = t13_re + c13_5*t14_re + c13_3*t15_re + c13_2*t16_re + 999 | c13_6*t17_re + c13_1*t18_re; 1000 | m5_im = t13_im + c13_5*t14_im + c13_3*t15_im + c13_2*t16_im + 1001 | c13_6*t17_im + c13_1*t18_im; 1002 | m6_re = t13_re + c13_6*t14_re + c13_1*t15_re + c13_5*t16_re + 1003 | c13_2*t17_re + c13_4*t18_re; 1004 | m6_im = t13_im + c13_6*t14_im + c13_1*t15_im + c13_5*t16_im + 1005 | c13_2*t17_im + c13_4*t18_im; 1006 | m7_re = c13_12*t7_re - c13_7*t8_re + c13_11*t9_re - c13_8*t10_re + 1007 | c13_10*t11_re - c13_9*t12_re; 1008 | m7_im = c13_12*t7_im - c13_7*t8_im + c13_11*t9_im - c13_8*t10_im + 1009 | c13_10*t11_im - c13_9*t12_im; 1010 | m8_re = c13_11*t7_re - c13_9*t8_re + c13_8*t9_re - c13_12*t10_re - 1011 | c13_7*t11_re + c13_10*t12_re; 1012 | m8_im = c13_11*t7_im - c13_9*t8_im + c13_8*t9_im - c13_12*t10_im - 1013 | c13_7*t11_im + c13_10*t12_im; 1014 | m9_re = c13_10*t7_re - c13_11*t8_re - c13_7*t9_re + c13_9*t10_re - 1015 | c13_12*t11_re - c13_8*t12_re; 1016 | m9_im = c13_10*t7_im - c13_11*t8_im - c13_7*t9_im + c13_9*t10_im - 1017 | c13_12*t11_im - c13_8*t12_im; 1018 | m10_re = c13_9*t7_re + c13_12*t8_re - c13_10*t9_re - c13_7*t10_re + 1019 | c13_8*t11_re + c13_11*t12_re; 1020 | m10_im = c13_9*t7_im + c13_12*t8_im - c13_10*t9_im - c13_7*t10_im + 1021 | c13_8*t11_im + c13_11*t12_im; 1022 | m11_re = c13_8*t7_re + c13_10*t8_re + c13_12*t9_re - c13_11*t10_re - 1023 | c13_9*t11_re - c13_7*t12_re; 1024 | m11_im = c13_8*t7_im + c13_10*t8_im + c13_12*t9_im - c13_11*t10_im - 1025 | c13_9*t11_im - c13_7*t12_im; 1026 | m12_re = c13_7*t7_re + c13_8*t8_re + c13_9*t9_re + c13_10*t10_re + 1027 | c13_11*t11_re + c13_12*t12_re; 1028 | m12_im = c13_7*t7_im + c13_8*t8_im + c13_9*t9_im + c13_10*t10_im + 1029 | c13_11*t11_im + c13_12*t12_im; 1030 | 1031 | aRe[0] = aRe[0]+t1_re+t2_re+t3_re+t4_re+t5_re+t6_re; 1032 | aIm[0] = aIm[0]+t1_im+t2_im+t3_im+t4_im+t5_im+t6_im; 1033 | aRe[1] = m1_re-m12_im; 1034 | aIm[1] = m1_im+m12_re; 1035 | aRe[2] = m2_re-m11_im; 1036 | aIm[2] = m2_im+m11_re; 1037 | aRe[3] = m3_re-m10_im; 1038 | aIm[3] = m3_im+m10_re; 1039 | aRe[4] = m4_re-m9_im; 1040 | aIm[4] = m4_im+m9_re; 1041 | aRe[5] = m5_re-m8_im; 1042 | aIm[5] = m5_im+m8_re; 1043 | aRe[6] = m6_re-m7_im; 1044 | aIm[6] = m6_im+m7_re; 1045 | aRe[7] = m6_re+m7_im; 1046 | aIm[7] = m6_im-m7_re; 1047 | aRe[8] = m5_re+m8_im; 1048 | aIm[8] = m5_im-m8_re; 1049 | aRe[9] = m4_re+m9_im; 1050 | aIm[9] = m4_im-m9_re; 1051 | aRe[10] = m3_re+m10_im; 1052 | aIm[10] = m3_im-m10_re; 1053 | aRe[11] = m2_re+m11_im; 1054 | aIm[11] = m2_im-m11_re; 1055 | aRe[12] = m1_re+m12_im; 1056 | aIm[12] = m1_im-m12_re; 1057 | } 1058 | 1059 | 1060 | /** 1061 | * length 16 DFT 1062 | */ 1063 | template 1064 | inline void FFTPF::radix16( Type *aRe, Type *aIm ) 1065 | { 1066 | t1_re = aRe[0]+aRe[8]; 1067 | t2_re = aRe[0]-aRe[8]; 1068 | t3_re = aRe[1]+aRe[9]; 1069 | t4_re = aRe[1]-aRe[9]; 1070 | t5_re = aRe[2]+aRe[10]; 1071 | t6_re = aRe[2]-aRe[10]; 1072 | t7_re = aRe[3]+aRe[11]; 1073 | t8_re = aRe[3]-aRe[11]; 1074 | t9_re = aRe[4]+aRe[12]; 1075 | t10_re = aRe[4]-aRe[12]; 1076 | t11_re = aRe[5]+aRe[13]; 1077 | t12_re = aRe[5]-aRe[13]; 1078 | t13_re = aRe[6]+aRe[14]; 1079 | t14_re = aRe[6]-aRe[14]; 1080 | t15_re = aRe[7]+aRe[15]; 1081 | t16_re = aRe[7]-aRe[15]; 1082 | t1_im = t1_re+t9_re; 1083 | t2_im = t1_re-t9_re; 1084 | t3_im = t3_re+t11_re; 1085 | t4_im = t3_re-t11_re; 1086 | t5_im = t5_re+t13_re; 1087 | t6_im = t5_re-t13_re; 1088 | t7_im = t7_re+t15_re; 1089 | t8_im = t7_re-t15_re; 1090 | t1_re = t1_im+t5_im; 1091 | t3_re = t1_im-t5_im; 1092 | t5_re = t3_im+t7_im; 1093 | t7_re = t3_im-t7_im; 1094 | 1095 | aRe[0] = t1_re+t5_re; 1096 | aRe[8] = t1_re-t5_re; 1097 | 1098 | t1_im = tIRT2*(t4_im+t8_im); 1099 | t5_im = tIRT2*(t4_im-t8_im); 1100 | t9_re = t2_im+t5_im; 1101 | t11_re = t2_im-t5_im; 1102 | t13_re = t6_im+t1_im; 1103 | t15_re = t6_im-t1_im; 1104 | t1_im = t4_re+t16_re; 1105 | t2_im = t4_re-t16_re; 1106 | t3_im = tIRT2*(t6_re+t14_re); 1107 | t4_im = tIRT2*(t6_re-t14_re); 1108 | t5_im = t8_re+t12_re; 1109 | t6_im = t8_re-t12_re; 1110 | t7_im = c16_2*(t2_im-t6_im); 1111 | t2_im = c16_3*t2_im-t7_im; 1112 | t6_im = c16_4*t6_im-t7_im; 1113 | t7_im = t2_re+t4_im; 1114 | t8_im = t2_re-t4_im; 1115 | t2_re = t7_im+t2_im; 1116 | t4_re = t7_im-t2_im; 1117 | t6_re = t8_im+t6_im; 1118 | t8_re = t8_im-t6_im; 1119 | t7_im = c16_5*(t1_im+t5_im); 1120 | t2_im = t7_im-c16_4*t1_im; 1121 | t4_im = t7_im-c16_3*t5_im; 1122 | t6_im = t10_re+t3_im; 1123 | t8_im = t10_re-t3_im; 1124 | t10_re = t6_im+t2_im; 1125 | t12_re = t6_im-t2_im; 1126 | t14_re = t8_im+t4_im; 1127 | t16_re = t8_im-t4_im; 1128 | t1_re = aIm[0]+aIm[8]; 1129 | t9_im = aIm[0]-aIm[8]; 1130 | t10_im = aIm[1]+aIm[9]; 1131 | t11_im = aIm[1]-aIm[9]; 1132 | t5_re = aIm[2]+aIm[10]; 1133 | t12_im = aIm[2]-aIm[10]; 1134 | t13_im = aIm[3]+aIm[11]; 1135 | t14_im = aIm[3]-aIm[11]; 1136 | t15_im = aIm[4]+aIm[12]; 1137 | t16_im = aIm[4]-aIm[12]; 1138 | t17_im = aIm[5]+aIm[13]; 1139 | t18_im = aIm[5]-aIm[13]; 1140 | t19_im = aIm[6]+aIm[14]; 1141 | t20_im = aIm[6]-aIm[14]; 1142 | t21_im = aIm[7]+aIm[15]; 1143 | t22_im = aIm[7]-aIm[15]; 1144 | t1_im = t1_re+t15_im; 1145 | t2_im = t1_re-t15_im; 1146 | t3_im = t10_im+t17_im; 1147 | t4_im = t10_im-t17_im; 1148 | t5_im = t5_re+t19_im; 1149 | t6_im = t5_re-t19_im; 1150 | t7_im = t13_im+t21_im; 1151 | t8_im = t13_im-t21_im; 1152 | t1_re = t1_im+t5_im; 1153 | t10_im = t1_im-t5_im; 1154 | t5_re = t3_im+t7_im; 1155 | t13_im = t3_im-t7_im; 1156 | 1157 | aIm[0] = t1_re+t5_re; 1158 | aIm[8] = t1_re-t5_re; 1159 | aRe[4] = t3_re+t13_im; 1160 | aIm[4] = t10_im-t7_re; 1161 | aRe[12] = t3_re-t13_im; 1162 | aIm[12] = t10_im+t7_re; 1163 | 1164 | t1_im = tIRT2*(t4_im+t8_im); 1165 | t5_im = tIRT2*(t4_im-t8_im); 1166 | t15_im = t2_im+t5_im; 1167 | t17_im = t2_im-t5_im; 1168 | t19_im = t6_im+t1_im; 1169 | t21_im = t6_im-t1_im; 1170 | t1_im = t11_im+t22_im; 1171 | t2_im = t11_im-t22_im; 1172 | t3_im = tIRT2*(t12_im+t20_im); 1173 | t4_im = tIRT2*(t12_im-t20_im); 1174 | t5_im = t14_im+t18_im; 1175 | t6_im = t14_im-t18_im; 1176 | t7_im = c16_2*(t2_im-t6_im); 1177 | t2_im = c16_3*t2_im-t7_im; 1178 | t6_im = c16_4*t6_im-t7_im; 1179 | t7_im = t9_im+t4_im; 1180 | t8_im = t9_im-t4_im; 1181 | t9_im = t7_im+t2_im; 1182 | t11_im = t7_im-t2_im; 1183 | t12_im = t8_im+t6_im; 1184 | t14_im = t8_im-t6_im; 1185 | t7_im = c16_5*(t1_im+t5_im); 1186 | t2_im = t7_im-c16_4*t1_im; 1187 | t4_im = t7_im-c16_3*t5_im; 1188 | t6_im = t16_im+t3_im; 1189 | t8_im = t16_im-t3_im; 1190 | t16_im = t6_im+t2_im; 1191 | t18_im = t6_im-t2_im; 1192 | t20_im = t8_im+t4_im; 1193 | t22_im = t8_im-t4_im; 1194 | 1195 | aRe[1] = t2_re+t16_im; 1196 | aIm[1] = t9_im-t10_re; 1197 | aRe[2] = t9_re+t19_im; 1198 | aIm[2] = t15_im-t13_re; 1199 | aRe[3] = t8_re-t22_im; 1200 | aIm[3] = t14_im+t16_re; 1201 | aRe[5] = t6_re+t20_im; 1202 | aIm[5] = t12_im-t14_re; 1203 | aRe[6] = t11_re-t21_im; 1204 | aIm[6] = t17_im+t15_re; 1205 | aRe[7] = t4_re-t18_im; 1206 | aIm[7] = t11_im+t12_re; 1207 | aRe[9] = t4_re+t18_im; 1208 | aIm[9] = t11_im-t12_re; 1209 | aRe[10] = t11_re+t21_im; 1210 | aIm[10] = t17_im-t15_re; 1211 | aRe[11] = t6_re-t20_im; 1212 | aIm[11] = t12_im+t14_re; 1213 | aRe[13] = t8_re+t22_im; 1214 | aIm[13] = t14_im-t16_re; 1215 | aRe[14] = t9_re-t19_im; 1216 | aIm[14] = t15_im+t13_re; 1217 | aRe[15] = t2_re-t16_im; 1218 | aIm[15] = t9_im+t10_re; 1219 | } 1220 | 1221 | 1222 | /** 1223 | * other length DFT 1224 | */ 1225 | template 1226 | inline void FFTPF::radixOther( int radix ) 1227 | { 1228 | Type rere, reim, imre, imim; 1229 | int i, j, k, n, max; 1230 | 1231 | n = radix; 1232 | max = (n+1)/2; 1233 | 1234 | for( j=1; j= n ) 1263 | k = k-n; 1264 | } 1265 | } 1266 | 1267 | for( j=1; j 1278 | void FFTPF::twiddleFFT( int sofarRadix, int radix, int remainRadix, 1279 | Vector< complex > &yn ) 1280 | { 1281 | Type cosw, sinw; 1282 | initTrig( radix ); 1283 | 1284 | omega = 2*tPI/(Type)(sofarRadix*radix); 1285 | cosw = Type(cos(omega)); 1286 | sinw = -Type(sin(omega)); 1287 | twRe = 1; 1288 | twIim = 0; 1289 | dataOffset = 0; 1290 | groupOffset = dataOffset; 1291 | adr = groupOffset; 1292 | 1293 | for( dataNo=0; dataNo 1 ) 1296 | { 1297 | pftwRe[0] = 1; 1298 | pftwIm[0] = 0; 1299 | pftwRe[1] = twRe; 1300 | pftwIm[1] = twIim; 1301 | 1302 | for( twNo=2; twNo1) && (dataNo>0) ) 1315 | { 1316 | pfzRe[0] = yn[adr].real(); 1317 | pfzIm[0] = yn[adr].imag(); 1318 | blockNo = 1; 1319 | do 1320 | { 1321 | adr += sofarRadix; 1322 | pfzRe[blockNo] = pftwRe[blockNo]*yn[adr].real() - 1323 | pftwIm[blockNo]*yn[adr].imag(); 1324 | pfzIm[blockNo] = pftwRe[blockNo]*yn[adr].imag() + 1325 | pftwIm[blockNo]*yn[adr].real(); 1326 | blockNo++; 1327 | } 1328 | while( blockNo < radix ); 1329 | } 1330 | else 1331 | for( blockNo=0; blockNo( pfzRe[blockNo], pfzIm[blockNo] ); 1382 | adr += sofarRadix; 1383 | } 1384 | groupOffset += sofarRadix*radix; 1385 | adr = groupOffset; 1386 | } 1387 | 1388 | dataOffset = dataOffset+1; 1389 | groupOffset = dataOffset; 1390 | adr = groupOffset; 1391 | } 1392 | } 1393 | 1394 | 1395 | /** 1396 | * forward transform 1397 | */ 1398 | template 1399 | void FFTPF::fft( const Vector &xn, Vector< complex > &Xk ) 1400 | { 1401 | int n = xn.size(); 1402 | if( n != mNOldSize ) 1403 | primeSetup( n ); 1404 | 1405 | permute( xn, Xk ); 1406 | 1407 | for( int i=1; i<=mNFactor; ++i ) 1408 | twiddleFFT( mSofarRadix[i], mActualRadix[i], mRemainRadix[i], Xk ); 1409 | } 1410 | 1411 | template 1412 | void FFTPF::fft( const Vector< complex > &xn, 1413 | Vector< complex > &Xk ) 1414 | { 1415 | int n = xn.size(); 1416 | if( n != mNOldSize ) 1417 | primeSetup( n ); 1418 | 1419 | permute( xn, Xk, true ); 1420 | 1421 | for( int i=1; i<=mNFactor; ++i ) 1422 | twiddleFFT( mSofarRadix[i], mActualRadix[i], mRemainRadix[i], Xk ); 1423 | } 1424 | 1425 | 1426 | /** 1427 | * inverse transform 1428 | */ 1429 | template 1430 | void FFTPF::ifft( const Vector< complex > &Xk, Vector &xn ) 1431 | { 1432 | int n = xn.size(); 1433 | if( n != mNOldSize ) 1434 | primeSetup( n ); 1435 | 1436 | Vector< complex > Yk(n); 1437 | permute( Xk, Yk, false ); 1438 | 1439 | for( int i=1; i<=mNFactor; ++i ) 1440 | twiddleFFT( mSofarRadix[i], mActualRadix[i], mRemainRadix[i], Yk ); 1441 | 1442 | for( int i=0; i 1447 | void FFTPF::ifft( const Vector< complex > &Xk, 1448 | Vector< complex > &xn ) 1449 | { 1450 | int n = xn.size(); 1451 | if( n != mNOldSize ) 1452 | primeSetup( n ); 1453 | 1454 | permute( Xk, xn, false ); 1455 | 1456 | for( int i=1; i<=mNFactor; ++i ) 1457 | twiddleFFT( mSofarRadix[i], mActualRadix[i], mRemainRadix[i], xn ); 1458 | 1459 | for( int i=0; i