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

📄 fircoeff.asm

📁 变频器程序
💻 ASM
字号:
;==================================================================
; File name:    FIRCOEFF.ASM                     
;                    
; Originator:	Digital Control Systems Group
;			    Texas Instruments
; Description:  
; This file contains Filter coefficients and the initialisation routine
;===================================================================
; History:
;-------------------------------------------------------------------
; 24-1-2000	Release	Rev 1.0                                                  
;-------------------------------------------------------------------
;Header file containing FIR Filter coefficients to initialise the coefficient array.
;4 coefficient sets for Order 50, 20, & 10 are available for demo, user can expand it
;using ezFIR script
;=====================================================================================================
                    
; Include firsel.h header file
             		.include	firsel.h
             		                    
; External declaration to copy the FIR coeff from ROM to RAM
                    .def 	FIRCOEFF_init
 
; FIRCOEFF_COPY_ROM2RAM routine that copies the filter coefficients from ROM to RAM                           

FIRCOEFF_init:  
                    .text  
					LAR		AR2,#coeff_RUN_start_adr
					LACC	#coeff_LOAD_start_adr 
   				    MAR		*,AR2
   				    LAR		AR3, #(coeff_LOAD_end_adr-coeff_LOAD_start_adr-1)
loop:				TBLR	*+,AR3
					ADD		#1
   				    BANZ	loop,*-,AR2
   				   	RET

            	    .sect	"fircoff" 
                    .label	coeff_LOAD_start_adr  		; Load Address of the section                  
coeff_RUN_start_adr: 
                    							  		; Run Address of the section      
      
;********************************************************                   
; 50th Order Filter                                     
;********************************************************

			.if FIR_LPF50
FIR_LPF50_coeff_ptr	.word -34,-22,13,50,55,-1,-91,-137,-56,131
			.word 276,198,-127,-471,-481,0,690,976,384,-896
			.word -1905,-1447,1040,4892,8415,9839,8415,4892,1040,-1447
			.word -1905,-896,384,976,690,0,-481,-471,-127,198
			.word 276,131,-56,-137,-91,-1,55,50,13,-22
			.word -34
			.endif	

			.if FIR_HPF50
FIR_HPF50_coeff_ptr	.word 0,34,25,-32,-65,-1,106,83,-106,-214
			.word 0,321,240,-291,-565,-1,810,602,-730,-1447
			.word 0,2337,1976,-3019,-9877,19646,-9877,-3019,1976,2337
			.word 0,-1447,-730,602,810,-1,-565,-291,240,321
			.word 0,-214,-106,83,106,-1,-65,-32,25,34
			.word 0
			.endif
 
			.if FIR_BPF50
FIR_BPF50_coeff_ptr	.word 0,69,-1,-63,0,-1,-1,167,-1,-427
			.word 0,642,-1,-581,-1,-1,0,1203,-1,-2890
			.word 0,4670,-1,-6033,-1,6543,-1,-6033,-1,4670
			.word 0,-2890,-1,1203,0,-1,-1,-581,-1,642
			.word 0,-427,-1,167,-1,-1,0,-63,-1,69
			.word 0
			.endif     

			.if FIR_BSF50
FIR_BSF50_coeff_ptr	.word -1,-70,0,62,-1,-1,0,-169,0,427
			.word 0,-645,-1,582,0,-1,0,-1208,0,2900
			.word 0,-4688,0,6054,0,26267,0,6054,0,-4688
			.word 0,2900,0,-1208,0,-1,0,582,-1,-645
			.word 0,427,0,-169,0,-1,-1,62,0,-70
			.word -1
			.endif
                   
;********************************************************                   
; 20th Order Filter                                     
;********************************************************

			.if FIR_LPF20
FIR_LPF20_coeff_ptr	.word 0,95,207,123,-406,-1125,-1044,869,4517,8236
			.word 9815,8236,4517,869,-1044,-1125,-406,123,207,95
			.word 0
			.endif

			.if FIR_HPF20
FIR_HPF20_coeff_ptr	.word -1,113,128,-237,-659,0,1694,1658,-2801,-9711
			.word 19689,-9711,-2801,1658,1694,0,-659,-237,128,113
			.word -1
			.endif
               
            .if FIR_BPF20
FIR_BPF20_coeff_ptr	.word -1,0,304,-1,-1560,0,4009,-1,-6628,-1
			.word 7766,-1,-6628,-1,4009,0,-1560,-1,304,0
			.word -1
			.endif

			.if FIR_BSF20
FIR_BSF20_coeff_ptr	.word -1,0,-258,0,1316,0,-3386,0,5595,0
			.word 26229,0,5595,0,-3386,0,1316,0,-258,0
			.word -1
			.endif 
			
;********************************************************                   
; 10th Order Filter                                     
;********************************************************

			.if FIR_LPF10
FIR_LPF10_coeff_ptr	.word -171,-264,437,3464,7882,10067,7882,3464,437,-264
			.word -171
			.endif	

			.if FIR_HPF10
FIR_HPF10_coeff_ptr  	.word 0,416,812,-2091,-9045,19652,-9045,-2091,812,416
			.word 0
			.endif
 
			.if FIR_BPF10
FIR_BPF10_coeff_ptr	.word 0,1645,-1,-8264,-1,12949,-1,-8264,-1,1645
			.word 0
			.endif     

			.if FIR_BSF10
FIR_BSF10_coeff_ptr	.word 0,-829,0,4163,0,26098,0,4163,0,-829
			.word 0
			.endif

                          
            .label coeff_LOAD_end_adr

⌨️ 快捷键说明

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