blob: 1082e2363b1e2dcfde18bb22d41e253d9480d453 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
clear;
close;
clc;
W = -%pi:(1/500):%pi;
z = exp(sqrt(-1)*W);
H = z./(z-0.8);
Mag_H = abs(H);
[Phase_H,m] = phasemag(H);
//phasemag used to calculate phase and magnitude in dB
subplot(2,1,1)
plot2d(W,Mag_H)
xlabel('Frequency in Radians')
ylabel('abs(H)')
title('Magnitude Response')
subplot(2,1,2)
plot2d(W,Phase_H)
xlabel('Frequency in Radians')
ylabel('<(H)')
title('Phase Response')
|