{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Oscillator and ADSR envelope\n\n**Author**: [Moto Hira](moto@meta.com)_\n\nThis tutorial shows how to synthesize various waveforms using\n:py:func:`~torchaudio.prototype.functional.oscillator_bank` and\n:py:func:`~torchaudio.prototype.functional.adsr_envelope`.\n\n
This tutorial requires prototype DSP features, which are\n available in nightly builds.\n\n Please refer to https://pytorch.org/get-started/locally\n for instructions for installing a nightly build.
Why integrate the frequencies? Instantaneous frequency represents the velocity\n of oscillation at given time. So integrating the instantaneous frequency gives\n the displacement of the phase of the oscillation, since the start.\n In discrete-time signal processing, integration becomes accumulation.\n In PyTorch, accumulation can be computed using :py:func:`torch.cumsum`.