Presentation is loading. Please wait.

Presentation is loading. Please wait.

 By: Stanley O. Abada Presented to: Dr. V Kepuska December 4, 2010 Microcomputer 1.

Similar presentations


Presentation on theme: " By: Stanley O. Abada Presented to: Dr. V Kepuska December 4, 2010 Microcomputer 1."— Presentation transcript:

1  By: Stanley O. Abada Presented to: Dr. V Kepuska December 4, 2010 Microcomputer 1

2  Background Concept of Project  Definition of Functions Used  Detailed Explanation of the Program  Conclusion

3  The sole purpose of this project is to be able to filter out the lyrics in a song and leaving out the instruments  The second purpose is to exhibit few of the sound effects talk about in class.  The sound effects used in this project are the echo and reverberation have very slight differences  Implementation of the push buttons and LEDs which use interrupt handlers when pressed.

4  Echo_Effect(void)  Reverb_Effect(void)  HighPassIIRFilter(void) and LowPassIIRFilter(void)  FilterStop_Band(void) and FilterBand_Pass(void)  Play(void) and Stop(void)

5  void Reverb_Effect(void)  {j=k-200;  if (j<0)  j=3000+j;  buffer_x[k]=(short)(iChannel0LeftIn>>8)+(4*buffer_x[j]/6);  buffer_y[k]=(short)(iChannel0RightIn>>8)+(4*buffer_y[j]/6);  x=(int)buffer_x[k];  y=(int)buffer_y[k];  if(k>=3000-1)  k = 0; elsek++;  (iChannel0LeftOut)=x<<8;  (iChannel0RightOut)=y<<8;  }  // this part defines the funtion Echo_Effect(void)  void Echo_Effect(void)  { static int k=0;  buffer_x[k]=(short)(iChannel0LeftIn>>8)+(4*buffer_x[k]/6);  buffer_y[k]=(short)(iChannel0RightIn>>8)+(4*buffer_y[k]/6);  x=(int)buffer_x[k];  y=(int)buffer_y[k];  if(k>=3000-1)  k = 0;  elsek++;  (iChannel0LeftOut)=x<<8 ;  (iChannel0RightOut)=y<<8;  } These function are some sort similar but have a slightly different effects. Both the echo and reverberation sound effects have same formula but different implementation as shown on the right. In the reverb_effect, the output sound on the left and right channels is gotten by adding a delayed version of the output to the present input of the channels

6  void HighPassIIRfilter(void)  {  int HighPassIIR_output = 0;  int HighPassIIR_input = 0;   HighPassIIR_input = iChannel0LeftIn <<8;  for(k=0; k <7; k++)  {   delayH[k][2] = HighPassIIR_input - (HighPass_num[k][2] * delayH[k][0]) - (HighPass_num[k][1] * delayH[k][1]);   HighPassIIR_output = HighPass_num[k][2] * delayH[k][0] + HighPass_num[k][1] * delayH[k][1] + HighPass_num[k][0] * delayH[k][2];   HighPassIIR_input = HighPassIIR_output;  delayH[k][1] = delayH[k][0];  delayH[k][2] = delayH[k][1];  }   iChannel0LeftOut = (((int)HighPassIIR_output)>>8);  } This part of the code defines an IIR filter implementation. The delay array is first defined and the High pass IIR output is the High pass coefficients multiplied by delayed version of that output for a particular sets of arrays.

7  void FilterStop_Band_2(void)  {   SoundoutputY = 0;  x_input[j] =(iChannel0LeftIn>>8);   for (k=0; k<101; k++)  {  SoundoutputY += Stop_band_2[k] * x_input[(j-k+101)%101];   }   j++;  j = j%101;  iChannel0LeftOut=SoundoutputY >> 8;  iChannel0RightOut=SoundoutputY >> 8;  }  This function is suppose to stop a particular bands of frequency.  This function out the subsequent sound to the output channels by multiplying the array of the stop band coefficients by the input variables ranging from 0 to 101.

8  //System is On  if (pF8 == 1)  {  pf8LED = 0x01; //Indicate System is On and playing  if(pF9 == 0)  {Play();  pf9LED = 0x02;  pf10LED = 0x00;  }  if(pF9 ==1)  {  FilterBand_Pass_1();//Indicates Stop_band_1 function is called  pf9LED = 0x00;  pf10LED = 0x00;  }  if(pF9 == 2)  {  FilterStop_Band_2();//Indicates Stop_band_2 function is called  pf10LED = 0x04;  }  if(pF9 == 3)  {  LowPassIIRfilter(); //Indicates LowPass function is called  pf9LED = 0x01;  pf10LED = 0x00;  }   When pF8 == 1, the system is on and playing the regular un-attenuated audio When pF9 ==1,2, and 3, the different functions on the right care called

9  if(pF9 == 4)  {  HighPassIIRfilter();//Indicates HighPass function is called  pf9LED = 0x06;  pf10LED = 0x00;  }  if(pF10 == 1)  {  Reverb_Effect(); //Indicates Reverb_Effect function is called  pf10LED = 0x08;  }  if (pF10==2)  {  Echo_Effect(); //Indicates Echo_Effect function is called  pf10LED=0x10;  }  //System is Off  if(pF8==0)  {  Stop(); //Indicates Stop function is called  }  *pFlashA_PortB_Data = pf8LED | pf9LED | pf10LED;   } When pF9 == 4, the high pass IIR filter is called and the LEDs are lighted too. When pF10 == 1, reverberation effect function is called When pF10 == 2, the echo effect function is called.

10  The main purpose of the project is to exhibit the concept learned in class and lab  The filtering effect for the band stop and band pass were limited in effect because the scope of this effect is above what we have learned in this class  However, the reverberation and echo effect were successfully implemented. Thanks to Dr. V. Kepuska for a thorough delivery of lectures during the entire semester and his advice in writing my project. I also want to thank my GSA, Xerxes Barry for his endless assistance in making my project a reality.

11 QUESTIONS????


Download ppt " By: Stanley O. Abada Presented to: Dr. V Kepuska December 4, 2010 Microcomputer 1."

Similar presentations


Ads by Google