70 likes | 212 Views
Audio effects implementation . ECE 3551 – Microcomputer Systems I By Abdulrahman Bin Humood. Overview.
E N D
Audio effects implementation ECE 3551 – Microcomputer Systems I By AbdulrahmanBin Humood
Overview • This project was created to use the OMAP L137 Texas Instruments DSP Board to control audio outputand display some audio effects that have been taught during the course of the class.
Code Imlementation • switch(mode) • { • case 1: • Passthrough(pIn, pOut); • break; • case 2: • Process_Data(pIn, pOut); • Delay(pIn, pOut); • break; • case 3: • Process_Data(pIn, pOut); • Vibrato(pIn, pOut); • break; • default: • Passthrough(pIn, pOut); • break; • }
Delay Code • void Delay(short *pIn, short *pOut) //Applies delay effect to signal. • { inti; • for (i = 0; i < BUFLEN; i++) • { • int delay = temp - (2000 - 20); • buffer_in2[temp] = pIn[i * 2]; • buffer_in1[temp] = pIn[i * 2 + 1]; • if ( delay < 0 ) • { • delay = delay + 2000; • } • output1 = buffer_in1[temp] + 0.9 * buffer_in1[delay]; • output2 = buffer_in2[temp] + 0.9 * buffer_in2[delay]; • pOut[i * 2] = (short)output1; • pOut[i * 2 + 1] = (short)output2; • temp++; • temp = temp % 2000; • } • }
Vibrato Code • void Vibrato(short *pIn, short *pOut) • { • inti; • for (i = 0; i < BUFLEN; i++) • { • var_time_delay = (int)(0.5 * (1 + cos (2 * 3.14 * 0.4 * temp / 2000)) * BUFSIZE); • var_delay = temp - var_time_delay; • buffer_in1[temp] = pIn[i * 2 + 1]; • buffer_in2[temp] = pIn[i * 2]; • if (var_delay < 0) • { • var_delay = var_delay + 2000; • } • output1 = buffer_in1[temp] + 0.6 * (buffer_in1[var_delay]); // implementation equation of vibrato effect • output2 = buffer_in2[temp] + 0.6 * (buffer_in2[var_delay]); // implementation of vibrato effect • pOut[i * 2] = output1; • pOut[i * 2 + 1] = output2; • temp++; • temp = temp % 2000; • }}
END • THANK YOU!