Definition at line 130 of file wave_simulation_real.cpp.hpp.
130 {
133
134
135 curr[0] = curr[1];
137
138 i32 mCourantSq32 =
static_cast<i32
>(
mCourantSq);
139
140
141
142
143
145
146 for (fl::size i = 1; i <
length + 1; i++) {
147
148
149 i32 lap =
150 (i32)curr[i + 1] - (i32)curr[i] * 2 + curr[i - 1];
151
152
153
154
155
156
157
158
159 i32 term = static_cast<i32>(
160 (
static_cast<i64>(mCourantSq32) * lap) >> 15);
161
162
163
164 i32 f = -(i32)next[i] + (i32)curr[i] * 2 + term;
165
166
167
168
169
170
171
172 f = static_cast<i32>(
174
175
176
177
178 next[i] =
static_cast<i16
>(
fl::clamp(f, q15_min,
static_cast<i32
>(32767)));
179 }
180
181
183}
constexpr enable_if< is_fixed_point< T >::value, T >::type clamp(T x, T lo, T hi) FL_NO_EXCEPT
References fl::clamp(), fl::FL_NO_EXCEPT, grid1, grid2, length, mCourantSq, mDampDecayQ15, mHalfDuplex, and whichGrid.