// cepstrum.co.jp // // decorrelator effect simulation program of adaptive howling canceller // //------------------------------------------------------------------------- // decorrelator off // // +---------------------------------------------+ // | | // | s | // | | | // | | | // | +-----+ d v | // | +--->| FIR +--->(+)---+ | // | | +-----+ | | // | | + | | // | +---------+ | v e | // +--->| limiter +---+ x (+)---+ // +---------+ | ^ ^ | // | | - | | // | +-----+ y | | // +--->| ADP +----------+ | // +-----+ | // | | // | | // +------------------+ // //------------------------------------------------------------------------- // decorrelator on (delay on) // // +--------------------------------------------------------------+ // | | // | s | // | | | // | | | // | +-----+ d v | // | +--->| FIR +--->(+)---+ | // | | +-----+ | | // | | + | | // | +---------+ | v e +-------+ | // +--->| limiter +---+ x (+)---+--->| delay +---+ ze // +---------+ | ^ ^ | +-------+ // | | - | | // | +-----+ y | | // +--->| ADP +----------+ | // +-----+ | // | | // | | // +------------------+ // //------------------------------------------------------------------------- clear; rand('normal'); rand('seed', 234); DATLEN=1000000; // should be odd number ADPLEN=100; DLYLEN=10; MU =0.001; THLD =2.0; indata=rand(1:DATLEN); indata=convol([2.0, 0.5, 0.5, 0.0, 1.0, 1.0, 1.0, 0.0, 0.5, 0.5 ], indata); indata=indata(1:DATLEN); indata=0.9*indata/max(abs(indata)); savewave('in.wav', indata, 8000); outdata=zeros(1:DATLEN); edly=zeros(1:DLYLEN); h=rand(1:ADPLEN).*(0.97^(1:ADPLEN)); h=h-sum(h)/ADPLEN; scf(0); clf; plot(h); xbuf=zeros(1:ADPLEN); w_decor_on=zeros(1:ADPLEN); w_decor_off=zeros(1:ADPLEN); out_decor_on=zeros(1:DATLEN); out_decor_off=zeros(1:DATLEN); //-------------------------------------------------------------- // decorrelator off mprintf('running decorrelator off simulation\n'); e=0; for i=1:DATLEN if THLD