Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
The purposes of this lab are learn to process audio data in ADSP-BF533
EZ-Kit Lite based on Lab3 with an Infinite Impulse Response filters function
as well as learn the process of implement digital iir filter in DSP, and finally we
apply and control the audio input/output with all the process.
2) Equipment Used
3) Procedure
First, we started with this project from Lab 3, and instead of using Matlab
calculation we used coefficients for LP filter and HP filter as given by instructor. And
adjust the coefficient to get right input/output function for all. In most case we had
worked with Process_data part.
#include "Talkthrough.h"
//Low Pass Filter IIR coeficients A and B arrays
float B0[5] = {0.2467697561, 1, 0.5122942924,1,1};
float B1[5] = {0, -0.8766128421, 0, 0.7790518402,1};
float B2[5] = {0, 1, 0, 1, 0};
float A0[5] = {1, 1, 1, 1, 1};
float A1[5] = {0, -1.07370162, 0, -0.4791774154, 0};
float A2[5] = {0, 0.6737909913, 0, 0.1368679255, 0};
//Low Pass Filter IIR Delays and output variable arrays
float de0[3]= {0,0,0};
float de1[3]= {0,0,0};
float de2[3]= {0,0,0};
//------------------------------------------------------------------------------------------------------------------//
// Function: Process_Data()
//
//
//
// Description: This function is called from inside the SPORT0 ISR every
//
//
//
//
//
//
//
//
//
//
//
//
iChannel2RightOut
//
//
respectively.
//
//------------------------------------------------------------------------------------------------------------------//
void Process_Data(void)
{
iChannel0LeftOut = iChannel0LeftIn;
iChannel0RightOut = iChannel0RightIn;
iChannel1LeftOut = iChannel1LeftIn;
iChannel1RightOut = iChannel1RightIn;
}
//Low pass filter
void lowpassfilter(void)
{
float input = (float)(iChannel0LeftIn <<8);
int m;
for (m=0; m<=2; m++)
{
de0[m] = input - (A2[m]*de2[m]) - (A1[m]*de1[m]);
input = (B2[m]*de2[m]) + (B1[m]*de1[m]) + (B0[m]*de0[m]);
de2[m] = de1[m];
de1[m] = de0[m];
}
iChannel0LeftOut= ((int)input) >>8;
}
//High pass filter IIR function
void highpassfilter(void)
{
float HighPassx = (float)(iChannel0RightIn <<8);
int m;
for(m=0; m<=2; m++)
{
hpd0[m] = HighPassx - (hpA1[m] * hpd1[m]) - (hpA2[m] * hpd2[m]);
5) Discussion
While we perform this experiment we had a difficulty to adjust a LP/HP filter
since we did not get right output. And finally we decided to use three coefficients
instead of using five. Through this experiment it was a helpful to understand the
function of input / output most of all as well as learned about filtering.