You are on page 1of 4

DSP Lab Project

Design and implementation of Wah-wah effect using time varying


bandpass filter

Submitted byAbhinav Arora

(131085)

Saumitra Mehrotra (131109)

Theory:
Wah-wah is an imitative word for the sound of altering the resonance of musical notes to extend
expressiveness, sounding much like a human voice saying the syllable wah. The wah-wah effect
is a spectral glide, a "modification of the vowel quality of a tone"
The speed of the wah, the centre frequency of the filter, and how the centre frequency is moved
up and down in frequency are the effect variables. A 2nd order tunable bandpass filter has been
implemented based on that described in Mitra. This is shown in block form in Figure 10. This
implementation allows two variables control the effect. a controls the bandwidth, and b the
centre frequency of the filter.

CODE:
clear all;
close all;
infile = 'acoustic.wav';

[ x, Fs, N ] = wavread(infile);

damp = 0.05;
minf=500;
maxf=3000;
Fw = 2000;
delta = Fw/Fs;

Fc=minf:delta:maxf;
while(length(Fc) < length(x) )
Fc= [ Fc (maxf:-delta:minf) ];
Fc= [ Fc (minf:delta:maxf) ];
end
Fc = Fc(1:length(x));
F1 = 2*sin((pi*Fc(1))/Fs);
Q1 = 2*damp;

yh=zeros(size(x));
yb=zeros(size(x));
yl=zeros(size(x));

yh(1) = x(1);
yb(1) = F1*yh(1);

yl(1) = F1*yb(1);
for n=2:length(x),

yh(n) = x(n) - yl(n-1) - Q1*yb(n-1);


yb(n) = F1*yh(n) + yb(n-1);
yl(n) = F1*yb(n) + yl(n-1);

F1 = 2*sin((pi*Fc(n))/Fs);
end

maxyb = max(abs(yb));
yb = yb/maxyb;
wavwrite(yb, Fs, N, 'out_wah.wav');
figure(1)
hold on
plot(x,'r');
plot(yb,'b');
wavplay(yb);
title('Wah-wah and original Signal');

You might also like