0
votes

Have some questions about how to create 3 bandpass butterworth filters in Matlab.

I need a lower cut-off frequency that should be an integer multiple of 625, next one should be 1875, 2500 Hz.

I want a band-pass filter in the low frequency range like (80 - 100 hz?) and one in the mid frequency (400 hz?) range and one in the high frequency range (4khz?). Of course cannot go beyond the Nyquist limit.

How can i need to create these 3 filters and apply them to a piece of music?

Anyone have an idea to use multiple frequencies with the butter command?

Thanks!

1

1 Answers

0
votes

first you want to do a wavread of your music file to load it into Matlab (this is in the Time Domain),

next you want to create 3 Bandpass filters (Butterworth)

You have 2 execution route, in Time Domain or in Frequency Domain.

In time domain:

[x1 Fs nbits] = wavread('yourfile.wav'); %Fs is your sample frequency, x1 is your vector/matrix depending on single channel or dual channel.

Now you just need to design your filter. you can cheat by using fdesign.bandpass (see http://uk.mathworks.com/help/dsp/ref/fdesign.bandpass.html)

use matlab butterworth filter command

[b,a] = butter(order,NormalizedCutOff); %you have to work out the Normalized Cut Off frequency using your sampling frequency or period, your desired cut-off etc.

if you want multiple cutoff frequency use [c1 c2] in place of NormalizedCutOff (i.e.[b,a] = butter(8,[0.2 0.6],'pass');) %for band stop, change pass to stop

freqz(b,a) %The frequency response of your filter
dataIn = x1; %your music
dataOut = filter(b,a,dataIn); %filter command filters your music

and you can wavwrite the file to listen to it or use (sound(dataout,fs))