虫虫首页|资源下载|资源专辑|精品软件|心愿单
m 登录|注册

《基于TI DSP的通用算法实现》程序代码

源代码在线查看: example 4-4.asm

软件大小: 223.37K 下载次数: 2
上传用户: yueyan51
关键词: DSP 算法 程序 代码
下载地址: 电信下载 网通下载 移动下载 联通下载 VIP VIP

相关代码

					
					;Example 4 - 4. Biquad IIR Filter ASM Listing for the TMS320C54x DSP
						
					
						.sect ”iir”
					iir_task:
						STM	  #K_FRAME_SIZE–1, BRC 		; Perform filtering for xx samples
						RPTB iir_filter_loop–1
						LD	  *INBUF_P+, 8, A 			; load the input value
					iir_filter:
						STM   #d_iir_d+5, IIR_DATA_P 	;AR5 -> d(n),d(n–1),d(n–2)
						STM   #iir_coff_table, IIR_COFF_P 
												;AR4 -> coeff of IIR filter A2,A1,B2,B1,B0
						STM   #K_BIQUAD–1, IIR_INDEX_P
					feedback_path:
						MAC   *IIR_COFF_P+, *IIR_DATA_P–,A ;input+d(n–2)*A2
						MAC   *IIR_COFF_P, *IIR_DATA_P,A 	;input+d(n–2)*A2+d(n–1)*A1/2
						MAC   *IIR_COFF_P+, *IIR_DATA_P–,A ; A = A+d(n–1)*A1/2
						STH   A, *IIR_DATA_P+ 			;d(n) = input+d(n–2)*A2+d(n–1)*A1
						MAR   *IIR_DATA_P+
					forward_path:
						MPY	  *IIR_COFF_P+,*IIR_DATA_P–,A 	;d(n–2)*B2
						MAC	  *IIR_COFF_P+,*IIR_DATA_P,A 	;d(n–2)*B2+d(n–1)*B1
						DELAY *IIR_DATA_P– 					;d(n–2)=d(n–1)
					eloop:
						BANZD feedback_path, *IIR_INDEX_P–
						MAC	  *IIR_COFF_P+, *IIR_DATA_P,A 	;d(n–2)*B2+d(n–1)*B1+d(n)*B0
						DELAY *IIR_DATA_P– 					;d(n–1)=d(n)
						STH	  A, d_iir_y 				;output=d(n–2)*B2+d(n–1)*B1+d(n)*B0
						LD	  d_iir_y, 2, A 					; scale the output
						STL	  A, *OUTBUF_P+ 					; replace the oldest bffr value
					iir_filter_loop
						.end
					
					
									

相关资源