Upload
valentine-kelley
View
213
Download
0
Embed Size (px)
DESCRIPTION
PROCESS DATA.C FOR THE CODE void reverberation_effect_volume_gain(void) { delay = temp - 400; // delay of 500 samples. If we increase the number of samples the reverberation effect tend towards the echo effect. if(delay < 0) { delay = delay ; // keeping the delay constant. If the value of temp is 0 then the delayed sample if 2500th sample in the array. } input1 = iChannel0LeftIn>>8; // bit shifting the input sample by 8 bits to make it compatible with short data type. input2 = iChannel0RightIn>>8; // same as above buffer_out1[temp] = input *buffer_out1[delay]; // equation for the implementation of reverberation sound effect. buffer_out2[temp] = input *buffer_out2[delay]; // equation for the implementation of reverberation sound effect. vol1 = buffer_out1[temp]
Citation preview
ECE 3551 – Microcomputer Systems I
By Md. Raqiq Islam
AUDIO EFFECTS IMPLEMENTATION
OVERVIEW• This project was created to use the Blackfin BF533 DSP to control audio output.The
following features were included:
• Audio effect Reverberation
• Audio effect Chorus
• Audio effect Echo
• Volume control
• Using SD RAM to store audio and play
PROCESS DATA.C FOR THE CODE• void reverberation_effect_volume_gain(void)
• {
•
• delay = temp - 400; // delay of 500 samples. If we increase the number of samples the reverberation effect tend towards the echo effect.
•
• if(delay < 0)
• {
• delay = delay + 3000; // keeping the delay constant. If the value of temp is 0 then the delayed sample if 2500th sample in the array.
• }
•
• input1 = iChannel0LeftIn>>8; // bit shifting the input sample by 8 bits to make it compatible with short data type.
•
• input2 = iChannel0RightIn>>8; // same as above
•
• buffer_out1[temp] = input1 + 0.6*buffer_out1[delay]; // equation for the implementation of reverberation sound effect.
•
• buffer_out2[temp] = input2 + 0.6*buffer_out2[delay]; // equation for the implementation of reverberation sound effect.
•
• vol1 = buffer_out1[temp]<<16;
• vol2 = buffer_out2[temp]<<16;
• vol1_temp = vol1 + vol1*(.8)*(PF9_counter); // bit shifting the output 8 bits to the left to play 24 bit audio out.
•
• vol2_temp = vol2 + vol2*(.8)*(PF9_counter); // bit shifting the output 8 bits to the left to play 24 bit audio out.
•
• iChannel0LeftOut = vol1_temp>>8;
•
• iChannel0RightOut = vol2_temp>>8;
•
• temp++;
•
• temp = temp%3000; // circular buffering to set the value of temp back to 0 if it exceeds 3000 or the array limit.
• }
• void SDRAM_store(void)
• {
• if(pSDRAM_var1 <= pSDRAM_end_address)
• {
• *pSDRAM_var1 = iChannel0LeftIn; // storing the input samples to the memory banks in SDRAM
•
• *pSDRAM_var1 = iChannel0RightIn;
•
• iChannel0LeftOut = iChannel0LeftIn;
•
• iChannel0RightOut = iChannel0RightIn;
•
• pSDRAM_var1++; // incrementing the position of memory bank by 1 place
• }
• }
END