Digital Signal Processing Reference
In-Depth Information
float e[1]
¼
{0.0}; /* Enhanced signal */
float mu
¼
0.000000000004; /*Adaptive filter convergence factor*/
interrupt void c_int11()
{
float lc; /*left channel input */
float rc; /*right channel input */
float lcnew; /*left channel output */
float rcnew; /*right channel output */
int i;
//Left channel and right channel inputs
AIC23_data.combo
¼
input_sample();
lc
¼
(float) (AIC23_data.channel[LEFT]);
(float) (AIC23_data.channel[RIGHT]);
// Insert DSP algorithm below
d[0]
¼
lc; /*Corrupted signal*/
for(i
¼
19;i>0;i--) /*Update the reference noise buffer input buffer*/
{ x[i]
¼
xn[i-1]; }
x[0]
¼
lc;
// Adaptive filter
y[0]
¼
0;
for(i
¼
0;i<20; i
þþ
)
{ y[0]
¼
y[0]
þ
w[i]*x[i];}
e[0]
¼
d[0]-y[0]; /* Enhanced output */
for(i
¼
0;i<20; i
þþ
)
{ w[i]
¼
w[i]
þ
2*mu*e[0]*x[i]; }/* LMS algorithm */
// End of the DSP algorithm
lcnew
¼
e[0]; /* Send to DAC */
rcnew
¼
rc; /* keep the original data */
AIC23_data.channel[LEFT]
¼
(short) lcnew;
AIC23_data.channel[RIGHT]
¼
(short) rcnew;
output_sample(AIC23_data.combo);
rc
¼
}
Many other practical configurations can be implemented similarly.
10.6
SUMMARY
1.
Adaptive filters can be applied to signal-changing environments, spectral overlap between noise
and signal, and unknown, or time-varying, noise.
2.
Wiener filter theory provides optimal weight solutions based on statistics. It involves collection of
a large block of data, calculation of an autocorrelation matrix and a cross-correlation matrix, and
inversion of a large autocorrelation matrix.
3.
The steepest decent algorithm can find the optimal weight solution using an iterative method, so
a large matrix inversion is not needed. But it still requires calculating an autocorrelation matrix
and cross-correlation matrix.
4.
The LMS is a sample-based algorithm, which does not need collection of data or computation of
statistics and does not involve matrix inversion.
Search WWH ::
Custom Search