shapee

package module
v0.0.0-...-e53e6af Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2019 License: MIT Imports: 9 Imported by: 0

README

Shapee (reborn)

Implementation of Christopher Penrose's paper Frequency Shaping of Audio Signals.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComplexToPolar

func ComplexToPolar(stft [][]complex128) ([][]float64, [][]float64)

ComplexToPolar calculates the polar form of a complex STFT.

func ComputeISTFT

func ComputeISTFT(stft [][]complex128, winShift int) []float64

ComputeISTFT recovers the time-series from an STFT in complex form.

func ComputeSTFT

func ComputeSTFT(wave []float64, winShift int, winLen int) [][]complex128

ComputeSTFT computes the STFT of the input waveform and returns it in complex form. It uses a Hamming window.

func ExportWavAudio

func ExportWavAudio(wave [][]float64, format *audio.Format, outPath string)

ExportWavAudio exports a .wav file from a 2D float64 array.

func ImportWavAudio

func ImportWavAudio(inputPath string) ([][]float64, *audio.Format)

ImportWavAudio imports a .wav file and returns the audio waveform as well as its format information.

func PolarToComplex

func PolarToComplex(stftMag [][]float64, stftAng [][]float64) [][]complex128

PolarToComplex calculates the complex form of a polar STFT.

Types

type Shaper

type Shaper struct {
	AmpMag    [][]float64
	FreqMag   [][]float64
	FreqPhase [][]float64
	W         int
}

Shaper is a simple struct for containing the data needed for the FreqShape function.

func (*Shaper) FreqShape

func (shaper *Shaper) FreqShape() ([][]float64, [][]float64)

FreqShape completes the audio transformation as proposed in Christopher Penrose's paper "Frequency Shaping of Audio Signals".

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL