PackFFT:
Filter:
Classes | UGens > FFT

PackFFT : PV_ChainUGen : WidthFirstUGen : UGen : AbstractFunction : Object

Pack separate demand-rate FFT bin streams into an FFT chain buffer

Description

Takes an array of magnitudes and phases, and packs them into an FFT buffer ready for transforming back into time-domain audio using IFFT.

Most people won't need to use this directly - instead, use pvcollect, pvcalc, or pvcalc2 methods from the PV_ChainUGen base class.

Class Methods

PackFFT.new(chain, bufsize, magsphases, frombin: 0, tobin, zeroothers: 0)

Arguments:

chain

The FFT chain

bufsize

FFT buffer size

magsphases

The input data should be a flat array containing magnitude and phase of all bins in ascending order. e.g. [mag0, phase0, mag1, phase1, mag2, phase2, ... magN, phaseN]This input is typically demand-rate.

frombin

restricts the frequency band

tobin

restricts the frequency band

zeroothers

set to 1 to zero all the magnitudes outside the restricted frequency band

Discussion:

This is technically similar to Demand or Duty in that it calls demand-rate UGens further up the graph to process the values, eventually calling UnpackFFT. These two ends of the process must in most cases see the same chain...! Otherwise behaviour is undefined and, who knows, possibly unpleasant.

Optional parameters: frombin and tobin allow you to fill the supplied data only into a subset of the FFT bins (i.e. a single delimited frequency band), and if you do this, you can also optionally set zeroothers to 1 to zero all the magnitudes outside this band (otherwise they stay intact).

Inherited class methods

Instance Methods

Inherited instance methods

Undocumented instance methods

.fftSize

Examples

Here's an unusual example which uses PackFFT without using UnpackFFT first - essentially creating our FFT data from scratch.