-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhase_3.m
84 lines (69 loc) · 2.15 KB
/
Phase_3.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
clc; clear all; close all;
wp = 0.3 * pi;
ws = 0.5 * pi;
% Sampling period
Ts = 1/44100;
% Passband and stopband frequency
Fp = wp/(2*pi*Ts);
Fs = ws/(2*pi*Ts);
% The variables below are in %'s 1 = 1%
deltaP = 5;
deltaS = 5;
%% Testing windows
M = 256;
% r = {80, 100} cheb
% beta = {0, 10} kaiser
% L = {0, 3} lanczos
% alfa = {0, 100%} tukey
Wn = 'chebwin'; % Window name, set it equal to the function that generates the window
wn_param = 90; % Set it if you want to use one of the windows that require
% one more parameter!
%plots = {'classic','dB', 'phase'};
plots = {'classic','dB'};
[deltaP_real, deltaS_real, error] =....
plotFilterDesign(Fp, Fs, deltaP, deltaS, Ts, Wn, wn_param, M, plots);
if numel(error)
disp(error);
end
%% Testing windows
M = 256;
% r = {80, 100} cheb
% beta = {0, 10} kaiser
% L = {0, 3} lanczos
% alfa = {0, 100%} tukey
Wn = 'kaiser'; % Window name, set it equal to the function that generates the window
wn_param = 8; % Set it if you want to use one of the windows that require
% one more parameter!
[deltaP_real, deltaS_real, error] =....
plotFilterDesign(Fp, Fs, deltaP, deltaS, Ts, Wn, wn_param, M, plots);
if numel(error)
disp(error);
end
%% Testing windows
M = 256;
% r = {80, 100} cheb
% beta = {0, 10} kaiser
% L = {0, 3} lanczos
% alfa = {0, 100%} tukey
Wn = 'lanczos'; % Window name, set it equal to the function that generates the window
wn_param = 2; % Set it if you want to use one of the windows that require
% one more parameter!
[deltaP_real, deltaS_real, error] =....
plotFilterDesign(Fp, Fs, deltaP, deltaS, Ts, Wn, wn_param, M, plots);
if numel(error)
disp(error);
end
%% Testing windows
M = 256;
% r = {80, 100} cheb
% beta = {0, 10} kaiser
% L = {0, 3} lanczos
% alfa = {0, 100%} tukey
Wn = 'boxcar'; % Window name, set it equal to the function that generates the window
wn_param = 90; % Set it if you want to use one of the windows that require
% one more parameter!
[deltaP_real, deltaS_real, error] =....
plotFilterDesign(Fp, Fs, deltaP, deltaS, Ts, Wn, wn_param, M, plots);
if numel(error)
disp(error);
end