Presentation is loading. Please wait.

Presentation is loading. Please wait.

Digitalized Surround Sound Effects Using ADSP BF 533 Kunal Gupta ECE 3551, 03 Fall, 2006.

Similar presentations


Presentation on theme: "Digitalized Surround Sound Effects Using ADSP BF 533 Kunal Gupta ECE 3551, 03 Fall, 2006."— Presentation transcript:

1 Digitalized Surround Sound Effects Using ADSP BF 533 Kunal Gupta ECE 3551, 03 Fall, 2006

2 Objective Create different surround sound effects Methods –Research existing algorithms –Think on new ideas and create them

3 Requirements At starting all LEDS are off and sound is played as it comes. This shall be considered as start state of the system. On the first press of button on BF 533 EZ KIT board with label SW 4 for PF 8 the LED 4 will be lit on and input source is played to two speakers – speaker 1 and speaker 2. The sound shall be played same by speakers to the user. The algorithm for implementation will use inefficient. On the second press of button on BF 533 EZ KIT board with label SW 4 for PF 8 the LED 4 will continue to be lit and input source sound will be processed so the left speaker plays the input sound before the right speaker. The algorithm for implementation will use inefficient use of memory move. On the third press of button on BF 533 EZ KIT board with label SW 4 for PF 8 the LED 4 will continue to be lit and input source sound will be processed so the right speaker plays the input sound before the left speaker. The algorithm for implementation will use inefficient use of memory move. On the forth press of button on BF 533 EZ KIT board with label SW 4 for PF 8 the LED 4 will be lit off and system shall return to its start state. On the first press of button on BF 533 EZ KIT board with label SW 5 for PF 9 the LED 5 will be lit on and input source is played to two speakers – speaker 1 and speaker 2. The sound shall be played same by speakers to the user. The algorithm for implementation will use more efficient implementation of circular buffer through use of moving pointers

4 Requirements On the second press of button on BF 533 EZ KIT board with label SW 5 for PF 9 the LED 5 will continue to be lit and input source sound will be processed so the left speaker plays the input sound before the right speaker. The algorithm for implementation will use more efficient implementation of circular buffer through use of moving pointers. On the third press of button on BF 533 EZ KIT board with label SW 5 for PF 9 the LED 5 will continue to be lit and input source sound will be processed so the right speaker plays the input sound before the left speaker. The algorithm for implementation will use more efficient implementation of circular buffer through use of moving pointers. On the forth press of button on BF 533 EZ KIT board with label SW 5 for PF 9 the LED 5 will be lit off and system shall return to its start state. On the first press of button on BF 533 EZ KIT board with label SW 6 for PF 10 the LED 6 will be lit on and input source is played to four speakers – speaker 1, speaker 2, speaker 3 and speaker 4. The sound shall be processed with some surround sound effect. On the second press of button on BF 533 EZ KIT board with label SW 6 for PF 10 the LED 6 will be lit off and system shall return to its start state. On the first press of button on BF 533 EZ KIT board with label SW 7 for PF 11 the LED 7 will be lit on and input source is played to four speakers – speaker 1, speaker 2, speaker 3 and speaker 4. The sound shall be processed with some surround sound effect. This effect should differ from the effect created on requirement number 10. On the second press of button on BF 533 EZ KIT board with label SW 7 for PF 11 the LED 7 will be lit off and system shall return to its start state.

5 Interrupts - SIC_IAR1 1111111111111111 Ref: [HwrMan, 4-32] Check for all fff in the code value DMA 1 (SPORT 0 RX) Interrupt 1111111100101111

6 Interrupts - SIC_IAR2 1111111111111111 PF A Interrupt 0101111111110100 Timer 0 Interrupt The relative priority of peripheral interrupts can be set by mapping the peripheral interrupt to the appropriate general- purpose interrupt level in the core. The mapping is controlled by the System Interrupt Assignment register settings [4-32]

7 Interrupts - SIC_IMASK 0000000000001001 0000001000000000 Timer 0 Interrupt PF Interrupt A DMA1 Interrupt (SPORT0 RX) The System Interrupt Mask register allows masking of any peripheral interrupt source at the System Interrupt Controller (SIC), independently of whether it is enabled at the peripheral itself. Ref: [5, 4-29]

8 FIFO Stacks Implementation “If the FIFO stacks are of the sample length, then there will be no relative time delay when the mono sound source is played to both ears. This means that the sound will appear, to the listener, to be coming from the centre of the head.” [1] “If the left FIFO stack is shorter than the right stack, a given sound sample will leave the left stack before it leaves the right stack. This means that any given sound sample will arrive at the left ear before it arrives at the right ear. The sound will appear, to the listener, to be coming from closer to the left ear. Similarly, the sound will appear to come from near the right ear if the right FIFO stack is shorter than the left stack.” [1]

9 FIFO Stacks – Same length LEFT FIFO Stack (Delay line for left speaker) Right FIFO Stack (Delay line for right speaker) No Relative Time Delay

10 Memory Move if(pf8Counter == 1) // as if the sound source is to left { iChannel0LeftIn = iRxBuffer1[INTERNAL_ADC_L0]; // Insert new value into the back of the FIFO delay line left0DelayLine[LEFT_DELAY_LENGTH] = iChannel0LeftIn >> 8; right0DelayLine[RIGHT_DELAY_LENGTH] = iChannel0LeftIn >> 8; // Update the Left FIFO delay line using inefficient memory to memory moves for (count = 0; count < LEFT_DELAY_LENGTH; count++) left0DelayLine[count] = left0DelayLine[count + 1]; // Update the Right FIFO delay line using inefficient memory to memory moves for (count = 0; count < RIGHT_DELAY_LENGTH; count++) right0DelayLine[count] = right0DelayLine[count + 1]; // converting values from 16 bits to 24 bits iTxBuffer1[INTERNAL_DAC_L0] = left0DelayLine[0] << 8; iTxBuffer1[INTERNAL_DAC_R0] = right0DelayLine[0] << 8; }

11 Pointer movement if(pf9Counter == 1) // as if the sound source is to left { iChannel0LeftIn = iRxBuffer1[INTERNAL_ADC_L0]; // converting values from 24 bits to 16 bits left0DelayLine [left0Ptr] = (iChannel0LeftIn >> 8); right0DelayLine[right0Ptr] = (iChannel0LeftIn >> 8); // incrementing the pointers on the delay lines left0Ptr++; right0Ptr++; // converting values from 16 bits to 24 bits iTxBuffer1[INTERNAL_DAC_L0] = (left0DelayLine[FIFO_LENGTH - 1] << 8); iTxBuffer1[INTERNAL_DAC_R0] = (right0DelayLine[FIFO_LENGTH - 1 ] << 8); // maintaining the circular movement of pointers on the delay lines left0Ptr %= FIFO_LENGTH; right0Ptr %= FIFO_LENGTH; }

12 FIFO Stacks – Varying length LEFT FIFO Stack (Delay line for left speaker) Right FIFO Stack (Delay line for right speaker) Left Speaker will play the sound before right speaker plays it, same applies vice-versa.

13 Memory Move if(pf8Counter == 2) // as if the sound source is to left { iChannel0LeftIn = iRxBuffer1[INTERNAL_ADC_L0]; // Insert new value into the back of the FIFO delay line left0DelayLine[LEFT_DELAY_LENGTH] = iChannel0LeftIn >> 8; right0DelayLine[FIFO_LENGTH - 1] = iChannel0LeftIn >> 8; // Update the FIFO delay line using inefficient memory to memory moves for (count = 0; count < LEFT_DELAY_LENGTH; count++) left0DelayLine[count] = left0DelayLine[count + 1]; for (count = 0; count < FIFO_LENGTH; count++) right0DelayLine[count] = right0DelayLine[count + 1]; // converting values from 16 bits to 24 bits iTxBuffer1[INTERNAL_DAC_L0] = left0DelayLine[0] << 8; iTxBuffer1[INTERNAL_DAC_R0] = right0DelayLine[0] << 8; }

14 Pointer Movement if(pf9Counter == 2) // as if the sound source is to left { iChannel0LeftIn = iRxBuffer1[INTERNAL_ADC_L0]; // converting values from 24 bits to 16 bits storage type left0DelayLine [left0Ptr] = (iChannel0LeftIn >> 8); right0DelayLine[right0Ptr] = (iChannel0LeftIn >> 8); // incrementing the pointers on the delay lines left0Ptr++; right0Ptr++; // converting values from 16 bits to 24 bits storage type iTxBuffer1[INTERNAL_DAC_L0] = (left0DelayLine[LEFT_DELAY_LENGTH - 1] << 8); iTxBuffer1[INTERNAL_DAC_R0] = (right0DelayLine[FIFO_LENGTH - 1 ] << 8); // maintaining the circular movement of pointers on the delay lines left0Ptr %= LEFT_DELAY_LENGTH; right0Ptr %= FIFO_LENGTH; }

15 Surround sound 1effect 4 Speaker implementation Sampling rate 48K Hz. Delay between for each speaker set to 0.1 seconds. To save space – using short data type Buffer size Needed 48 * 0.1 * 2 * (Number of delay frames) * (K bytes) 48 * 0.1 * 2 * 3 * 1000 = 28,800 bytes Short type buffer array size = 14,400

16 Surround Sound 1 effect 13399 …… 9599 ……… 3399 ………0 4800 Speaker 0Speaker 1Speaker 2Speaker 3

17 Surround sound 2effect Timer 0 switches the control between 4 speakers With each switch of speaker control its status to maintaining the delay changes.

18 References [1] M. Smith, “Lab. 2 – High Level Language DSP Algorithm Audio Project, “ October 28, 2003, http://www2.enel.ucalgary.ca/People/Smith/ECE-ADI- Project/AudioProject/AudioBlackfin_HighLevelDSPAlgorithms/HighLevelDS PFrame.htm. http://www2.enel.ucalgary.ca/People/Smith/ECE-ADI- Project/AudioProject/AudioBlackfin_HighLevelDSPAlgorithms/HighLevelDS PFrame.htm [2] M. Smith, “Implementing the FIFO stack in ‘C/C++ Version 1,” March 28, 2003, http://www2.enel.ucalgary.ca/People/Smith/ECE-ADI- Project/AudioProject/AudioSHARC_HighLevelDSPAlgorithms/FIFO_V1.com mon.htm.http://www2.enel.ucalgary.ca/People/Smith/ECE-ADI- Project/AudioProject/AudioSHARC_HighLevelDSPAlgorithms/FIFO_V1.com mon.htm [3]M. Smith, “Implementing the FIFO stack in ‘C/C++ Version 2,” May 9, 2003, http://www2.enel.ucalgary.ca/People/Smith/ECE-ADI- Project/AudioProject/AudioSHARC_HighLevelDSPAlgorithms/FIFO_V2.com mon.htmhttp://www2.enel.ucalgary.ca/People/Smith/ECE-ADI- Project/AudioProject/AudioSHARC_HighLevelDSPAlgorithms/FIFO_V2.com mon.htm [4] A. Martin, “Spurce Files and Demonstration Executables,” Nov 16, 2004 http://www2.enel.ucalgary.ca/People/Smith/ECE-ADI- Project/AudioProject/AudioSHARC_HighLevelDSPAlgorithms/FilesNeeded. common.htmhttp://www2.enel.ucalgary.ca/People/Smith/ECE-ADI- Project/AudioProject/AudioSHARC_HighLevelDSPAlgorithms/FilesNeeded. common.htm [5]“ADSP BF 533 Blackfin Processor Hardware Reference, “ July, 2006, Rev 3.2

19 Demonstration


Download ppt "Digitalized Surround Sound Effects Using ADSP BF 533 Kunal Gupta ECE 3551, 03 Fall, 2006."

Similar presentations


Ads by Google