-
Notifications
You must be signed in to change notification settings - Fork 5
/
iir_filter_coeffs_usage.txt
90 lines (71 loc) · 2.7 KB
/
iir_filter_coeffs_usage.txt
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
85
86
87
88
89
90
/////////////////////////////////////////////////////////////////////////////////
> Example 1
> 3rd Order Butterworth Highpass filter, 5000 Hz, Sampling Frequency = 44.1 kHz
/////////////////////////////////////////////////////////////////////////////////
pkg load signal
iir_filter = "butter"
order = 3
fs = 44100
fc = 5000
ft = 'high'
plot_on = 1
iir_coeffs_cmsis(iir_filter, order, fs, fc, ft, plot_on)
#################################################################################
/////////////////////////////////////////////////////////////////////////////////
> Example 2
> 5th Order Elliptic Lowpass filter, 25 Hz, Sampling Frequency = 500 Hz
> Passband Ripple = 0.001 dB, Stopband attenuation = 80 dB
/////////////////////////////////////////////////////////////////////////////////
pkg load signal
iir_filter = "elliptic"
order = 5
fs = 500
fc = 25
ft = 'low'
plot_on = 0
iir_coeffs_cmsis(iir_filter, order, fs, fc, ft, plot_on)
Note: For elliptic filter passband ripple and stopband attenuation value needs to
provide runtime by user.
#################################################################################
/////////////////////////////////////////////////////////////////////////////////
> Example 3
> 4th Order Chebyshev-1 Bandpass filter, fc1=4 kHz, fc2=8 kHz
> Sampling Frequency = 20 kHz, Passband Ripple = 0.5 dB
/////////////////////////////////////////////////////////////////////////////////
pkg load signal
iir_filter = "chebyshev"
order = 4
fs = 20000
fc = [4000 8000]
ft = 'pass'
plot_on = 1
iir_coeffs_cmsis(iir_filter, order, fs, fc, ft, plot_on)
Note: For chebyshev filter passband ripple value needs toprovide runtime by user.
#################################################################################
/////////////////////////////////////////////////////////////////////////////////
> Example 4
> 6th Order Butterworth Bandstop filter, fc1=3 kHz, fc2=9 kHz
> Sampling Frequency = 20 kHz
/////////////////////////////////////////////////////////////////////////////////
pkg load signal
iir_filter = "butter"
order = 6
fs = 20000
fc = [3000 9000]
ft = 'stop'
plot_on = 1
iir_coeffs_cmsis(iir_filter, order, fs, fc, ft, plot_on)
#################################################################################
/////////////////////////////////////////////////////////////////////////////////
> Example 5
> 2nd Order Bessel Highpass filter, fc=3 kHz, Sampling Frequency = 10 kHz
/////////////////////////////////////////////////////////////////////////////////
pkg load signal
iir_filter = "bessel"
order = 2
fs = 10000
fc = 3000
ft = 'high'
plot_on = 1
iir_coeffs_cmsis(iir_filter, order, fs, fc, ft, plot_on)
#################################################################################