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

📄 fir.h

📁 This experiment uses the Blackfi n BF533/BF537 EZ-KIT to run a simple FIR fi lter on stereo channe
💻 H
字号:
///////////////////////////////////////////////////////////////////////////////
//
// 	
//  Experiment 6.11_BF537 implements FIR filtering using BF537 EZ-KIT
//  FILE name: fir.h
//
//  Description: Perform real-time FIR filtering on stero input signals.
//		 Header file to perform necessary variable declaration
//  
//  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)
//
///////////////////////////////////////////////////////////////////////////////

#ifndef  __EQUALIZER_DEFINED
	#define __EQUALIZER_DEFINED


//--------------------------------------------------------------------------//
// Header files																//
//--------------------------------------------------------------------------//
#include <sys\exception.h>
#include <cdefBF537.h>
#include <fract.h>
#include <filter.h>
#include <sysreg.h>
#include <ccblkfn.h>
//--------------------------------------------------------------------------//
// Symbolic constants														//
//--------------------------------------------------------------------------//
// names for registers in AD1854/AD187 converters
#define INTERNAL_ADC_L0			0
#define INTERNAL_ADC_R0			1
#define INTERNAL_DAC_L0			0
#define INTERNAL_DAC_R0			1


#define delay 0xf00

// SPORT0 word length
#define SLEN_24	0x0017

// DMA flow mode
#define FLOW_1					0x1000


//--------------------------------------------------------------------------//
// Global variables															//
//--------------------------------------------------------------------------//

// number of input frames of samples
#define FRAME_SIZE				2

// number of input samples per channel 
#define IP_SIZE					32

// number of filter taps declaration
#define	TAPS					32

extern short sCh0LeftIn[];
extern short sCh0RightIn[];
extern short sCh0LeftOut[];;
extern short sCh0RightOut[];

extern int iRxBuffer1[];
extern int iTxBuffer1[];

extern int pushbt_flag;
extern int cycleCount;
extern unsigned char ucLED;

extern fir_state_fr16 state1;
extern fir_state_fr16 state2;
extern fract16 lpf[];
extern fract16 ldelay[];
extern fract16 rdelay[];

//--------------------------------------------------------------------------//
// Prototypes																//
//--------------------------------------------------------------------------//
// in file Initialize.c
void Init_Flags(void);
void Audio_Reset(void);
void Init_Sport0(void);
void Init_DMA(void);
void Init_Timer(void);
void Init_Interrupts(void);
void Init_PF(void);
void Init_Filter(void);
void Enable_DMA_Sport0(void);

// in file Process_data.c
void Process_Data(void);

void firc(const fract16 in[], fract16 out[], fir_state_fr16 state);

// in file ISRs.c
EX_INTERRUPT_HANDLER(Sport0_RX_ISR);
EX_INTERRUPT_HANDLER(Switch_ISR);
EX_INTERRUPT_HANDLER(Timer_ISR);

#endif

⌨️ 快捷键说明

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