Signal:
Filter:
Classes | Collections > Ordered

Signal : FloatArray : RawArray : ArrayedCollection : SequenceableCollection : Collection : Object

Sampled audio buffer
Source: Signal.sc

Description

A Signal is a FloatArray that represents a sampled function of time buffer. Signals support math operations.

Class Methods

Signal.sineFill(size, amplitudes, phases)

Fill a Signal of the given size with a sum of sines at the given amplitudes and phases. The Signal will be normalized.

Arguments:

size

the number of samples in the Signal.

amplitudes

an Array of amplitudes for each harmonic beginning with the fundamental.

phases

an Array of phases in radians for each harmonic beginning with the fundamental.

Signal.chebyFill(size, amplitudes, normalize: true, zeroOffset: false)

Fill a Signal of the given size with a sum of Chebyshev polynomials at the given amplitudes. For eventual use in waveshaping by the Shaper ugen; see Shaper helpfile and Buffer:cheby too.

Arguments:

size

the number of samples in the Signal.

amplitudes

an Array of amplitudes for each Chebyshev polynomial beginning with order 1.

normalize

a Boolean indicating whether to normalize the resulting Signal. If the zeroOffset argument is true, the normalization is done for use as a transfer function, using normalizeTransfer, otherwise it just uses normalize to make the absolute peak value 1. Default is true.

zeroOffset

a Boolean indicating whether to offset the middle of each polynomial to zero. If true, then a zero input will always result in a zero output when used as a waveshaper. If false, then the "raw" (unshifted) Chebyshev polynomials are used. Default is false.

Discussion:

NOTE: In previous versions, chebyFill always offset the curves to ensure the center value was zero. The zeroOffset argument was added in version 3.7, and the default behavior was changed, so that it no longer offsets.

Signal.hanningWindow(size, pad: 0)

Fill a Signal of the given size with a Hanning window.

Arguments:

size

the number of samples in the Signal.

pad

the number of samples of the size that is zero padding.

Signal.hammingWindow(size, pad: 0)

Fill a Signal of the given size with a Hamming window.

WARNING: In versions of SuperCollider before 3.11, the implementation of Signal.hammingWindow had incorrect coefficients. To get the old behavior back, use Signal.hammingWindow_old.

Arguments:

size

the number of samples in the Signal.

pad

the number of samples of the size that is zero padding.

Signal.welchWindow(size, pad: 0)

Fill a Signal of the given size with a Welch window.

Arguments:

size

the number of samples in the Signal.

pad

the number of samples of the size that is zero padding.

Signal.rectWindow(size, pad: 0)

Fill a Signal of the given size with a rectangular window.

Arguments:

size

the number of samples in the Signal.

pad

the number of samples of the size that is zero padding.

Signal.fftCosTable(fftsize)

Fourier Transform: Fill a Signal with the cosine table needed by the FFT methods. See also the instance methods -fft and -ifft.

Signal.hammingWindow_old(size, pad: 0)

This used to be Signal.hammingWindow, but the coefficients were incorrect (making it a different window in the generalized Hamming window family). It is provided to assist in porting code to 3.11 and later.

Ambisonic Toolkit

Signal.hoaDist: METHOD NOT FOUND!

Return an Array of Higher Order Ambisonic signal (HOA) near-field effect (NFE), distance radial filters collected by Associated Legendre degree (ℓ).

Arguments:

size

The number of samples in the Signals.

radius

Radius, in meters.

order

Ambisonic order.

sampleRate

Sample rate, in Hz.

speedOfSound

Speed of sound, in meters per second.

Discussion:

Offers FIR coefficients, equivalent to the IIR coefficients returned by NFECoeffs: -dist. Implemented as a frequency sampling design, with coefficients returned by HoaOrder: -distWeights. See also: FreqSpectrum: *hoaDist.

NOTE: In most cases, users will use the high level near-field effect (NFE) pseudo-UGen: HoaNFDist.

Signal.hoaCtrl: METHOD NOT FOUND!

Return an Array of Higher Order Ambisonic signal (HOA) near-field effect (NFE), control radial filters collected by Associated Legendre degree (ℓ).

Arguments:

size

The number of samples in the Signals.

encRadius

Encoding radius, in meters.

decRadius

Decoding radius, in meters.

order

Ambisonic order.

sampleRate

Sample rate, in Hz.

speedOfSound

Speed of sound, in meters per second.

Discussion:

Offers FIR coefficients, equivalent to the IIR coefficients returned by NFECoeffs: -ctrl. Implemented as a frequency sampling design, with coefficients returned by HoaOrder: -ctrlWeights. See also: FreqSpectrum: *hoaCtrl.

NOTE: In most cases, users will use the high level near-field effect (NFE) pseudo-UGen: HoaNFCtrl.

Signal.hoaFocl: METHOD NOT FOUND!

Return an Array of Higher Order Ambisonic signal (HOA) near-field effect (NFE), focalisation radial filters collected by Associated Legendre degree (ℓ).

Arguments:

size

The number of samples in the Signals.

radius

Radius, in meters.

order

Ambisonic order.

window

Angular weighting window.

\regRegularised1
\hp(Butterworth) High Pass2
\cosCosine3
\sinSine4
sampleRate

Sample rate, in Hz.

speedOfSound

Speed of sound, in meters per second.

Discussion:

Offers FIR coefficients; implemented as a linear phase frequency sampling design, with coefficients returned by HoaOrder: -foclWeights. See also: FreqSpectrum: *hoaFocl.

Signal.hoaMultiBandFocl: METHOD NOT FOUND!

Return an Array of Higher Order Ambisonic signal (HOA) filters combining multi-band beamforming and near-field effect (NFE) focalisation, collected by Associated Legendre degree (ℓ).

Arguments:

size

The number of samples in the Signals.

radius

Radius, in meters. Set to nil to exclude focalisation.

beamDict

A dictionary specifying beam shapes and edge frequencies.

See Beaming & Decoder Matching and discussion below.

dim

The number of dimensions: 2D or 3D.

match

Matching criteria, see Beaming & Decoder Matching:

\amppressure (loudspeaker sum)
\rmsspherical harmonic energy
\energyloudspeaker energy

NOTE: Prepend f to include focalisation in normalisation. E.g., \frms.
numChans

Number of loudspeakers.

NOTE: Must be set when choosing match: \energy.
order

Ambisonic order.

window

Focalisation angular weighting window. See *hoaFocl.

NOTE: Ignored if radius is set to nil.
sampleRate

Sample rate, in Hz.

speedOfSound

Speed of sound, in meters per second.

Discussion:

Offers FIR coefficients; implemented as a linear phase frequency sampling design, with coefficients returned by *logShelf and *hoaFocl. See also: FreqSpectrum: *hoaMultiBandFocl for design examples.

Windows from ExtraWindows Quark

For more information, check out the Guide: ExtraWindows

Signal.bartlettWindow: METHOD NOT FOUND!

Fill a Signal of the given size with a Bartlett/triangular window.

Arguments:

size

the number of samples in the Signal.

pad

the number of samples of the size that is zero padding.

sym

a Boolean indicating whether the window is symmetric or periodic. Default is false.

Signal.blackmanHarrisWindow: METHOD NOT FOUND!

Fill a Signal of the given size with a Blackman-Harris window.

Arguments:

size

the number of samples in the Signal.

pad

the number of samples of the size that is zero padding.

sym

a Boolean indicating whether the window is symmetric or periodic. Default is false.

Signal.blackmanNuttallWindow: METHOD NOT FOUND!

Fill a Signal of the given size with a Blackman-Nuttall window.

Arguments:

size

the number of samples in the Signal.

pad

the number of samples of the size that is zero padding.

sym

a Boolean indicating whether the window is symmetric or periodic. Default is false.

Signal.gaussianWindow: METHOD NOT FOUND!

Fill a Signal of the given size with a Gaussian window.

Arguments:

size

the number of samples in the Signal.

pad

the number of samples of the size that is zero padding.

a

the inverse of standard deviation (width) of the Gaussian. Higher means narrower; analogous to quality factor.

sym

a Boolean indicating whether the window is symmetric or periodic. Default is false.

Signal.hanningWindow(size, pad: 0)

Fill a Signal of the given size with a Hanning window. Overwrote SCClassLibrary to have the symmetry argument.

Arguments:

size

the number of samples in the Signal.

pad

the number of samples of the size that is zero padding.

(sym)

a Boolean indicating whether the window is symmetric or periodic. Default is false.

Signal.hammingWindow(size, pad: 0)

Fill a Signal of the given size with a Hamming window. Overwrote SCClassLibrary to have the symmetry argument.

Arguments:

size

the number of samples in the Signal.

pad

the number of samples of the size that is zero padding.

(sym)

a Boolean indicating whether the window is symmetric or periodic. Default is false.

Signal.hannWindow: METHOD NOT FOUND!

Synonymous with hanningWindow method with the extra symmetry argument.

Arguments:

size

the number of samples in the Signal.

pad

the number of samples of the size that is zero padding.

sym

a Boolean indicating whether the window is symmetric or periodic. Default is false.

Signal.kaiserWindow: METHOD NOT FOUND!

Fill a Signal of the given size with a Kaiser window.

Arguments:

size

the number of samples in the Signal.

pad

the number of samples of the size that is zero padding.

a

the alpha value. Reduces to rectangular window at zero and narrows at higher values. Parameterized as described here: https://ccrma.stanford.edu/~jos/sasp/Kaiser_Window.html

sym

a Boolean indicating whether the window is symmetric or periodic. Default is false.

Signal.lanczosWindow: METHOD NOT FOUND!

Fill a Signal of the given size with a Lanczos window.

Arguments:

size

the number of samples in the Signal.

pad

the number of samples of the size that is zero padding.

sym

a Boolean indicating whether the window is symmetric or periodic. Default is false.

Signal.tukeyWindow: METHOD NOT FOUND!

Fill a Signal of the given size with a Tukey window (tapered-cosine window).

Arguments:

size

the number of samples in the Signal.

pad

the number of samples of the size that is zero padding.

a

the alpha value. At 0, reduces to Hann window. At 1, reduces to rectangular. Default to 0.5.

sym

a Boolean indicating whether the window is symmetric or periodic. Default is false.

Signal.rfftCosTable: METHOD NOT FOUND!

Fourier Transform: Fill a Signal with the cosine table needed by the Real-FFT methods. See also the instance methods -rfft and -irfft.

Signal.rfftTwoCosTable: METHOD NOT FOUND!

Fourier Transform: Fill a Signal with the cosine table needed by the Real-FFT-Two methods. See also the instance methods -rfftTwo and -irfftTwo.

Signal.cosineFill: METHOD NOT FOUND!

Fill a Signal of the given size with a sum of cosines at the given amplitudes and phases. The Signal will be normalized.

Arguments:

size

the number of samples in the Signal.

amplitudes

an Array of amplitudes for each harmonic beginning with the fundamental.

phases

an Array of phases in radians for each harmonic beginning with the fundamental.

Signal.packetFill: METHOD NOT FOUND!

Fill a Signal of the given size with a sum of Hann enveloped cosines at the given amplitudes and phases. The Signal will be normalized.

Arguments:

size

the number of samples in the Signal.

amplitudes

an Array of amplitudes for each harmonic beginning with the fundamental.

phases

an Array of phases in radians for each harmonic beginning with the fundamental.

Signal.zeroFill: METHOD NOT FOUND!

Fill a Signal of the given size with zeros. A synonym for *newClear.

Arguments:

size

the number of samples in the Signal.

Signal.read: METHOD NOT FOUND!

Read a soundfile.

Arguments:

path

a String representing the path of the soundfile to be read.

size

