📄 mdifftdoc.h
字号:
// mdiFFTDoc.h : interface of the CMdiFFTDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MDIFFTDOC_H__DD5312CF_6BC6_4B96_AF0D_7C198C8ABF49__INCLUDED_)
#define AFX_MDIFFTDOC_H__DD5312CF_6BC6_4B96_AF0D_7C198C8ABF49__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/*******************************************************************/
#define MaxData 256 //序列最大长度
#define PI 3.1415926536
//***这是自定义的Complex类
typedef enum{Sin,Traingle,Squar,Random}MySourceType;
class Complex{
public:
double Re,Im;
Complex(double re,double im){Re=re;Im=im;} ;
Complex(){Re=(Im=0);};
Complex operator+(Complex a){return Complex(Re+a.Re,Im+a.Im);}
Complex operator-(Complex a){return Complex(Re-a.Re,Im-a.Im);}
Complex operator*(Complex a){return Complex(Re*a.Re-Im*a.Im,Im*a.Re+Re*a.Im);}
double abs(){return Re*Re+Im*Im;}
};
#define DataType Complex;
//*******************************************************************
class CMdiFFTDoc : public CDocument
{
private:
protected: // create from serialization only
CMdiFFTDoc();
DECLARE_DYNCREATE(CMdiFFTDoc)
void CalcValues();
// Attributes
public:
Complex source[MaxData],afterfft[MaxData],afterifft[MaxData];
//complex<double> source,afterfft,afterifft;
// Operations
public:
void Setsource(MySourceType type);
// DataType Getsource(int i);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMdiFFTDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL
// Implementation
public:
long double m_amax; //频谱中最大的模
unsigned short m_power; //实际长度的指数(长度为2^m_power)
virtual ~CMdiFFTDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CMdiFFTDoc)
afx_msg void OnRadio5();
afx_msg void OnRadio6();
afx_msg void OnRadio7();
afx_msg void OnRadio8();
afx_msg void OnDeltaposSpin1(NMHDR* pNMHDR, LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MDIFFTDOC_H__DD5312CF_6BC6_4B96_AF0D_7C198C8ABF49__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -