Digital Signal Processing Reference
In-Depth Information
x[0] ¼ lc;
d[0] ¼ rc; /*Unknown system output*/
// Adaptive filter
y[0] ¼ 0;
for(i ¼ 0;i<40; i þþ )
{ y[0] ¼ y[0] þ w[i]*x[i];}
e[0] ¼ d[0]-y[0]; /* Error output */
for(i
¼
0;i<40; i
þþ
)
2*mu*e[0]*x[i];} /* LMS algorithm */
// End of the DSP algorithm
lcnew
{ w[i]
¼
w[i]
þ
¼
y[0]; /* Send the tracked output */
rcnew
e[0]; /* Send the error signal*/
AIC23_data.channel[LEFT]
¼
(short) lcnew;
AIC23_data.channel[RIGHT] ¼ (short) rcnew;
output_sample(AIC23_data.combo);
¼
}
Figure 10.24A shows an example of a tonal noise reduction system, and Figure 10.24B shows the
details of the adaptive noise cancellation. The first DSP board is used to create the real-time corrupted
signal, which is obtained by mixing the mono audio source (Left Line In [LCI1]) from any audio
device and the tonal noise (Right Line In [RCI1]) generated from a function generator. The output
(Left line Out [LCO1]) is the corrupted signal, which is fed to the second DSP board for noise
cancellation application. The adaptive FIR filter in the second DSP board uses the reference input
(Right Line In [RCI2]) to generate the output, which is used to cancel the tonal noise embedded in the
corrupted signal (Left Line In [LCI2]). The output (Left Line Out [LCO2]) produces the clean mono
audio signal (Jiang and Tan, 2012). Program 10.6 details the implementation.
Program 10.6. Program segments for noise cancellation.
(a) Program segment for DSK 1 (generation of the corrupted signal).
float x[1] ¼ {0.0}; /* Tonal reference noise */
Float s[1]
¼
{0,0}; /* Audio signal */
float d[1]
¼
{0.0}; /* Corrupted signal*/
S
i
g
n
a
l
a
n
d
n
o
i
s
e
E
r
r
o
r
s
i
g
n
a
l
~ ()
dn
()
sn
()
nn
()
en
()
d n
()
yn
()
s n
ADC
DAC
y ()
x ()
ADC
Adaptive filter
Noise
LMS algorithm
FIGURE 10.24A
Block diagram for tonal noise cancellation.
 
Search WWH ::




Custom Search