the number of samples. If size is nil, defaults to the soundfile's number of frames.

startFrame

the first frame of the soundfile to read. The default is 0, which is the beginning of the file. May be a negative number, which indicates the number of zeros to fill before reading the soundfile.

channel

soundfile channel to read. The default is 0, the first channel.

Signal.readWave: METHOD NOT FOUND!

Read a periodic waveform from a soundfile.

Arguments:

path

a String representing the path of the soundfile to be read.

size

the number of samples. If size is nil, return a waveform of the original number of samples at the soundfile sample rate.

frame

center frame of the soundfile about which to read. I.e., the synthesis window is centered on this frame. The default is 0, which is the beginning of the file.

channel

soundfile channel to read. The default is 0, the first channel.

freq

analysis frequency of the waveform, in Hz. The default is 440 Hz.

alpha

Kaiser window alpha. The default is 3.

winScale

power of two scaling coefficient for the window size. The default is 1.

Discussion:

freq

Successful synthesis of a periodic waveform from a soundfile depends largely on closely estimating the frequency of the waveform. The folding frequency of the Kaiser synthesis window is mapped to this analysis frequency.

alpha

Time domain smoothing is directly specified by the Kaiser window alpha. Choosing alpha = 0; winScale = 0 specifies a rectangular window, and allows us to view an unsmoothed period of the source waveform. Higher values of alpha mean more time domain smoothing.

NOTE: An unsmoothed waveform will usually result in unintended distortion artifacts when used as a Wavetable.

winScale

The window scale argument scales the Kaiser window folding frequency with respect to the period of the waveform, like this:

winScalewaveform periods
12
01
-10.5

The default, winScale = 1, is optimimal in the sense that frequency domain artifacts are relected furthest from the harmonics of the periodic waveform of interest, without excessive oversampling.

Signal.readPacket: METHOD NOT FOUND!

Read a Hann enveloped wave packet from a soundfile.

Arguments:

path

a String representing the path of the soundfile to be read.

size

the number of samples. If size is nil, return a wave packet of the original number of samples at the soundfile sample rate.

frame

center frame of the soundfile about which to read. I.e., the synthesis window is centered on this frame. The default is 0, which is the beginning of the file.

channel

soundfile channel to read. The default is 0, the first channel.

freq

analysis frequency of the waveform, in Hz. The default is 440 Hz.

alpha

Kaiser window alpha. The default is 3.

winScale

power of two scaling coefficient for the window size. The default is 1.

Discussion:

See *readWave discussion above.

Signal.windowedSinc: METHOD NOT FOUND!

Return a rectangular windowed sinc filter kernel.5

Arguments:

size

the number of samples in the Signal.

freq

the cutoff frequeny, in Hz.

sampleRate

sample rate, in Hz.

Signal.logShelf: METHOD NOT FOUND!

Return a log shelf filter kernel.6 See also: FreqSpectrum: *logShelf.

Arguments:

size

the number of samples in the Signal.

freq0

the frequeny, at which to begin transition from gainDC to gainNy, in Hz.

freq1

the frequeny, at which to end transition from gainDC to gainNy, in Hz.

gainDC

the gain at DC, in dB.

gainNy

the gain at Nyquist, in dB.

phase

phase response.

\linlinear phase
\minminimum (system) phase
sampleRate

sample rate, in Hz.

Signal.gaussianBank: METHOD NOT FOUND!

Return an Array of gaussian windowed filter kernels.

Arguments:

size

the number of samples in the Signals.

freqs

the cross-over frequenies, in Hz.

alpha

window smoothing coefficient

= 1ideal bandwidth
> 1flatter response, greater side band rejection
< 1smoother response, less side band rejection
sampleRate

sample rate, in Hz.

Noise

Signal.gaussianNoise: METHOD NOT FOUND!

Return gaussian white noise, with a mean of 0 and standard deviation of 1.

See also SimpleNumber: -gauss.

Arguments:

size

the number of samples in the Signal.

Signal.periodicPLNoise: METHOD NOT FOUND!

Return periodic power-law noise, aka fractional noise. Magnitude at Nyquist is normalized to 1.

Arguments:

size

the number of samples in the Signal.

beta

power spectral density.

colorbetadB / octave
brown2-6
pink1-3
white00
blue-1+3
violet-2+6

Chirps

Signal.cosineChirp: METHOD NOT FOUND!

Return a rectangular windowed sinus power-law chirp.7

Arguments:

size

the number of samples in the Signal.

freq0

initial frequeny, in Hz.

freq1

final frequeny, in Hz.

phase

initial phase, in radians.

beta

power spectral density.

colorbetadB / octave
brown2-6
pink1-3
white00
blue-1+3
violet-2+6
sampleRate

sample rate, in Hz.

Discussion:

Synthesized in the time domain.

Signal.sineChirp: METHOD NOT FOUND!

Return a rectangular windowed sinus power-law chirp.

Arguments:

size

the number of samples in the Signal.

freq0

initial frequeny, in Hz.

freq1

final frequeny, in Hz.

phase

initial phase, in radians.

beta

power spectral density.

colorbetadB / octave
brown2-6
pink1-3
white00
blue-1+3
violet-2+6
sampleRate

sample rate, in Hz.

Discussion:

Synthesized in the time domain.

Signal.analyticChirp: METHOD NOT FOUND!

Return a rectangular windowed complex analytic sinus power-law chirp.

Arguments:

size

the number of samples in the Signal.

freq0

initial frequeny, in Hz.

freq1

final frequeny, in Hz.

phase

initial phase, in radians.

beta

power spectral density.

colorbetadB / octave
brown2-6
pink1-3
white00
blue-1+3
violet-2+6
sampleRate

sample rate, in Hz.

Discussion:

Synthesized in the time domain.

Analytic & Hilbert

Signal.analyticFill: METHOD NOT FOUND!

Return a complex analytic Signal of the given size with a sum of cosines and a sum of sines at the given amplitudes and phases. The Signal will be normalized.

Arguments:

size

the number of samples in the Signal.

amplitudes

an Array of amplitudes for each harmonic beginning with the fundamental.

phases

an Array of phases in radians for each harmonic beginning with the fundamental.

Signal.hilbert: METHOD NOT FOUND!

Hilbert Transform: Return complex Hilbert Transform coefficients.

Arguments:

size

the number of samples in the Signal.

pad

the number of samples of the size that is zero padding.

sym

a Boolean indicating whether the window is symmetric or periodic. Default is false.

Waveshaping

Signal.shaperT: METHOD NOT FOUND!

Performs waveshaping of a cosine wave by indexing into the supplied table, returning a sum of cosine waves.

NOTE: Useful to predict waveshapes returned by Shaper.

Arguments:

size

the number of samples in the Signal.

tableT

a Signal filled with a sum of Chebyshev polynomials of the first kind

index

waveshaping index of modulation: 0.0 - 1.0

Discussion:

Signal.shaperU: METHOD NOT FOUND!

Performs waveshaping of a cosine wave by indexing into the supplied table, followed by multiplication with a sine wave. Returns a sum of sine waves.

NOTE: Useful to predict waveshapes returned by Shaper.

Arguments:

size

the number of samples in the Signal.

tableU

a Signal filled with a sum of Chebyshev polynomials of the second kind

index

waveshaping index of modulation: 0.0 - 1.0

Discussion:

Signal.shaperTU: METHOD NOT FOUND!

Performs quadrature waveshaping of an analytic cosine wave by indexing into the supplied tables. Returns a sum of cosine and sine waves.

NOTE: Useful to predict waveshapes returned by Shaper.

Arguments:

size

the number of samples in the Signal.

tableTU

an array of two Signal, the first being filed with a sum of Chebyshev polynomials of the first kind, and the second, of the second kind

index

waveshaping index of modulation: 0.0 - 1.0

Discussion:

Signal.chebyTFill: METHOD NOT FOUND!

Fill a Signal of the given size with a sum of Chebyshev polynomials of the first kind at the given amplitude scaling. For use in waveshaping with Shaper.

When a cosine wave is waveshaped, a sum of cosines is returned.

NOTE: A synonym of *chebyFill, but does not include an argument for zeroOffset. If this feature is required, see -normalizeTransfer.

Arguments:

size

the number of samples in the Signal.

amplitudes

an Array of amplitudes for each Chebyshev polynomial of the first kind beginning with order 1.

normalize

a Boolean indicating whether to normalize the resulting Signal to an absolute peak value of 1.

Discussion:

Signal.chebyUFill: METHOD NOT FOUND!

Fill a Signal of the given size with a sum of Chebyshev polynomials of the second kind at the given amplitude scaling. For use in waveshaping with Shaper.

When a cosine wave is waveshaped and ring modulated by a sine wave, a sum of sines is returned.

NOTE: Does not include an argument for zeroOffset. If this feature is required, see -normalizeTransfer.

Arguments:

size

the number of samples in the Signal.

amplitudes

an Array of amplitudes for each Chebyshev polynomial of the second kind beginning with order 0.

normalize

a Boolean indicating whether to normalize the resulting Signal to an absolute peak value of 1.

Discussion:

Signal.chebyTUFill: METHOD NOT FOUND!

Return an array of two Signals of the given size. The first signal is a sum of Chebyshev polynomials of the first kind, while the second is a sum of the second kind. Given quadrature waveshaping, the returned signal will include partials of the specified amplitude scaling and phase.

For use in waveshaping with Shaper.

NOTE: Does not include an argument for zeroOffset. -normalizeTransfer is inappropriate for quadrature waveshaping.

Arguments:

size

the number of samples in the two Signals.

amplitudes

an Array of amplitudes for each harmonic beginning with the fundamental.

phases

an Array of phases in radians for each harmonic beginning with the fundamental.

normalize

a Boolean indicating whether to normalize the resulting Signal to an absolute peak value of 1.

Discussion:

Signal.chebyTUFill2: METHOD NOT FOUND!

Return an array of two Signals of the given size. The first signal is a sum of Chebyshev polynomials of the first kind, while the second is a sum of the second kind. Given quadrature waveshaping, the returned signal will include partials of the specified amplitude scaling and phase.

For use in waveshaping with Shaper.

NOTE: Does not include an argument for zeroOffset. -normalizeTransfer is inappropriate for quadrature waveshaping.

Arguments:

size

the number of samples in the two Signals.

list

a rank 2 collection containing harmonic numbers, amplitudes and phases.

normalize

a Boolean indicating whether to normalize the resulting Signal to an absolute peak value of 1.

Discussion:

Inherited class methods

Undocumented class methods

Signal.readNew(file)

Instance Methods

.plot(name, bounds, discrete: false, numChannels, minval, maxval, separately: true, parent)

From superclass: ArrayedCollection

Plot the Signal in a window. The arguments are not required and if not given defaults will be used.

For details, see plot

.play(loop: false, mul: 0.2, numChannels: 1, server)

Loads the signal into a buffer on the server and plays it. Returns the buffer so you can free it again.

Arguments:

loop

A Boolean whether to loop the entire signal or play it once. Default is false.

mul

volume at which to play it, 0.2 by default.

numChannels

if the signal is an interleaved multichannel file, number of channels, default is 1.

server

the server on which to load the signal into a buffer.

.waveFill(function, start: 0.0, end: 1.0)

Fill the Signal with a function evaluated over an interval.

Arguments:

function

a function that should calculate the value of a sample.

The function is called with three arguments:

x
the value along the interval.
old
the old value (if the signal is overwritten)
i
the sample index.

As arguments, three values are passed to the function: the current input value (abscissa), the old value (if the signal is overwritten), and the index.

start

the starting value of the interval.

end

the ending value of the interval.

.asWavetable

Convert the Signal into a Wavetable.

.fill(val)

Fill the Signal with a value.

.scale(scale)

Scale the Signal by a factor in place.

.offset(offset)

Offset the Signal by a value in place.

.peak

Return the peak absolute value of a Signal.

.normalize(beginSamp: 0, endSamp)

Normalize the Signal in place such that the maximum absolute peak value is 1.

.normalizeTransfer

Normalizes a transfer function so that the center value of the table is offset to zero and the absolute peak value is 1. Transfer functions are meant to be used in the Shaper ugen.

.invert(beginSamp: 0, endSamp)

Invert the Signal in place.

.reverse(beginSamp: 0, endSamp)

Reverse a subrange of the Signal in place.

.fade(beginSamp: 0, endSamp, beginLevel: 0.0, endLevel: 1.0)

Fade a subrange of the Signal in place.

.integral

Return the integral of a signal.

.overDub(aSignal, index: 0)

Add a signal to myself starting at the index. If the other signal is too long only the first part is overdubbed.

.overWrite(aSignal, index: 0)

Write a signal to myself starting at the index. If the other signal is too long only the first part is overdubbed.

.blend(that, blendFrac: 0.5)

Blend two signals by some proportion.

Fourier Transform

.fft(imag, cosTable)

Perform an FFT on a real and imaginary signal in place. See also the class method *fftCosTable.

.ifft(imag, cosTable)

Perform an inverse FFT on a real and imaginary signal in place. See also the class method *fftCosTable.

.fftToRfft: METHOD NOT FOUND!

Return a complex Real-FFT spectrum from a complex FFT spectrum. See also the instance method -rfftToFft.

.rfft: METHOD NOT FOUND!

Perform a Real-FFT on a real signal.8 See also the class method *rfftCosTable.

.irfft: METHOD NOT FOUND!

Perform an inverse Real-FFT on a real and imaginary signal. See also the class method *rfftCosTable.

.rfftToFft: METHOD NOT FOUND!

Return a complex FFT spectrum from a complex Real-FFT spectrum. See also the instance method -fftToRfft.

.rfftTwo: METHOD NOT FOUND!

Perform a Real-FFT on two real signals. See also the class method *rfftTwoCosTable.

.irfftTwo: METHOD NOT FOUND!

Perform an inverse Real-FFT on two real and imaginary signals. See also the class method *rfftTwoCosTable.

.harmsAmpsPhases: METHOD NOT FOUND!

Returns a rank 2 List containing harmonic numbers, amplitudes and phases, suitable for use with -sineFill2, -cosineFill2 and -packetFill2.

NOTE: Performs a Real-FFT. See also -rfft.

Arguments:

cosTable

See class method *rfftCosTable.

maxHarms

Maximum number of harmonic ratios to return.

mindb

Discard harmonics below, with respect to peak.

basis

Basis function: \sine or \cosine.

.dft: METHOD NOT FOUND!

Perform a DFT on a real and imaginary signal.

NOTE: size is not restricted to a power of two.

Arguments:

imag

imaginary signal.

method
'czt'Chirp z-Transform
'dir'evaluate directly

.idft: METHOD NOT FOUND!

Perform an inverse DFT on a real and imaginary signal.

NOTE: size is not restricted to a power of two.

Arguments:

imag

imaginary signal.

method
'czt'Chirp z-Transform
'dir'evaluate directly

.dftZoom: METHOD NOT FOUND!

Perform a Zoom DFT on a real and imaginary signal.

NOTE: Signal.size is not restricted to a power of two.

Arguments:

imag

imaginary signal.

zoomsize

the number of coefficients to return.

k0

lowest DFT coefficient. Not required to be an integer.

k1

highest DFT coefficient. Not required to be an integer.

.rdftZoom: METHOD NOT FOUND!

Perform a Zoom DFT on a real signal.

NOTE: Signal.size is not restricted to a power of two.

Arguments:

zoomsize

the number of coefficients to return.

k0

lowest DFT coefficient. Not required to be an integer.

k1

highest DFT coefficient. Not required to be an integer.

.goertzel: METHOD NOT FOUND!

Return individual terms of a DFT on a real and imaginary signal.9

NOTE: Signal.size is not restricted to a power of two.

Arguments:

imag

imaginary signal.

k

DFT coefficient(s) as a single value or an Array. Not required to be an integer.

method
'iir'Goertzel's algorithm
'dir'evaluate directly
'czt'Chirp z-Transform

.rgoertzel: METHOD NOT FOUND!

Return individual terms of a DFT on a real signal.

NOTE: Signal.size is not restricted to a power of two.

Arguments:

k

DFT coefficient(s) as a single value or an Array. Not required to be an integer.

method
'iir'Goertzel's algorithm
'dir'evaluate directly
'czt'Chirp z-Transform

Unary Messages

Signal will respond to unary operators by returning a new Signal.

.neg

.abs

.sign

.squared

.cubed

.sqrt

.exp

.log

.log2

.log10

.sin

.cos

.tan

.asin

.acos

.atan

.sinh

.cosh

.tanh

.distort

.softclip

.isPositive

From superclass: SequenceableCollection

.isNegative

From superclass: SequenceableCollection

.isStrictlyPositive

From superclass: SequenceableCollection

.flip: METHOD NOT FOUND!

The flip operator.10

Binary Messages

Signal will respond to binary operators by returning a new Signal.

.thresh(aNumber)

Thresholding replaces every value < threshold with 0.

NOTE: Before SuperCollider 3.13 this function was implemented incorrectly, evaluating the square of provided threshold. This behavior is now fixed, but note that older code might give different results.

+(aNumber)

-(aNumber)

*(aNumber)

/(aNumber)

.div(aNumber)

.pow(aNumber)

.mod(aNumber)

.min(aNumber)

.max(aNumber)

.ring1(aNumber)

.ring2(aNumber)

.ring3(aNumber)

.ring4(aNumber)

.difsqr(aNumber)

.sumsqr(aNumber)

.sqrdif(aNumber)

.absdif(aNumber)

.amclip(aNumber)

.scaleneg(aNumber)

.clip2(aNumber: 1)

.wrap2(aNumber: 1)

.excess(aNumber: 1)

%(that)

From superclass: Object

**(that)

From superclass: Object

<!(that)

From superclass: Object

Extensions by MathLib

.thresh2: METHOD NOT FOUND!

Bilateral thresholding.

Arguments:

thresh

When the input.abs < thresh, the output is forced to 0. Should be a positive value.

adverb

Optional, for processing Collections. See Adverbs for Binary Operators.

Discussion:

.addCosine: METHOD NOT FOUND!

Add a single cosine to myself with the given harmonic, amplitude and phase.

.cosineFill: METHOD NOT FOUND!

A sum of cosines with the given amplitudes and phases, returned in place.

Arguments:

amplitudes

an Array of amplitudes for each harmonic beginning with the fundamental.

phases

an Array of phases in radians for each harmonic beginning with the fundamental.

.cosineFill2: METHOD NOT FOUND!

A sum of cosines with the given harmonics, amplitudes and phases, returned in place.

Arguments:

list

a rank 2 collection containing harmonic numbers, amplitudes and phases.

.packetFill: METHOD NOT FOUND!

A sum of Hann enveloped cosines at the given amplitudes and phases, returned in place.

Arguments:

amplitudes

an Array of amplitudes for each harmonic beginning with the fundamental.

phases

an Array of phases in radians for each harmonic beginning with the fundamental.

.packetFill2: METHOD NOT FOUND!

A sum of Hann enveloped cosines with the given harmonics, amplitudes and phases, returned in place.

Arguments:

list

a rank 2 collection containing harmonic numbers, amplitudes and phases.

.wavePacket: METHOD NOT FOUND!

Given a periodic waveform, returns a Hann enveloped wave packet. The receiver is unchanged.

.cola: METHOD NOT FOUND!

Given a superposition density window, returns a constant-overlap-add (COLA) window.11 The receiver is unchanged.

.wrapExtend: METHOD NOT FOUND!

Returns a new Signal whose elements are repeated sequences of the receiver, up to size length. The receiver is unchanged.

.resize: METHOD NOT FOUND!

Returns a new Signal resampled in the frequency domain to a new size. The receiver is unchanged.

.discardDC: METHOD NOT FOUND!

Remove the DC component the Signal in place.

.writeFile(path, columnSeparator: $ , rowSeparator: $\n)

From superclass: SequenceableCollection

Writes the entire Signal to a file, where every chunk of four bytes is a 32-bit floating point sample.

.write: METHOD NOT FOUND!

Writes the entire Signal to a soundfile.

Arguments:

path

a String representing the path of the soundfile to be written.

headerFormat

a String for the soundfile format. Valid strings are listed at SoundFile: -headerFormat. If not given, the default "AIFF" is used.

sampleFormat

a String for the sample format. Valid strings are listed at SoundFile: -sampleFormat. If not given, the default "float" is used.

sampleRate

an Integer sample rate (44100 by default).

Convolution

.convolve: METHOD NOT FOUND!

Convolve myself with a signal.

Arguments:

aSignal

the multiplier.

method
'fft'Radix-2 Discrete Fourier Transform
'dft'Discrete Fourier Transform
'dir'evaluate directly

.periodicConvolve: METHOD NOT FOUND!

Periodic convolve myself with a signal.

Arguments:

aSignal

the multiplier.

method
'fft'Radix-2 Discrete Fourier Transform
'dft'Discrete Fourier Transform
'dir'evaluate directly

.partConvolve: METHOD NOT FOUND!

Partition convolve myself with a signal.

Arguments:

aSignal

the multiplier.

size

the partition size.

method
'fft'Radix-2 Discrete Fourier Transform
'dft'Discrete Fourier Transform
'dir'evaluate directly

.estimateFreq: METHOD NOT FOUND!

Estimate periodic frequency via autocorrelation in the time domain.

Returns an array, the first element is the estimated periodic frequency, while the second is the correlation coefficient.

NOTE: Useful to use in conjunction with *readWave or *readPacket.

Arguments:

frame

center frame about which to read. I.e., the analysis window is centered on this frame. The default is 0.

freq

analysis frequency of the expected periodic waveform, in Hz. The default is 440 Hz.

q

analysis search bandwidth quality factor. I.e., a Q of 1.0 means search across an octave. The default is 3.0, a 1/3rd of an octave.

order

the order of the moving average comb filter. An order of 0 means no periodic averaging; 1 averages 2 periods, and so on. The default is 1.

thresh

correlation coefficient precision threshold. Larger values decrease precision for determining correlation = 1. The default is 0.001.

sampleRate

sample rate, in Hz.

Discussion:

Autocorrelation can often return frequency estimates that are related to a periodic signal's fundamental frequency, but are off by an integer ratio, very commonly, an octave. If the expected analysis frequency is close to that of the signal under test, a correct result is more likely to be returned. Additionally, increasing the order of the moving average comb filter can improve results. Noisy signal estimation tends to improve with higher orders, as well.

If the period of the signal under test is not stationary, the returned correlation coefficient will be reduced, in which case the returned frequency will be the estimated average across the complete analysis window.

NOTE: Autocorrelation in the time domain has greater resolution at low frequencies than at high frequencies. As a result, a lower search bandwidth quality factor, q, may be required for returning high frequency estimations. Low q means more estimates.

Analytic & Complex

.analytic: METHOD NOT FOUND!

Hilbert Transform: Return a complex analytic signal from a real signal.12

.instaneousFreq: METHOD NOT FOUND!

Return the instantaneous frequency from a real signal.13

Arguments:

mindb

a minimum value in dB to clip amplitude response to. Prevents singularities.

sampleRate

sample rate, in Hz.

.complex: METHOD NOT FOUND!

Return a complex signal with the given real and imaginary parts.

Rotation & Phase

.rotateWave: METHOD NOT FOUND!

Rotate the Signal by a value in radians, in place.

NOTE: The signal is regarded as one period of a waveform.

.rotatePhase: METHOD NOT FOUND!

Rotate the phase of Signal by a value in radians, in place.

.linearPhase: METHOD NOT FOUND!

Return a linear phase kernel, preserving the magnitude, in place.

Arguments:

sym

a Boolean indicating whether the window is symmetric or periodic. Default is false.

.minimumPhase: METHOD NOT FOUND!

Return a minimum phase kernel, preserving the magnitude, in place.14

Arguments:

mindb

a minimum value in dB to clip amplitude response to. Reduces time aliasing.

oversample

time oversampling scale factor. May be a float or an integer. Reduces time aliasing.

.gaussianPhase: METHOD NOT FOUND!

Return a gaussian noise phase kernel, preserving the magnitude, in place.

.even

From superclass: SequenceableCollection

Return the even part of a signal.15

.odd

From superclass: SequenceableCollection

Return the odd part of a signal.

RMS & Magnitude

.rms: METHOD NOT FOUND!

Return the RMS of a signal.

.peakMagnitude: METHOD NOT FOUND!

Return the peak of the frequency domain magnitude of a signal.

Arguments:

oversample

time oversampling scale factor. May be a float or an integer.

.normalizeMagnitude: METHOD NOT FOUND!

Normalize the Signal in place such that the maximum magnitude in the frequency domain is 1.

Arguments:

oversample

time oversampling scale factor. May be a float or an integer.

Cepstrum

.rceps: METHOD NOT FOUND!

Return the real part of the cepstrum of a real signal.16

.irceps: METHOD NOT FOUND!

Return the real part of the inverse of the real part of the cepstrum.

Chirp z-Transform

.czt: METHOD NOT FOUND!

Perform a Chirp z-Transform on a real and imaginary signal.17

Arguments:

imag

imaginary signal.

cwtsize

the number of coefficients to return. Defaults to this.size.

step

ratio between points along the z-plane spiral contour of interest. Defaults to (0.0.complex(-2pi/cwtsize)).exp.

start

complex starting point on that contour. Defaults to 1.

NOTE: The default nil values of cwtsize, step, and start return the DFT.

.rczt: METHOD NOT FOUND!

Perform a Chirp z-Transform on a real signal.

Arguments:

cwtsize

the number of coefficients to return. Defaults to this.size.

step

ratio between points along the z-plane spiral contour of interest. Defaults to (0.0.complex(-2pi/cwtsize)).exp.

start

complex starting point on that contour. Defaults to 1.

NOTE: The default nil values of cwtsize, step, and start return the DFT.

Waveshaping

.shaper: METHOD NOT FOUND!

Synonym for -shaperT.

.shaperT: METHOD NOT FOUND!

Waveshape the signal by indexing into the supplied table.

If the signal is a single cosine, a sum of cosines will be returned.

NOTE: Useful to predict waveshapes returned by Shaper.

Arguments:

tableT

a Signal filled with a sum of Chebyshev polynomials of the first kind

index

waveshaping index of modulation: 0.0 - 1.0

Discussion:

.shaperU: METHOD NOT FOUND!

Waveshape the signal by indexing into the supplied table.

If the signal is a single cosine and imag a sine, a sum of sines will be returned.

NOTE: Useful to predict waveshapes returned by Shaper.

Arguments:

imag

the imaginary part of a complex analytic signal. This may be returned from the signal via -analytic.

tableU

a Signal filled with a sum of Chebyshev polynomials of the second kind

index

waveshaping index of modulation: 0.0 - 1.0

Discussion:

.shaperTU: METHOD NOT FOUND!

Quadrature waveshape the signal by indexing into the supplied tables.

If the signal is a single cosine and imag a sine, a sum of sines and cosines will be returned.

NOTE: Useful to predict waveshapes returned by Shaper.

Arguments:

imag

the imaginary part of a complex analytic signal. This may be returned from the signal via -analytic.

tableTU

an array of two Signal, the first being filed with a sum of Chebyshev polynomials of the first kind, and the second, of the second kind

index

waveshaping index of modulation: 0.0 - 1.0

Discussion:

.normalizeShaper: METHOD NOT FOUND!

Synonym for -normalizeShaperT.

.normalizeShaperT: METHOD NOT FOUND!

Given a Signal filled with a sum of Chebyshev polynomials of the first kind, return a table to normalize the amplitude or power of a waveshaped result returned by Shaper.

Arguments:

normalize

a keyword indicating whether to normalize \peak or \rms. Default is \peak.

discardDC

a Boolean indicating whether to discard DC before normalizing or not. Default is false.

NOTE: If true, follow Shaper with a highpass filter.

Discussion:

.normalizeShaperU: METHOD NOT FOUND!

Given a Signal filled with a sum of Chebyshev polynomials of the second kind, return a table to normalize the amplitude or power of a waveshaped result returned by Shaper.

Arguments:

normalize

a keyword indicating whether to normalize \peak or \rms. Default is \peak.

discardDC

a Boolean indicating whether to discard DC before normalizing or not. Default is false.

NOTE: If true, follow Shaper with a highpass filter.

Discussion:

.normalizeShaperTU: METHOD NOT FOUND!

Given a Signal filled with a sum of Chebyshev polynomials of the first kind, and another filled with a sum of Chebyshev polynomials of the second kind, return a table to normalize the amplitude or power of a waveshaped result returned by Shaper.

Arguments:

tableU

a Signal filled with a sum of Chebyshev polynomials of the second kind.

normalize

a keyword indicating whether to normalize \peak or \rms. Default is \peak.

discardDC

a Boolean indicating whether to discard DC before normalizing or not. Default is false.

NOTE: If true, follow Shaper with a highpass filter.

Discussion:

.addChebyshevT: METHOD NOT FOUND!

