Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What I am trying to do is to design a Butterworth Bandpass filter using Matlab,

ID: 1766278 • Letter: W

Question

What I am trying to do is to design a Butterworth Bandpass filter using Matlab, High frequency must equal to 16 Hz and lower frequency must be 10Hz (passBand). and the input signal must be a white noise signal.
here is my code :

mu=0;

sigma=2;

X= sigma*randn(500,1)+mu; %Generating White Noise signal

Fs=500;%Sampling Frequency

Fh= 16;

Fl=10;

order=6;

[b,a]=butter(order,[Fh Fl]/(Fs/2),'bandpass');%Butterworth BandPass filter

XX=filtfilt(b,a,X);%filter the signal both forward and backword in time

Actually, I am not sure about Fs value that I have chosen and I do not know the criteria of choosing it for such a filter.Moreover, I am getting Weird plot when trying to plot XX "it may be correct though".

Explanation / Answer

Hi,

According to the sampling therom the Sampling Frequency must be two greater than the original signal.

Here you are generating white noise which is broadband signal. So when you are applying Butterworth filter you are loosing your original signal because of undersampling.

You can use the Band Limited White noise signal to get accurate results.

or you can generate the signal and add that noise to it and apply butterworth filter to it to check the results.

-----------------------------------------------------------------------------------------------------------------------------------------------

%mu=0;

%sigma=2;

%X= sigma*randn(500,1)+mu; %Generating White Noise signal

%Fs=500;%Sampling Frequency

Fh= 16;

Fl=10;

order=6;

[b,a]=butter(order,[Fh Fl]/(Fs/2),'bandpass');%Butterworth BandPass filter

XX=filtfilt(b,a,noise);%filter the signal both forward and backword in time

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote