Ch10-Audio Processing Problems and Solutions

Ch10-Audio Processing Problems and Solutions -...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Microcomputer Systems 1 Audio Processing Problems  and Solutions
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Audio Processing Problems and  Solutions
Background image of page 2
Automatic Gain/Volume Control
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2/11/12 Veton Këpuska 4 Automatic Gain/Volume Control u One of the simplest operations that can be performed in a DSP  on an audio signal is volume gain and attenuation control.   u For fixedpoint math, this operation can be performed by  n multiplying each incoming sample by a fractional 16 bit value  number between 0x0000…. and 0x7FFF…. or  n using a shifter to multiply or divide the sample by a power of  2.   u When increasing the gain of a signal, the programmer must be  aware of overflow, underflow, saturation, and quantization noise  effects.
Background image of page 4
2/11/12 Veton Këpuska 5 Estimation of the Energy of the Signal u Algorithm: n Keep track of the maximum energy of the input signal. if (abs(in_sample) > myMax) { myMax = abs(sample); } n Ajust the Gain to cover 80% of the overall dynamic range of the output. new_target_gain = 0.8*MAX_RANGE/myMax; n Compute actual gain factor based on some empirically defined function that  performs necessary smoothing based on desired responsiveness and  smoothness of the gain. gain = compute_gain(gain, new_target_gain); n Apply Gain: out_sample = gain*in_sample; n
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2/11/12 Veton Këpuska 6 Gain Update Function float compute_gain(gain, new_gain) { // Linear interpolation float g, alpha = 0.2; // computed gain will adjust gain // each time is called by 20% toward // target gain g = (1-alpha)*gain + alpha*new_gain; return (g); }
Background image of page 6
2/11/12 Veton Këpuska 7 Efficient Moving Average [ ] ( 29 [ ] ( 29 [ ] [ ] [ ] [ ] ( 29 [ ] ( 29 [ ] [ ] [ ] ( 29 [ ] ( 29 [ ] ( 29 [ ] [ ] [ ] ( 29 [ ] ( 29 [ ] ( 29 [ ] [ ] [ ] [ ] [ ] [ ] [ ] N N n x N n x x x N N n x N n x x x N n x N n x N N n x N N n x N N n x x N n x n x N n x N n x N n x x N n x N n x N N n x N N n x N N n x x N n x n x N n x N n x N n x x old aver new aver old aver new aver new aver new aver old aver old aver - - + = - - = - + - + + - - + - - + - - = + - + + - - + - - + - - = - + - + + - - + - - + - = - + - + + - - + - - + - = _ _ _ _ _ _ _ _ 1 ... 3 2 1 1 ... 3 2 1 1 2 ... 2 1 1 2 ... 2 1
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2/11/12 Veton Këpuska 8 Moving Average u Note that the algorithm needs to use slightly modified  implementation of initialization routine for samples less  than the number of averaging samples N (i.e., 64). [ ] ( 29 [ ] } ] [ { } ; ; 1 ] [ 1 { ; 0 ; 1 _ _ _ _ _ _ _ N N n x N n x x x else x x count count x x count count x N count If x x count old aver new aver new aver old aver old aver new aver old aver - - + = = + + + = < = = =
Background image of page 8
Amplitude Panning of Signals to Left  or Right Stereo Field Reference: Using The Low Cost, High Performance ADSP-21065L Digital Signal Processor For Digital Audio Applications Dan Ledger and John Tomarakos DSP Applications Group, Analog Devices, Norwood, MA 02062, USA
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/10/2012 for the course ECE 3551 taught by Professor Staff during the Spring '11 term at FIT.

Page1 / 145

Ch10-Audio Processing Problems and Solutions -...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online