Add a single Chebyshev polynomials of the first kind to myself with the given harmonic and amplitude scaling.

.addChebyshevU: METHOD NOT FOUND!

Add a single Chebyshev polynomials of the second kind to myself with the given harmonic and amplitude scaling.

.chebyTFill: METHOD NOT FOUND!

Fill a Signal of the given size with a sum of Chebyshev polynomials of the first kind at the given amplitude scaling. For use in waveshaping with Shaper.

When a cosine wave is waveshaped, a sum of cosines is returned.

NOTE: A synonym of *chebyFill, but does not include an argument for zeroOffset. If this feature is required, see -normalizeTransfer.

Discussion:

.chebyUFill: METHOD NOT FOUND!

Fill a Signal of the given size with a sum of Chebyshev polynomials of the second kind at the given amplitude scaling. For use in waveshaping with Shaper.

When a cosine wave is waveshaped and ring modulated by a sine wave, a sum of sines is returned.

NOTE: Does not include an argument for zeroOffset. If this feature is required, see -normalizeTransfer.

Discussion:

Inherited instance methods

Undocumented instance methods

!=(aNumber)

==(aNumber)

.addChebyshev(harmonicNumber: 1, amplitude: 1.0)

.addSine(harmonicNumber: 1, amplitude: 1.0, phase: 0.0)

.asComplex

.asFloat

.asInteger

.asSignal

.asWavetableNoWrap

.chebyFill(amplitudes, normalize: true, zeroOffset: false)

.chebyFill_old(amplitudes)

.clip(lo, hi)

.fftCosTable

.firstArg(aNumber)

.fold(lo, hi)

.fold2(aNumber: 1)

.hanWindow

.imag

.modSeaside(aNumber)

.ramp

.real

.rectWindow

.rotate(n: 1)

.scurve

.sineFill(amplitudes, phases)

.sineFill2(list)

.sqrsum(aNumber)

.triWindow

.welWindow

.wrap(lo, hi)

.zeroPad(minSize)

[1] - S. Favrot and J. Buchholz. 2010. “Impact of Regularization of near Field Coding Filters for 2D and 3D Higher-Order Ambisonics on Auditory Distance Cues.” in Proc. of the 2nd International Symposium on Ambisonics and Spherical Acoustics. Paris.
[2] - J. Daniel. 2003. “Spatial sound encoding including near field effect: Introducing distance coding filters and a viable, new ambisonic format,” in Proc. of the 23rd International Conference of the Audio Engineering Society.
[3] - J. Ahrens and S. Spors. 2009. “Spatial encoding and decoding of focused virtual sound sources,” in Proc. of the 1st Ambisonics Symposium. Paris.
[4] - A sine function variation of the window proposed by Ahrens & Spors.
[5] - Smith, Steven W. “Windowed-Sinc Filters,“ in The Scientist and Engineer's Guide to Digital Signal Processing, https://www.dspguide.com/ch16.htm, online book, 2011 edition, accessed 2019-11-15.
[6] - Baird, J; Jackson, B; and D McGrath. “Raised Cosine Equalization Utilizing Log Scale Filter Synthesis.“ 117th Audio Engineering Society Convention, San Francisco, USA. October 2004. Permalink: http://www.aes.org/e-lib/browse.cfm?elib=12914
[7] - Weinzierl, S; Giese, A; and A Lindau. “Generalized Multiple Sweep Measurement.“ 126th Audio Engineering Society Convention, Munich, Germany. May 2009. Permalink: http://www.aes.org/e-lib/browse.cfm?elib=14963
[8] - Sorensen, H, et al. “Real-Valued Fast Fourier Transform Algorithms.” IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. 35, no. 6, 1987, pp. 849–863.
[9] - Sysel, Petr, and Pavel Rajmic. “Goertzel Algorithm Generalized to Non-Integer Multiples of Fundamental Frequency.” EURASIP Journal on Advances in Signal Processing, vol. 2012, no. 1, 2012, pp. 1–8.
[10] - Smith, J.O. “Flip Operator,“ in Mathematics of the Discrete Fourier Transform (DFT) with Audio Applications, Second Edition, https://www.dsprelated.com/freebooks/mdft/Flip_Operator.html, online book, 2007 edition, accessed 2019-05-19.
[11] - Borss, C, and R Martin. “On the Construction of Window Functions with Constant-Overlap-Add Constraint for Arbitrary Window Shifts.” 2012 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2012, pp. 337–340.
[12] - Marple, L. “Computing the Discrete-Time ‘Analytic’ Signal via FFT.” IEEE Transactions on Signal Processing, vol. 47, no. 9, 1999, pp. 2600–2603.
[13] - Georgopoulos, V. C., Preis, D. “A Comparison of Computational Methods for Instantaneous Frequency and Group Delay of Discrete-Time Signals.” Journal of the Audio Engineering Society, vol. 46, no. 3, 1998, pp. 152-163.
[14] - Damera-Venkata, N, and B.L Evans. “Optimal Design of Real and Complex Minimum Phase Digital FIR Filters.” 1999 IEEE International Conference on Acoustics, Speech, and Signal Processing. Proceedings. ICASSP99 (Cat. No.99CH36258), vol. 3, 1999, pp. 1145–1148 vol.3.
[15] - Smith, J.O. “Even and Odd Functions,“ in Mathematics of the Discrete Fourier Transform (DFT) with Audio Applications, Second Edition, https://www.dsprelated.com/freebooks/mdft/Even_Odd_Functions.html, online book, 2007 edition, accessed 2019-05-19.
[16] - Childers, D.G, et al. “The Cepstrum: A Guide to Processing.” Proceedings of the IEEE, vol. 65, no. 10, 1977, pp. 1428–1443.
[17] - Rabiner, Lawrence R, et al. “The Chirp z-Transform Algorithm and Its Application.” The Bell System Technical Journal, vol. 48, no. 5, 1969, pp. 1249–1292.