final case class FFT(buf: GE, in: GE, hop: GE = 0.5f, winType: GE = 0, active: GE = 1, winSize: GE = 0) extends SingleOut with ControlRated with HasSideEffect with IsIndividual with Product with Serializable
A UGen performing short-time forward fourier transformations. In order to
properly link the spectral ugens ( PV_...
), you should begin by using the
output of each UGen (which is just the fft buffer identifier), and use that as
buffer input of the next UGen. That way, the UGen graph is correctly sorted.
E.g. IFFT(PV_...(FFT(buf, in)))
.
The UGen will initially output zero until the first FFT can be performed. This
is the case after hop * fftSize
. Thus, for a default fft buffer size of 1024
and a hop
of 0.5, and for a default control block size of 64, for the first
1024*0.5/64 = 8 control blocks the UGen will output zero. This also implies that
the first FFT in this case is performed on the first 512 samples of the in
signal (prepended by 512 zeros). In other words, the first 'full' FFT of the
input happens after fftSize/controlBlockSize cycles, no matter what hop size was
chosen.
If you use FFT for performing signal analysis and not phase vocoder effects, make sure you change the window type accordingly.
- buf
The buffer to use for writing the FFT to. The size must be a power of two. Since
FFT
operates at control rate (also being a power of two), the buffer should probably be at least as long as the control block size. (init-time only)- in
The time domain signal to be transformed into the spectral domain.
- hop
A factor determining the step size between successive FFTs. That is, FFTs are performed every fftSize * hop sample frames. The default of 0.5 means thus a 50% overlap, while a hope of 1.0 means no overlapping. Choosing 0.0 will most likely crash the server! (init-time only)
- winType
The window function applied before each FFT is taken. The default of
0
is a sine window which is good for phase vocoder applications (using thePV_...
UGens). For analysis applications, you may want to use-1
which is a rectangle window (effectively no windowing) or1
which is a Hann window. A Hann window gives perfect overlap-add reconstruction for a hope size of 0.5 (or 0.25 etc.) (init-time only)- active
This parameter can be temporarily set to <= 0 to pause the FFT operation.
- winSize
With the default value of zero, the window size equals the fft size. If you wish to perform zero padding, an explicit window size can be specified. (init-time only)
- See also
- Alphabetic
- By Inheritance
- FFT
- Serializable
- IsIndividual
- HasSideEffect
- ControlRated
- SingleOut
- SomeOut
- Lazy
- GE
- UGenSource
- Expander
- Lazy
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new FFT(buf: GE, in: GE, hop: GE = 0.5f, winType: GE = 0, active: GE = 1, winSize: GE = 0)
- buf
The buffer to use for writing the FFT to. The size must be a power of two. Since
FFT
operates at control rate (also being a power of two), the buffer should probably be at least as long as the control block size. (init-time only)- in
The time domain signal to be transformed into the spectral domain.
- hop
A factor determining the step size between successive FFTs. That is, FFTs are performed every fftSize * hop sample frames. The default of 0.5 means thus a 50% overlap, while a hope of 1.0 means no overlapping. Choosing 0.0 will most likely crash the server! (init-time only)
- winType
The window function applied before each FFT is taken. The default of
0
is a sine window which is good for phase vocoder applications (using thePV_...
UGens). For analysis applications, you may want to use-1
which is a rectangle window (effectively no windowing) or1
which is a Hann window. A Hann window gives perfect overlap-add reconstruction for a hope size of 0.5 (or 0.25 etc.) (init-time only)- active
This parameter can be temporarily set to <= 0 to pause the FFT operation.
- winSize
With the default value of zero, the window size equals the fft size. If you wish to perform zero padding, an explicit window size can be specified. (init-time only)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val active: GE
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val buf: GE
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- lazy val hashCode: Int
- Definition Classes
- UGenSource → AnyRef → Any
- val hop: GE
- val in: GE
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def makeUGen(_args: Vec[UGenIn]): UGenInLike
- Attributes
- protected
- Definition Classes
- FFT → UGenSource
- def makeUGens: UGenInLike
Abstract method which must be implemented by creating the actual
UGen
s during expansion. - final def name: String
- Definition Classes
- UGenSource
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- final def rate: Rate
- Definition Classes
- ControlRated
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- val winSize: GE
- val winType: GE
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated