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
/*!
| This code implements the `BiquadCoeffLPHMorph`
| trait for the `BiquadFilter` type.
|
| The `BiquadCoeffLPHMorph` trait is
| a collection of methods that provide
| coefficients for a biquad filter, which is
| a type of digital filter commonly used in
| audio processing.
*/
crateix!;
/// Implements the `BiquadCoeffLPHMorph` trait for
/// the `BiquadFilter` struct, providing a method
/// for computing the coefficients for
/// a low-pass/high-pass morph filter.
///
/// The method `coeff_lph_morph` takes in the
/// angular frequency `omega`, the quality factor
/// `quality_factor`, and a morph parameter
/// `_morph` (which is currently unused). It
/// computes the coefficients for
/// a low-pass/high-pass morph filter using the
/// following formulae:
///
/// b0 = alpha
/// b1 = 0
/// b2 = -alpha
/// a0 = 1 + alpha
/// a1 = -2*cos(omega)
/// a2 = 1 - alpha
///
/// where `alpha` is defined as `sin(omega) / (2 * quality_factor)`.
///