Question

In: Electrical Engineering

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

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".

Solutions

Expert Solution

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.

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

len = 500;                                       % Length (sec)
f   = 1024;                                     % Frequency (Hz)
Fs  = 2048;                                     % Sampling Frequency (Hz)
t   = linspace(0, len, Fs*len);                 % Time Vector
signal = sin(2*pi*f*t);                         % Signal (1 k
noise = signal + 0.1*randn(size(signal));

%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


Related Solutions

a. Design a broadband Butterworth bandpass filter with a lower cutoff frequency of 500 Hz and...
a. Design a broadband Butterworth bandpass filter with a lower cutoff frequency of 500 Hz and an upper cutoff frequency of 4500 Hz. The passband gain of the filter is 20 dB. The gain should be down at least 15 dB at 200 Hz and 11.25 kHz. Use 20 nF capacitors in the high-pass circuit and 10 k\Omega resistors in the low-pass circuit. b) Draw a circuit diagram of the filter and label all the components.
In Matlab, Design a model for a bandpass filter with a bandwidth of 4000 Hz, and...
In Matlab, Design a model for a bandpass filter with a bandwidth of 4000 Hz, and a center frequency as specied below. Once you have the model, it is easy to programmatically change the center frequency. center frequency: 20 KHz, 24.5 KHz, 29 KHz, 33.5 KHz, 38 KHz, 42.5 KHz, 47 KHz
In Matlab, Design a model for a bandpass filter with a bandwidth of 4000 Hz, and...
In Matlab, Design a model for a bandpass filter with a bandwidth of 4000 Hz, and a center frequency as specied below. Once you have the model, it is easy to programmatically change the center frequency. center frequency: 20 KHz, 24.5 KHz, 29 KHz, 33.5 KHz, 38 KHz, 42.5 KHz, 47 KHz
Design a Butterworth bandpass filter with the given requirements: 10 dB stopband attenuation at 100 rad/sec...
Design a Butterworth bandpass filter with the given requirements: 10 dB stopband attenuation at 100 rad/sec and 900 rad/sec 1dB passband attenuation at 400 rad/sec and 600 rad/sec
Using matlab a) Find the transfer function of a fourth order Butterworth filter and plot the...
Using matlab a) Find the transfer function of a fourth order Butterworth filter and plot the magnitude response. b) Find the poles.
This is Using MATLAB: I am trying to store the solution of this matrix because I...
This is Using MATLAB: I am trying to store the solution of this matrix because I want to do something with the result like find the norm of that answer however I am stuck and cannot seem to be able to. Help would be appreciated! --------------------------------------------- MATLAB CODE: close all clear clc A = [1 -1 2 -1; 2 -2 2 -3; 1 1 1 0; 1 -1 4 5]; b = [-8 -20 -2 4]'; x = gauss_elim(A,b) function...
I am trying to do edge detection using matlab. I have posted code here. It does...
I am trying to do edge detection using matlab. I have posted code here. It does not give any error but it's not running it at all. So please help me to fix it and also exaplin each line of this code pls. Thanks! i = imread('C:\Users\Amanda\Desktop"); I = rgb2gray(1i); BW1 = edge(I,'prewitt'); BW2= edge(I,'sobel'); BW3= edge(I,'roberts'); subplot (2,2,1); imshow(I); title('original'); subplot(2,2,2); imshow(BW1); title('Prewitt'); subplot(2,2,3); imshow(BW2); title('Sobel'); subplot(2,2,4); imshow(BW3); title('Roberts');
Butterworth filter a)Design a 5th order low pass Butterworth low-pass filter with a cut-off frequency of...
Butterworth filter a)Design a 5th order low pass Butterworth low-pass filter with a cut-off frequency of 1592 Hz and a dc gain of 3dB. Find and present the mathematical transfer function of the filter, showing all your steps. b) Write a Matlab code to plot the magnitude of this function with a linear scale in dB units on the ordinate, and a log scale of frequency on the abscissa. The plot range should be: ordinate- linear scale from -100dB to...
How to design FIR lowpass filter using matlab. Note : Do not write matlab code. Only...
How to design FIR lowpass filter using matlab. Note : Do not write matlab code. Only explain the steps of designing filter
Matlab Design a FIR filter directly using fir1 function in matlab with parameter M = 50....
Matlab Design a FIR filter directly using fir1 function in matlab with parameter M = 50. Design FIR filters with different M = 5, 10, 50, 100, 500 and plot their frequency responses H(e j?) on the same figure.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT