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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
ix!();

impl crate::HalfRateFilterSSE {

    pub fn load_softer_coefficients(&mut self, order: usize) {
        match order {
            12 => self.load_softer_rejection150db_tband0_05(),
            10 => self.load_softer_rejection133db_tband0_05(),
            8  => self.load_softer_rejection106db_tband0_05(),
            6  => self.load_softer_rejection80db_tband0_05(),
            4  => self.load_softer_rejection70db_tband0_1(),
            2  => self.load_softer_rejection36db_tband0_1(),
            _  => unreachable!(),
        }
    }

    pub fn load_softer_rejection150db_tband0_05(&mut self) {

        // rejection=150db, transition band=0.05
        let mut a_coefficients: [f64; 6] = [
            0.01677466677723562, 0.13902148819717805,
            0.3325011117394731,  0.53766105314488,
            0.7214184024215805,  0.8821858402078155
        ];

        let mut b_coefficients: [f64; 6] = [
            0.06501319274445962, 0.23094129990840923,
            0.4364942348420355,  0.6329609551399348,
            0.8037808679411123,  0.9599687404800694
        ];

        unsafe {
            self.store_coefficients(
                a_coefficients.as_mut_ptr(), 
                b_coefficients.as_mut_ptr());
        }
    }

    pub fn load_softer_rejection133db_tband0_05(&mut self) {

        // rejection=133db, transition band=0.05
        let mut a_coefficients: [f64; 5] = [
            0.02366831419883467, 0.18989476227180174,
            0.43157318062118555, 0.6632020224193995, 
            0.860015542499582
        ];

        let mut b_coefficients: [f64; 5] = [
            0.09056555904993387, 0.3078575723749043, 
            0.5516782402507934, 0.7652146863779808, 
            0.9524772837866754
        ];

        unsafe {
            self.store_coefficients(
                a_coefficients.as_mut_ptr(), 
                b_coefficients.as_mut_ptr());
        }
    }

    pub fn load_softer_rejection106db_tband0_05(&mut self) {

        // rejection=106db, transition band=0.05
        let mut a_coefficients: [f64; 4] = [
            0.03583278843106211, 0.2720401433964576, 
            0.5720571972357003, 0.827124761997324
        ];

        let mut b_coefficients: [f64; 4] = [
            0.1340901419430669, 0.4243248712718685, 
            0.7062921421386394, 0.9415030941737551
        ];

        unsafe {
            self.store_coefficients(
                a_coefficients.as_mut_ptr(), 
                b_coefficients.as_mut_ptr());
        }
    }

    pub fn load_softer_rejection80db_tband0_05(&mut self) {

        // rejection=80db, transition band=0.05
        let mut a_coefficients: [f64; 3] = [
            0.06029739095712437, 0.4125907203610563, 
            0.7727156537429234
        ];

        let mut b_coefficients: [f64; 3] = [
            0.21597144456092948, 0.6043586264658363, 
            0.9238861386532906
        ];

        unsafe {
            self.store_coefficients(
                a_coefficients.as_mut_ptr(), 
                b_coefficients.as_mut_ptr());
        }
    }

    pub fn load_softer_rejection70db_tband0_1(&mut self) {

        // rejection=70db,transition band=0.1
        let mut a_coefficients: [f64; 2] = [
            0.07986642623635751, 0.5453536510711322
        ];

        let mut b_coefficients: [f64; 2] = [
            0.28382934487410993, 0.8344118914807379
        ];

        unsafe {
            self.store_coefficients(
                a_coefficients.as_mut_ptr(), 
                b_coefficients.as_mut_ptr());
        }
    }

    pub fn load_softer_rejection36db_tband0_1(&mut self) {

        // order=2, rejection=36db, transition band=0.1
        let mut a_coefficients: [f64; 1] = [
            0.23647102099689224
        ];

        let mut b_coefficients: [f64; 1] = [
            0.7145421497126001
        ];

        unsafe {
            self.store_coefficients(
                a_coefficients.as_mut_ptr(), 
                b_coefficients.as_mut_ptr());
        }
    }
}