In: Electrical Engineering
Matlab code:
%%
clear all;
close all;
clc;
%%
% since the type of filter is not give
% Let us consider a low pass filter with cut-off frquency fc
% the that data is sampled at fs
% then 2*pi*fc/fs is the cut-off point in rad/sample
% butter is a commond used to design a butter-worth filter with n,
Wn as
% paramenter
% n is the order of filter
% Wn is the cut-off frequency
% the command butter give an output [z,p]
% z is the zeros and p is the poles
fc =
300;
% cut-off frequency
fs =
1000;
% sample frequency
n =
4;
% order of filter
[z,p] = butter(n,fc/(fs/2)); % filter design of 4th order and
0.6*pi rad/sample cut-off frequency
freqz(z,p)
% magnitude and phase response of the system
transfer_function=tf(z,p)
% transfer function of the system
poles=roots(p)
% is the poles of the system
figure;
pzmap(transfer_function)
% x represent poles and o respresent zeros
grid on;
Magnitude Response:
Pole zero graph: