⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vib.h

📁 声音处理程序,通过FFT可以看声音的频谱.
💻 H
字号:
// Vib.h : main header file for the VIB application
//

#if !defined(AFX_VIB_H__B29D1D94_3DD5_4ABC_93E3_A5E125CAFDAE__INCLUDED_)
#define AFX_VIB_H__B29D1D94_3DD5_4ABC_93E3_A5E125CAFDAE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifndef __AFXWIN_H__
	#error include 'stdafx.h' before including this file for PCH
#endif

#include "resource.h"       // main symbols

#include <math.h>
#include <afxtempl.h>
#include <mmsystem.h>

#include "WaveButton.h"

#include "Config.h"
#include "Envelop.h"
#include "MainFrm.h"
#include "ChildView.h"

#define MATH_PI 3.1415926535897932384626433832795
#define DSPMODE_MODULATE 0x0001
/////////////////////////////////////////////////////////////////////////////
// CVibApp:
// See Vib.cpp for the implementation of this class
//

class CVibApp : public CWinApp
{
public:
	int m_msWinFFT; //FFT分析时间
	int m_nFreqBlur; //处理泄漏的频谱
	int m_nFreqValue; //频率值格式
	int m_nFreqHalfLive; //每一频点的半衰期

	int m_nPassbandFreq1; //通带低频
	int m_nPassbandFreq2; //通带高频
	int m_nTransbandWidth; //过度带宽
	BOOL m_bModulate; //调制分析

	int m_nDispMaxFreq; //显示最大频率
	int m_msDispMaxTime; //显示信号最大时间
	int m_nDispSignalPlus; //信号显示增益
	int m_nDispFreqPlus; //频率显示增益

	BOOL m_bEnvelopSense; //是否暂停

	int m_nSampleFreq; //计算出的采样频率
	int m_nFFTPoint; //计算出的采样点数
	double m_dFreqHalfLive; //为半衰期的差分方程系数

	BOOL m_bPause; //是否暂停

	short* m_aData;
	double* m_aEnvelop;
	double* m_aPeak; 
	double* m_aFilter; 
	double* m_aFFTIn; 
	double* m_aFFTOut;
	int m_nFilterCnt;
	int m_nFFTCnt;
	int m_nFFTIn;
	double* m_pFFT;
	CString m_strEnvelop;

	CChildView* m_pView;
	CVibApp();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CVibApp)
	public:
	virtual BOOL InitInstance();
	virtual int ExitInstance();
	virtual BOOL OnIdle(LONG lCount);
	//}}AFX_VIRTUAL

// Implementation

public:
	void SetPause(BOOL bPause);
	int m_nPeakVibration;
	int m_nCurVibration;
	BOOL ConfigOption(BOOL bSave);
	int CalcGrid(double& dFrom,double& dTo,int& nSubGrids,int &nMainSubs);
	void DefautConfig();
	void LoadConfig();
	void SaveConfig();
	BOOL CreateFIR(double* aw,int& N,double p1,double p2,double tw,double fs=1);
	void DrawWave(CDC* pDC,CRect& rectClient);
	void ReadWave(PSHORT pData,int nSize);
	double* FFT(double aInData[],int nInCount,double aOutData[],int nOutCount);
	//{{AFX_MSG(CVibApp)
	afx_msg void OnAppAbout();
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

extern CVibApp theApp;
/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_VIB_H__B29D1D94_3DD5_4ABC_93E3_A5E125CAFDAE__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -