📄 src_48to2205.h
字号:
//Include file for 48KHz to 22,050Hz. Greatest Common Denominator (GCD) = 320/147.
#define HALFB 0 // Half band flag
#define NUPST 0 // Number of up stages
#define PVTFL 1 // Pivot flag
#define NDWNS 2 // Number of down stages
#define STAGE 3 // Number of total stages
#define NINPS 320 // Number of imput samples (Should be a even multiple of the GCD
#define NOUTS 147 // Number of output samples (Should be be the same multiple as above of the GCD
#define INTP1 147
#define DOWN1 20
#define LENG1 59 // LENG1 = length of stage filter
#define PLEN1 1 // PLEN1 = MLEN1/INTP1 (polyphase length)
#define MLEN1 147 // MLEN1 = LENG1 + enough to make even length for polyphase
#define SHFT1 0
#define NINP1 NINPS // NINPS (...or NOUTS) 320
#define SZIN1 (NINP1 + ((LENG1-1)/INTP1) + 1) // 320 + 58/147 + 1 = 321
#define INTP2 1
#define DOWN2 8
#define LENG2 43 // LENG2 = length of stage filter
#define PLEN2 43 // PLEN2 = MLEN2/INTP2 (polyphase length)
#define MLEN2 43 // MLEN2 = LENG2 + enough to make even length for polyphase
#define SHFT2 -3
#define NINP2 ((NINP1*INTP1)/DOWN1) // (NINPx*INTPx)/DOWNx 320*147/20 = 2352
#define SZIN2 (NINP2 + ((LENG2-1)/INTP2) + 1) // 2352 + 42/1 + 1 = 2395
#define INTP3 1
#define DOWN3 2
#define LENG3 223 // LENG3 = length of stage filter
#define PLEN3 223 // PLEN2 = MLEN2/INTP2 (polyphase length)
#define MLEN3 223 // MLEN2 = LENG2 + enough to make even length for polyphase
#define SHFT3 2
#define NINP3 ((NINP2*INTP2)/DOWN2) // (NINPx*INTPx)/DOWNx = 2352*1/8 = 294
#define SZIN3 (NINP3 + ((LENG3-1)/INTP3) + 1) // 294 + 222/1 + 1 = 517
#define NINP4 ((NINP3*INTP3)/DOWN3) // (NINPx*INTPx)/DOWNx = 294*1/2 = 147
#define SZIN4 NINP4 + 1 // for last decimation stage only 148
#define OFFS1 (LENG1-1)/(2*DOWN1) // 58/2*20 = 1.45
#define OFFS2 (LENG2-1)/(2*DOWN2) // 42/2*8 = 2.625
#define OFFS3 (LENG3-1)/(2*DOWN3) // 222/2*2 = 55.5
#if OFFS3 < 1
#define OF2S3 1
#else
#define OF2S3 OFFS3
#endif
#define TOFS1 OFFS1 // 1.45
#define TOFS2 ((INTP2*TOFS1)/DOWN2 + OFFS2) // 1.45*1/8 + 2.625 =
#define TOFS3 ((INTP3*TOFS2)/DOWN3 + OF2S3) // 2.625*1/2 + 55.5 = 56.8
#define T2FS3 57
//#define DOFS3 (NOUTS-T2FS3) // Offset used to strip filter delays (zeros) off buffers
#define DOFS3 NOUTS
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -