mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-24 09:21:16 +08:00
Formatted
This commit is contained in:
parent
9e8befbe8d
commit
f50cce83a5
@ -1,6 +1,7 @@
|
||||
import mlx.core as mx
|
||||
import numpy as np
|
||||
|
||||
|
||||
def stft(
|
||||
x: mx.array,
|
||||
n_fft: int = 2048,
|
||||
@ -34,10 +35,9 @@ def stft(
|
||||
|
||||
n_frames = 1 + (x.shape[0] - n_fft) // hop_length
|
||||
|
||||
frames = mx.stack([
|
||||
x[i * hop_length : i * hop_length + n_fft] * window
|
||||
for i in range(n_frames)
|
||||
])
|
||||
frames = mx.stack(
|
||||
[x[i * hop_length : i * hop_length + n_fft] * window for i in range(n_frames)]
|
||||
)
|
||||
|
||||
stft = mx.fft.fft(frames, n=n_fft, axis=-1)
|
||||
|
||||
@ -52,6 +52,7 @@ def stft(
|
||||
|
||||
return stft
|
||||
|
||||
|
||||
def istft(
|
||||
stft_matrix: mx.array,
|
||||
hop_length: int = None,
|
||||
|
Loading…
Reference in New Issue
Block a user