| Purpose |
| Simulation of an acoustic echo canceler application using a transversal adaptive filter updated according to the Reduced Complexity Partitioned Block Frequency Domain Adaptive Filter (RCPBFDAF). |
| Syntax |
echo_rcpbfdaf
|
| Description |
The block diagram of the acoustic echo cancellation problem is shown in
Fig. 10.35. The simulation considered here uses a transversal FIR
filter for the adjustable filter and the coefficients of the filter are updated
in the frequency domain using the RCPBFDAF algorithm. The filter is divided
into init_rcpbfdaf(),
and the input signals are read from files, then a processing loop is started.
In each iteration of the loop asptrcpbfdaf() is called with a new block of
samples from the FES and a new block of samples from the NES signals to calculate
the filter output block (estimated echo) and update the filter coefficients.
The residual signal
|
| Code |
clear all; infile = '.\wavin\aecfes.wav'; % Far-end speech (FES) dfile = '.\wavin\aecnes.wav'; % Near-end speech (NES) rfile = '.\wavout\resrcpbfdaf.wav'; % residual signal P = 8; % number of partitions M = 64; % adaptive filter length L = M/2; % block length mu = 0.04/L; % adaptation constant b = 0.99; % autoregressive pole [W,x,d,e,y,Px,X,ci,w]=init_rcpbfdaf(L,M,P); % Init RCPBFDAF [xt,inFs,inBits] = wavread(infile); % read FES [dt,inFs,dBits] = wavread(dfile); % read NES inSize = max(length(xt),length(dt)); % Samples to process res = dt; % Residual array E = init_ipwin(inSize); % Initialize IPWIN %% Processing Loop for (m=1:L:inSize-L) % Read and scale a block from FES xn = 2^(inBits-1) * xt(m+1:m+L,:); % Read and scale a block from NES dn = 2^(dBits-1) * dt(m+1:m+L,:); % Update the adaptive filter % only 2 partitions are constrained each call [W,X,x,y,e,Px,ci,w]=asptrcpbfdaf(M,x,xn,dn,X,W,mu,1,2,b,Px,ci); % Scale and store the error (residual) res(m+1:m+L) = 2^-(dBits-1)* e; % update the iteration progress window [E, stop,brk] = update_ipwin(E,e,dn,'e',w,dt,res); % handle the Stop button while (stop ~= 0), stop = getStop; end; % handle the Break button if (brk), plot_echo(w,dt,res); break; end; end; wavwrite(res,inFs,inBits,rfile); % Save the residual plot_echo(w, dfile, rfile); % Show results |
| Results |
Running the above script will produce the graph shown in Fig. 10.36.
The top panel in Fig. 10.36 shows the values taken by the filter
coefficients by the end of the simulation (end of input files). The middle panel
show the waveforms of the near-end speech signal
|
| Audio Files |
The following files demonstrate the performance of the RCPBFDAF algorithm in the echo canceler application mentioned above.
|
| See Also |
| INIT_ RCPBFDAF, ASPTRCPBFDAF, ASPTPBFDAF, ECHO_ PBFDAF, ECHO_ BFDAF. |
| Reference |
| [1] and [9] for detailed description of frequency domain adaptive filters. |