Uploaded by ananfatam

Filter Sound

advertisement
EXAMPLE
Echo Generation: The most basic of all audio effects is that of time delay, or echoes. Echoes
are delayed signals, and as such are generated using delay units. For example, the
combination of the direct sound represented by discrete signal y[n] and a single echo
appearing D samples later (which is related to delay in seconds) can be generated by the
equation of the form (called a difference equation)
x[n] = y[n] + αy[n − D], |α| < 1
Available in MATLAB is a short snippet of chorus, which is a digital sound about 9 seconds
long, sampled at 8192 sam/sec. The echo is delayed by D = 4196 samples, which
amount to 0.5 sec of delay.
load handel;
sound(y,Fs); pause(10);
alpha = 0.9; D = 4196;
b = [1,zeros(1,D),alpha];
x = filter(b,1,y);
sound(x,Fs); pause(10);
%
%
%
%
%
%
the signal is in y and sampling freq in Fs
Play the original sound
Echo parameters
Filter parameters
Generate sound plus its echo
Play sound with echo
where x[n] is the resulting signal and α models attenuation of the direct sound.
Echo Removal: After executing this simulation, you may experience that the echo is an
objectionable interference while listening. DSP can be used effectively to reduce (almost
eliminate) echoes. Such an echoremoval system is given by the difference equation
w[n] + αw[n − D] = x[n]
where x[n] is the echo-corrupted sound signal and w[n] is the output sound signal, which
has the echo removed.
w = filter(1,b,x);
sound(w,Fs);
% Generate sound after echoremoval
% Play the original sound after echoremoval
The echo should no longer be audible.
Download