| Purpose |
| Block filtering and coefficient update in frequency domain using the Block Frequency Domain Adaptive Filter (BFDAF) algorithm. |
| Syntax |
[W,x,y,e,Px,w]=asptbfdaf(M,x,xn,dn,W,mu,n,c,b,Px)
|
| Description |
asptbfdaf() is an efficient frequency domain implementation of the block NLMS algorithm.
asptbfdaf() performs filtering and coefficient update in frequency domain using the
overlap-save method, and therefore provide efficient implementation for long adaptive filters usually
used in applications such as acoustic echo cancelers where the adaptive filter can be as long as
a few thousand coefficients. asptbfdaf() is a block processing algorithm which is called every
asptbfdaf() which are
summarized below.
|
Input Parameters [Size]:: M : filter length [1 x 1] x : previous overlap-save input vector [B x 1] xn : new input block [L x 1] dn : new desired block [L x 1] W : F-domain filter coefficients vector [B x 1] mu : adaptation constant (step size) [1 x 1] n : if not 0, normalization is performed c : if not 0, constrains filter to length M b : forgetting factor for estimation of Px Px : previous estimate of the power of x [B x 1] Output parameters:: W : updated F-domain filter coefficients x : updated overlap save input vector y : filter output at block n (t-domain) e : error vector (t-domain) Px : updated estimate of the power of X |
| Example |
iter = 5000; % Number of samples to process % Complex unknown impulse response h = [.9 + i*.4; 0.7+ i*.2; .5; .3+i*.1; .1]; xt = 2*(rand(iter,1)-0.5); % Input signal % although xn is real, dn will be complex dt = osfilter(h,xt); % Unknown filter output en = zeros(iter,1); % estimation error % Initialize BFDAF with a filter of 5 coef. M = 5; L = 3; [W,x,dn,e,y,Px,w]=init_bfdaf(L,M); %% Processing Loop for (m=1:L:iter-L) xn = xt(m:m+L-1,:); % input block dn = dt(m:m+L-1,:)+ 1e-3*rand; % desired block % call BFDAF to calculate the filter output, % estimation error and update the filter coef. [W,x,y,e,Px,w]=asptbfdaf(M,x,xn,dn,W,0.05,1,1,0.98,Px); % save the last error block to plot later en(m:m+L-1,:) = e; end; % display the results subplot(2,2,1);stem([real(w) imag((w))]); grid; subplot(2,2,2); eb = filter(.1,[1 -.9], en(1:m) .* conj(en(1:m))); plot(10*log10(eb ));grid |
Running the above script will produce the graph shown in Fig. 4.3. The left side graph
of the figure shows the adaptive filter coefficients after convergence which are almost identical
to the unknown filter h. The right side graph shows the mean square error in dB versus time during the
adaptation process, which is usually called the learning curve. The lower limit of the error signal
power in the learning curve is defined here by the additive white noise added at the filter output
(-60 dB).
|
| Algorithm |
asptbfdaf() performs the following operations (see Fig. 4.2).
|
| Remarks |
|
| Resources |
The resources required for direct implement of the BFDAF algorithm in real time is given in the table below. The computations given are those required to process L samples using the constrained BFDAF. Unconstrained BFDAF uses two FFT operations less than the constrained BFDAF. In the table below
|
| See Also |
| INIT_ BFDAF, ECHO_ BFDAF, ASPTPBFDAF, ASPTRCPBFDAF. |
| Reference |
| [3], Chapter 3 for detailed description of BFDAF, [8] for the overlap-save method, and [9] for frequency domain adaptive filters. |