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

📄 bpf.h

📁 以前写的一个切比雪夫带通滤波器及频谱分析显示程序
💻 H
字号:
#include "stdafx.h"
/*****************************
	以下全部为以Chebyshev Type I
	带通滤波器设计得到的系数。 
/*****************************/
//#include "D:\MATLAB6p5\extern\include\tmwtypes.h "
const int L30 = 7;//11;   
const int L60 = 7;
const int L100 = 7;
const int L150 = 7;
const int L300 = 9;
const int L500 = 9;
const int L1K = 9;
const int L2K = 9;
const int L3K = 7;
const int L4K = 7;
const int L5K = 7;
const int L6K = 7;
const int L7K = 7;
const int L8K = 7;
const int L9K = 9;
const int L10K = 9;
//const int L30 = 7;
/*const real64_T B30[8] =
{
	0.00002340795342086,
		0.00016385567394602,
		0.00049156702183806,
		0.00081927836973010,
		0.00081927836973010,
		0.00049156702183806,
		0.00016385567394602,
		0.00002340795342086
};
//const int L30 = 7;
const real64_T A30[8] =
{
		1.0,
		-4.74425059062847,
		9.91021772872169,
		-11.75389291371736,
		8.51955414587875,
		-3.76459397933032,
		0.93721996496627,
		-0.10125813785270
};*/

// [b,a]=butter(3,[0.001814058,0.004081632],'bandpass')
const double B30[7] =
{
     4.48657023092964e-008,
	 0,
    -1.34597106927889e-007,
	0,
     1.34597106927889e-007,
	 0,
    -4.48657023092964e-008
};
const double A30[7] =
{
	1,
	-5.98553373043745,
	14.9279907708233,
	-19.8566233056791,
	14.8572626199342,
	-5.92894975386004,
	0.985853399219568
};
/*
//分子系数b:
const double B30[7] =
{
	3.261298493405e-008,
	0,
	-9.783895480216e-008,
	0,
  	9.783895480216e-008,
	0,
  	-3.261298493405e-008
};
const int DL = 7;
const double A30[7] = 
{
	1,   
	-5.987022823882,    
	14.93536760913,   
	-19.87124046162,
    14.87174398326,   
    -5.936122898739,   
    0.9872745918464
};

*/
const double B60[7] = {
  7.915195434472e-008,                 0,-2.374558630342e-007,                 0,
  2.374558630342e-007,                 0,-7.915195434472e-008
};
const double A60[7] = {
                   1,    -5.98192632051,    14.91063970544,   -19.82328471116,
      14.82527939145,    -5.91363186718,   0.9829238019845
};
const double B100[7] = {
  3.814287821848e-007,                 0,-1.144286346554e-006,                 0,
  1.144286346554e-006,                 0,-3.814287821848e-007
};
const double A100[7] = {
                   1,   -5.968378182614,    14.84483659871,   -19.69550914455,
      14.70129209302,   -5.853512212785,   0.9712708487769
};

const double B150[7] = {
  1.044800017315e-006,                 0,-3.134400051946e-006,                 0,
  3.134400051946e-006,                 0,-1.044800017315e-006
};
const double A150[7] = {
                   1,   -5.965235025499,    14.83291383037,    -19.6791612471,
      14.69236406276,   -5.852724449441,   0.9718428361997
};   

const double B300[9] = {
  1.453738671837e-007,                 0,-5.814954687348e-007,-3.176373552204e-022,
  8.722432031022e-007,-3.176373552204e-022,-5.814954687348e-007,                 0,
  1.453738671837e-007
};
const double A300[9] = {
                   1,   -7.918950303447,    27.46327313461,   -54.48000403452,
      67.61448877298,    -53.7601065903,    26.74228799871,   -7.609177810942,
     0.9481888343791
};     

const double B500[9] = {
  2.266701976398e-006,                 0,-9.066807905594e-006,                 0,
  1.360021185839e-005,                 0,-9.066807905594e-006,                 0,
  2.266701976398e-006
};
const double A500[9] = {
                   1,    -7.78319325295,    26.61126984317,   -52.20271269566,
       64.2614418539,   -50.83184556057,    25.23209997383,   -7.186130476471,
      0.899070679131
};     

const double B1K[9] = {
  3.152517762218e-005,                 0,-0.0001261007104887,-8.131516293641e-020,
  0.0001891510657331,-8.131516293641e-020,-0.0001261007104887,                 0,
  3.152517762218e-005
};
const double A1K[9] = {
                   1,   -7.348869971815,    24.01479354356,   -45.55275490829,
      54.84276532461,   -42.90980048118,    21.30963586838,   -6.143325752046,
     0.7876340679948
};

