This experiment uses the Blackfi n BF533/BF537 EZ-KIT to run a simple FIR fi lter on stereo channe

源代码在线查看: main.c

软件大小: 100 K
上传用户: scorpioll
关键词: experiment Blackfi EZ-KIT channe
下载地址: 免注册下载 普通下载 VIP

相关代码

				///////////////////////////////////////////////////////////////////////////////
				//
				// 	
				//  Experiment 6.11_BF537 Implement FIR filter using BF537 EZ-KIT
				//  FILE name: main.c
				//
				//  Description: Perform real-time FIR filtering on stereo signals.
				//		 The incoming audio data on left and right channel is fed
				//		 into a set of FIR filters that filter the individual  	
				//		 channels. The coefficients are pre-determined in MATLAB.
				//
				//  Mode of operation
				//  	  SW10	: to switch to talkthrough mode
				// 	  	  SW11	: to switch to FIR filtering mode
				//	Note: reduce input volume to prevent clipping of signal.
				//  
				//  For the book "Embedded Signal Processing with the Micro Signal Architecture"
				//		  By Woon-Seng Gan and Sen M. Kuo
				//		  Publisher: John Wiley and Sons, Inc.
				//
				//  Tools used: VisualDSP++ v4.0 (running on BF537 EZ-KIT)
				//
				///////////////////////////////////////////////////////////////////////////////
				
				
				
				#include "fir.h"
				
				// SPORT0 DMA transmit buffer
				section("L1_data_a") int iTxBuffer1[2*IP_SIZE*FRAME_SIZE];
				// SPORT0 DMA receive buffer
				section("L1_data_a") int iRxBuffer1[2*IP_SIZE*FRAME_SIZE];
				
				// left and right input data from ad1836
				section("L1_data_a") short sCh0LeftIn[IP_SIZE];
				section("L1_data_a") short sCh0RightIn[IP_SIZE];
				// left and right output data to ad1836
				section("L1_data_a") short sCh0LeftOut[IP_SIZE];
				section("L1_data_a") short sCh0RightOut[IP_SIZE];
				
				int pushbt_flag;
				int cycleCount;
				unsigned char ucLED;
				
				fir_state_fr16	state1;	// declare filter state
				fir_state_fr16	state2;
				
				fract16 lpf[TAPS] = {
					#include "coef32.dat"
				};
				
				fract16 ldelay[TAPS]={0};
				fract16 rdelay[TAPS]={0};
				
				//--------------------------------------------------------------------------//
				// Function:	main														//
				//																			//
				// Description:	After calling a few initalization routines, main() just 	//
				//				waits in a loop forever.  The code to process the incoming  //
				//				data can be placed in the function Process_Data() in the 	//
				//				file "Process_Data.c".										//
				//--------------------------------------------------------------------------//
				void main(void)
				{
					pushbt_flag = 0;
					ucLED = 0x01;
					
					Init_Flags();
					Audio_Reset();
					Init_Sport0();
					Init_DMA();
					Init_PF();
					Init_Timer();
					Init_Interrupts();
					Init_Filter();
					Enable_DMA_Sport0();
				
					while(1);
				}
							

相关资源