sndlib

A module for generating sounds in python.

Functions

AMTone([frequency, AMFreq, AMDepth, phase, …]) Generate an amplitude modulated tone.
AMToneIPD([frequency, AMFreq, AMDepth, …]) Generate an amplitude modulated tone with an interaural phase difference (IPD) in the carrier and/or modulation phase.
AMToneVarLev([frequency, AMFreq, AMDepth, …]) Generate an amplitude modulated (AM) tone.
ERBDistance(f1, f2) Compute the distance in equivalent rectangular bandwiths (ERBs) between f1 and f2.
FMTone([fc, fm, mi, phase, level, duration, …]) Generate a frequency modulated tone.
ITDShift(sig, f1, f2, ITD, channel, fs) Set the ITD of a sound within the frequency region bounded by ‘f1’ and ‘f2’
addSounds(snd1, snd2, delay, fs) Add or concatenate two sounds.
binauralPureTone([frequency, phase, level, …]) Generate a pure tone with an optional interaural time or level difference.
broadbandNoise([spectrumLevel, duration, …]) Synthetise a broadband noise.
camSinFMComplex([F0, lowHarm, highHarm, …]) Generate a complex tone frequency modulated with an exponential sinusoid.
camSinFMTone([fc, fm, deltaCams, fmPhase, …]) Generate a tone frequency modulated with an exponential sinusoid.
chirp([freqStart, ftype, rate, level, …]) Synthetize a chirp, that is a tone with frequency changing linearly or exponentially over time with a give rate.
complexTone([F0, harmPhase, lowHarm, …]) Synthetise a complex tone.
complexToneIPD([F0, harmPhase, lowHarm, …]) Synthetise a complex tone with an interaural phase difference (IPD).
complexToneParallel([F0, harmPhase, …]) Synthetise a complex tone.
delayAdd(sig, delay, gain, iterations, …) Delay and add algorithm for the generation of iterated rippled noise.
dichoticNoiseFromSin([F0, lowHarm, …]) Generate Huggins pitch or narrow-band noise from random-phase sinusoids.
expAMNoise([fc, fm, deltaCents, fmPhase, …]) Generate a sinusoidally amplitude-modulated noise with an exponentially modulated AM frequency.
expSinFMComplex([F0, lowHarm, highHarm, …]) Generate a frequency-modulated complex tone with an exponential sinusoid.
expSinFMTone([fc, fm, deltaCents, fmPhase, …]) Generate a frequency-modulated tone with an exponential sinusoid.
fir2Filt(f1, f2, f3, f4, snd, fs) Filter signal with a fir2 filter.
fm_complex1([midF0, harmPhase, lowHarm, …]) Synthetise a complex tone with an embedded FM starting and stopping at a chosen time after the tone onset.
fm_complex2([midF0, harmPhase, lowHarm, …]) Synthetise a complex tone with an embedded FM starting and stopping at a chosen time after the tone onset.
freqFromERBInterval(f1, deltaERB) Compute the frequency, in Hz, corresponding to a distance, in equivalent rectangular bandwidths (ERBs), of ‘deltaERB’ from f1.
gate(ramps, sig, fs) Impose onset and offset ramps to a sound.
getRMS(sig[, channel]) Compute the root mean square (RMS) value of the signal.
glide([freqStart, ftype, excursion, level, …]) Synthetize a rising or falling tone glide with frequency changing linearly or exponentially.
harmComplFromNarrowbandNoise([F0, lowHarm, …]) Generate an harmonic complex tone from narrow noise bands.
imposeLevelGlide(sig, deltaL, startTime, …) Impose a glide in level to a sound.
intNCyclesFreq(freq, duration) Compute the frequency closest to ‘freq’ that has an integer number of cycles for the given sound duration.
itdtoipd(itd, freq) Convert an interaural time difference to an equivalent interaural phase difference for a given frequency.
joinSndISI(sndList, ISIList, fs) Join a list of sounds with given interstimulus intervals
makeAsynchChord(freqs, levels, phases, …) Generate an asynchronous chord.
makeBlueRef(sig, fs, refHz) Convert a white noise into a blue noise.
makeHugginsPitch([F0, lowHarm, highHarm, …]) Synthetise a complex Huggings Pitch.
makeIRN([delay, gain, iterations, …]) Synthetise a iterated rippled noise
makePink(sig, fs) Convert a white noise into a pink noise.
makePinkRef(sig, fs, refHz) Convert a white noise into a pink noise.
makeRedRef(sig, fs, refHz) Convert a white noise into a red noise.
makeSilence([duration, fs]) Generate a silence.
makeVioletRef(sig, fs, refHz) Convert a white noise into a violet noise.
nextpow2(x) Next power of two.
phaseShift(sig, f1, f2, phaseShift, …) Shift the interaural phases of a sound within a given frequency region.
pinkNoiseFromSin([compLevel, lowCmp, …]) Generate a pink noise by adding sinusoids spaced by a fixed interval in cents.
pinkNoiseFromSin2([compLevel, lowCmp, …]) Generate a pink noise by adding sinusoids spaced by a fixed interval in cents.
pureTone([frequency, phase, level, …]) Synthetise a pure tone.
scale(level, sig) Increase or decrease the amplitude of a sound signal.
setLevel_(level, snd, maxLevel[, channel]) Set the RMS level of a sound signal to a given value.
spectralModNoise([spectrumLevel, duration, …]) Generate a broadband noise with a modulated spectral envelope.
steepNoise([frequency1, frequency2, level, …]) Synthetise band-limited noise from the addition of random-phase sinusoids.