Added stft and istft in the header

This commit is contained in:
paramthakkar123
2025-04-23 19:19:04 +05:30
parent a963a15b8d
commit f7f323f6ae
4 changed files with 56 additions and 10 deletions

View File

@@ -464,8 +464,8 @@ void init_fft(nb::module_& parent_module) {
"stft",
[](const mx::array& x,
int n_fft = 2048,
int hop_length = -1,
int win_length = -1,
std::optional<int> hop_length = std::nullopt,
std::optional<int> win_length = std::nullopt,
const mx::array& window = mx::array(),
bool center = true,
const std::string& pad_mode = "reflect",
@@ -486,8 +486,8 @@ void init_fft(nb::module_& parent_module) {
},
"x"_a,
"n_fft"_a = 2048,
"hop_length"_a = -1,
"win_length"_a = -1,
"hop_length"_a = nb::none(),
"win_length"_a = nb::none(),
"window"_a = mx::array(),
"center"_a = true,
"pad_mode"_a = "reflect",
@@ -515,8 +515,8 @@ void init_fft(nb::module_& parent_module) {
m.def(
"istft",
[](const mx::array& stft_matrix,
int hop_length = -1,
int win_length = -1,
std::optional<int> hop_length = std::nullopt,
std::optional<int> win_length = std::nullopt,
const mx::array& window = mx::array(),
bool center = true,
int length = -1,
@@ -533,8 +533,8 @@ void init_fft(nb::module_& parent_module) {
s);
},
"stft_matrix"_a,
"hop_length"_a = -1,
"win_length"_a = -1,
"hop_length"_a = nb::none(),
"win_length"_a = nb::none(),
"window"_a = mx::array(),
"center"_a = true,
"length"_a = -1,