Commit 01ba0ac8 authored by Moto Hira's avatar Moto Hira Committed by Facebook GitHub Bot
Browse files

Update prototype functional tests. (#3027)

Summary:
Pull Request resolved: https://github.com/pytorch/audio/pull/3027

To support older NumPy, removing `numpy.typing`.

Reviewed By: nateanl

Differential Revision: D42924428

fbshipit-source-id: af1a370b5baf00c63a088f172dbc2190d414bdf1
parent 49287210
import numpy as np
from numpy.typing import ArrayLike
def oscillator_bank(
frequencies: ArrayLike,
amplitudes: ArrayLike,
frequencies,
amplitudes,
sample_rate: float,
time_axis: int = -2,
) -> ArrayLike:
):
"""Reference implementation of oscillator_bank"""
invalid = np.abs(frequencies) >= sample_rate / 2
if np.any(invalid):
......@@ -20,7 +19,7 @@ def oscillator_bank(
return waveform
def sinc_ir(cutoff: ArrayLike, window_size: int = 513, high_pass: bool = False):
def sinc_ir(cutoff, window_size: int = 513, high_pass: bool = False):
if window_size % 2 == 0:
raise ValueError(f"`window_size` must be odd. Given: {window_size}")
half = window_size // 2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment