3 #include "utilities/range.h" 15 double lower_band_edge(
double p,
double P,
size_t l);
16 double upper_band_edge(
double p,
double P,
size_t l);
23 template <
size_t... Ix>
25 return std::array<double,
sizeof...(Ix)>{
26 {band_edge_frequency(Ix,
sizeof...(Ix) - 1, r)...}};
29 template <
size_t bands>
31 return band_edges(r, std::make_index_sequence<bands + 1>{});
36 template <
typename T,
size_t... Ix>
37 auto bandwidths(
const std::array<T,
sizeof...(Ix) + 1>& edges,
38 std::index_sequence<Ix...>) {
39 using value_type = decltype(edge(edges[1]) - edge(edges[0]));
40 return std::array<value_type,
sizeof...(Ix)>{
41 {edge(edges[Ix + 1]) - edge(edges[Ix])...}};
44 template <
typename T,
size_t edges>
45 auto bandwidths(
const std::array<T, edges>& e) {
46 return bandwidths(e, std::make_index_sequence<edges - 1>{});
51 template <
size_t... Ix>
53 return std::array<double,
sizeof...(Ix)>{
54 {band_centre_frequency(Ix,
sizeof...(Ix), r)...}};
57 template <
size_t bands>
59 return band_centres(r, std::make_index_sequence<bands>{});
70 double compute_bandpass_magnitude(
double frequency,
75 double compute_lopass_magnitude(
double frequency,
80 double compute_hipass_magnitude(
double frequency,