Functions | |
function | freqz_plot (w, h) if(nargin! |
subplot (3, 1, 1) | |
plot (w, mag) | |
grid ("on") | |
legend ("Pass band (dB)") | |
axis ([w(1), w(n), maxmag-3, maxmag],"labely") | |
subplot (3, 1, 2) | |
legend ("Stop band (dB)") | |
if (maxmag-min(mag) > 100) axis([w(1) | |
w (n) | |
id | labely () |
else | axis ("autoy","labely") |
endif | subplot (3, 1, 3) |
plot (w, phase *360/(2 *pi)) | |
legend ("Phase (degrees)") | |
xlabel ("Frequency") | |
axis ([w(1), w(n)],"autoy","label") | |
Variables | |
endif | n = length (w) |
mag = 20 * log10 (abs (h)) | |
phase = unwrap (arg (h)) | |
maxmag = max (mag) |
axis | ( | "autoy" | , | |
"label" | ||||
) |
else axis | ( | "autoy" | , | |
"labely" | ||||
) |
axis | ( | "labely" | ) |
function freqz_plot | ( | w | , | |
h | ||||
) |
grid | ( | "on" | ) |
if | ( | maxmag- | minmag, | |
100 | ||||
) |
id labely | ( | ) | [virtual] |
legend | ( | "Phase (degrees)" | ) |
legend | ( | "Stop band (dB)" | ) |
legend | ( | "Pass band (dB)" | ) |
plot | ( | w | , | |
phase *360/ | 2 *pi | |||
) |
plot | ( | w | , | |
mag | ||||
) |
endif subplot | ( | 3 | , | |
1 | , | |||
3 | ||||
) |
subplot | ( | 3 | , | |
1 | , | |||
2 | ||||
) |
subplot | ( | 3 | , | |
1 | , | |||
1 | ||||
) |
w | ( | n | ) |
xlabel | ( | "Frequency" | ) |
mag = 20 * log10 (abs (h)) |
endif n = length (w) |
phase = unwrap (arg (h)) |