On 7/8/25 23:06, Timon Gehr wrote:
auto fToWave(R)(size_t N,R coefficients_f){ return iota(N/2+1).map!(j=> tuple!("magnitude","frequency","phase")( (j==N/2?1.0:2.0)*abs(coefficients_f[j]).re, K(j)*sample_rate/N, std.complex.log(coefficients_f[j]).im) ); }
As `f_0` is also real, similar to `f_(N/2)`, this should of course have been:
```d auto fToWave(R)(size_t N,R coefficients_f){ return iota(N/2+1).map!(j=> tuple!("magnitude","frequency","phase")( (j==0||j==N/2?1.0:2.0)*abs(coefficients_f[j]).re, K(j)*sample_rate/N, std.complex.log(coefficients_f[j]).im) ); } ```