{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Ch10-Audio Processing Problems and Solutions

# Ch10-Audio Processing Problems and Solutions -...

This preview shows pages 1–11. Sign up to view the full content.

Microcomputer Systems 1 Audio Processing Problems  and Solutions

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

View Full Document
Audio Processing Problems and  Solutions
Automatic Gain/Volume Control

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

View Full Document
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.
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 Reset based on some criteria myMax Gain factor

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

View Full Document
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); }
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

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

View Full Document
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 - - + = = + + + = < = = =
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

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

View Full Document
2/11/12 Veton K ë puska 10 Amplitude Panning of Signals to Left  or Right Stereo Field u In many applications, the DSP may need to process two (or  more) channels of incoming data, typically from a stereo A/D  converter.  u Two-channel recording and playback is still the dominant
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 145

Ch10-Audio Processing Problems and Solutions -...

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

View Full Document
Ask a homework question - tutors are online