const double B2K[9] = {
  8.220697947711e-005,                 0,-0.0003288279179084,                 0,
  0.0004932418768627,                 0,-0.0003288279179084,                 0,
  8.220697947711e-005
};
const double A2K[9] = {
                   1,   -6.560530200522,    19.85813333591,   -35.98105387287,
      42.57649951607,   -33.66262716828,    17.38200693458,   -5.373173331801,
     0.7665787019568
};   

const double B3K[7] = {
   0.001170197008133,                 0,-0.003510591024399,                 0,
   0.003510591024399,                 0,-0.001170197008133
};
const double A3K[7] = {
                   1,   -3.832395245173,    7.594531864746,   -9.027026283542,
      6.927385004342,   -3.187721979447,   0.7591896429878
};       

const double B4K[7] = {
   0.001170197008133,                 0,-0.003510591024399,                 0,
   0.003510591024399,                 0,-0.001170197008133
};
const double A4K[7] = {
                   1,   -2.511496110791,    4.785205072087,   -5.122904552668,
      4.366640655106,   -2.089020271004,   0.7591896429878
};         

const double B5K[7] = {
   0.001170197008133,                 0,-0.003510591024399,                 0,
   0.003510591024399,                 0,-0.001170197008133
};
const double A5K[7] = {
                   1,  -0.9961006662976,     3.00318534051,   -1.832371816267,
      2.742302408025,  -0.8285397994108,   0.7591896429878
};          

const double B6K[7] = {
   0.001170197008133,                 0,-0.003510591024399,                 0,
   0.003510591024399,                 0,-0.001170197008133
};
const double A6K[7] = {
                   1,   0.5964352138359,    2.789800922068,    1.082868575686,
      2.547799246212,   0.4961047905629,   0.7591896429878
};           

const double B7K[7] = {
   0.001170197008133,                 0,-0.003510591024399,                 0,
   0.003510591024399,                 0,-0.001170197008133
};
const double A7K[7] = {
                   1,    2.142781713937,    4.209872094677,    4.232282163135,
      3.842215844621,    1.782329830222,   0.7591896429878
};          

const double B8K[7] = {
   0.001170197008133,                 0,-0.003510591024399,                 0,
   0.003510591024399,                 0,-0.001170197008133
};
const double A8K[7] = {
                   1,    3.523186035212,    6.832020556493,    7.996832653383,
      6.232344281796,    2.930526953417,   0.7591896429878
};      

const double B9K[9] = {
  8.220697947711e-005,                 0,-0.0003288279179084,-2.710505431214e-019,
  0.0004932418768627,-1.626303258728e-019,-0.0003288279179084,                 0,
  8.220697947711e-005
};
const double A9K[9] = {
                   1,    6.255559216492,    18.38718950841,    32.76398916065,
      38.56326883725,    30.65337315123,    16.09481213102,    5.123397489259,
     0.7665787019568
};        

const double B10K[9] = {
  8.220697947711e-005,                 0,-0.0003288279179084,1.084202172486e-019,
  0.0004932418768627,                 0,-0.0003288279179084,                 0,
  8.220697947711e-005
};
const double A10K[9] = {
                   1,    7.267289107443,    23.53609352939,    44.34361044655,
      53.14465650285,    41.48483409424,    20.60051953867,    5.952019552246,
     0.7665787019568
};

//int BPF30(int inputdat);
int BPF30(const double *b,const double *a,unsigned char buflen,int inputdat);
int BPF60(const double *b,const double *a,unsigned char buflen,int inputdat);
int BPF100(const double *b,const double *a,unsigned char buflen,int inputdat);
int BPF150(const double *b,const double *a,unsigned char buflen,int inputdat);
int BPF300(const double *b,const double *a,unsigned char buflen,int inputdat);
int BPF500(const double *b,const double *a,unsigned char buflen,int inputdat);
int BPF1k(const double *b,const double *a,unsigned char buflen,int inputdat);
int BPF2k(const double *b,const double *a,unsigned char buflen,int inputdat);
int BPF3k(const double *b,const double *a,unsigned char buflen,int inputdat);
int BPF4k(const double *b,const double *a,unsigned char buflen,int inputdat);
int BPF5k(const double *b,const double *a,unsigned char buflen,int inputdat);
int BPF6k(const double *b,const double *a,unsigned char buflen,int inputdat);
int BPF7k(const double *b,const double *a,unsigned char buflen,int inputdat);
int BPF8k(const double *b,const double *a,unsigned char buflen,int inputdat);
int BPF9k(const double *b,const double *a,unsigned char buflen,int inputdat);
int BPF10k(const double *b,const double *a,unsigned char buflen,int inputdat);

⌨️ 快捷键说明

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