Electronic – Band-pass filter with a given impulse response (Matlab)

filterMATLABsignalsignal processing

I am trying to pass a .wav sound waveform through a band pass filter whose impulse response is given by

\$ h(t)=50u(t) \exp(-10t) \sin(2 \pi 440t), \$

I have imported the file into Matlab as follows:

[s, Fs] = wavread('piano_chord.wav');

So, what syntax do I need to use to implement this filter?

I have looked at the [b,a] = butter(n,Wn) or [b,a] = cheby1(n,Rp,Wp) for Butterworth and Chebyshev band-pass filters respectively. But I don't know how the equation for impulse response factors into this, and what values I need to use for a, b, and Wn.

Any help would be greatly appreciated.

Best Answer

create a timebase for your impulse response:

t = 0 : 1/fs : 1;

create the impulse response

b = 50 * exp( -10*t ) .* sin( 2*pi*440*t );

filter the signal

filtered_s = filter( b, 1, s);