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

📄 src_441to48.h

📁 在blankfin中 实现src 的程序
💻 H
字号:
//Include file for 44.1KHz to 48.0KHz.  Greatest Common Denominator (GCD) = 147/160.

#define HALFB 0						// Half band flag
#define NUPST 2						// Number of up stages
#define PVTFL 1						// Pivot flag
#define NDWNS 0						// Number of down stages

#define STAGE 3						// Number of total stages 
#define NINPS 294					// Number of imput samples (Should be a even multiple of the GCD 
#define NOUTS 320					// Number of output samples (Should be be the same multiple as above of the GCD

#define INTP1 2
#define DOWN1 1
#define LENG1 223					// LENG1 = length of stage filter
#define PLEN1 112					// PLEN1 = MLEN1/INTP1 (polyphase length)
#define MLEN1 224					// MLEN1 = LENG1 + enough to make even length for polyphase
#define SHFT1 0
#define NINP1 NINPS					// NINPS (...or NOUTS)
#define SZIN1 (NINP1 + ((LENG1-1)/INTP1) + 1) //294 + 222/2 = 405


#define INTP2 5
#define DOWN2 1
#define LENG2 27					// LENG2 = length of stage filter
#define PLEN2 6						// PLEN2 = MLEN2/INTP2 (polyphase length)
#define MLEN2 30					// MLEN2 = LENG2 + enough to make even length for polyphase
#define SHFT2 0
#define NINP2 ((NINP1*INTP1)/DOWN1)	// (NINPx*INTPx)/DOWNx 2*294 = 588
#define SZIN2 (NINP2 + ((LENG2-1)/INTP2) + 1) //588 + 26/5 = 593

#define INTP3 16
#define DOWN3 147
#define LENG3 49					// LENG3 = length of stage filter
#define PLEN3 4						// PLEN2 = MLEN2/INTP2 (polyphase length)
#define MLEN3 64					// MLEN2 = LENG2 + enough to make even length for polyphase
#define SHFT3 0
#define NINP3 ((NINP2*INTP2)/DOWN2)	// (NINPx*INTPx)/DOWNx = 588*5 = 2940
#define SZIN3 (NINP3 + ((LENG3-1)/INTP3) + 1) //2940 + 48/16 = 2943

#define NINP4 ((NINP3*INTP3)/DOWN3)	// (NINPx*INTPx)/DOWNx = 2943*16/147 = 320
#define SZIN4 NINP4 + 1  			// for last decimation stage only


#define OFFS1 (LENG1-1)/(2*DOWN1)	// 222/2*1 = 111
#define OFFS2 (LENG2-1)/(2*DOWN2)	// 26/2*1 = 13
#define OFFS3 (LENG3-1)/(2*DOWN3)	// 48/2*147 = 0.1632

#if OFFS3 < 1
#define OF2S3 1
#endif

#define TOFS1 OFFS1							// 111
#define TOFS2 ((INTP2*TOFS1)/DOWN2 + OFFS2)	// 5*111/1 + 13 = 555+13 = 568
#define TOFS3 ((INTP3*TOFS2)/DOWN3 + OF2S3)	// 16*568/147 + 1 = 62

//#define DOFS3 (NOUTS-TOFS3)		// Used to strip filter delays off buffers

#define DOFS3 NOUTS

⌨️ 快捷键说明

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