Signalfun

Function name

Description (see the MATLAB function help for further information)

GenerateTone

tone = GenerateTone(sf, dur, freqs) tone = GenerateTone(sf, dur, freqs, amps) tone = GenerateTone(sf, dur, freqs, amps, phases) tone = GenerateTone(sf, dur, freqs, amps, phases, ITD) tone = GenerateTone(sf, dur, freqs, amps, phases, ITD, ILD) This function generates tones, either simple or complex (harmonic or inharmonic). If ITD and ILD values are inputed, the returned sound is stereophonic. On the contrary, the sound is monophonic. To obtain stereophonic sounds with no ITD (or ILD) set ITD and ILD values to zero. The output sound is always normalized in amplitude (i.e., peak amplitude is 1 (or -1). To manipulate the sound's amplitude use AttenuateSound.

GenerateNoise

noise = GenerateNoise (sf, duration) filterednoise = GenerateNoise (sf, duration, noisetype, f1) filterednoise = GenerateNoise (sf, duration, noisetype, f1, f2) This function generates a noise either white (default option if noisetype is omitted), lowpass, highpass, bandpass or notched (i.e., bandstop).

GenerateSilentInterval

silence = GenerateSilentInterval(sf, dur) silence = GenerateSilentInterval(sf, dur, 'stereo') This function generates a silent interval or the desired duration. Default output is a monophonic silent interval.

GenerateEnvelope

soundout = GenerateEnvelope(sf, soundin) soundout = GenerateEnvelope(sf, soundin, gatedur) soundout = GenerateEnvelope(sf, soundin, onsetdur, offsetdur) This function applies onset and offset raised cosine gates to a sound. By default, gates have identical duration of 10-ms. The function works with monophonic and stereophonic sounds.

AttenuateSound

soundout = AttenuateSound(soundin, att_dB) This function attenuates the overall level of a sound of a certain number of decibels. The reference for the attenuation is 0-dB FS (i.e., full scale). The function attenuates the sound if the input number of decibels is negative and amplify the sound otherwise.

ApplyAmplitudeModulation

soundout = ApplyAmplitudeModulation(sf, soundin, mrate, mdepth) soundout = ApplyAmplitudeModulation(sf, soundin, mrate, mdepth, mphase) soundout = ApplyAmplitudeModulation(sf, soundin, mrate, mdepth, mphase, ITD) This function applies a cosinusoidal amplitude modulation of given rate and depth to an input sound. It returns the amplitude modulated sound. The function works either with monophonic and stereophonic sounds.

ConcatenateSounds

soundout = ConcatenateSounds(s1, s2, s3, ...) This function enables to concatenate an infinite number of sounds. The function works either with monophonic and stereophonic sounds.

AddTwoSounds

soundout = AddTwoSounds(sf, soundin1, soundin2, soundin2onset) This function adds pairs of sounds. It receives two input sounds and returns a single sound. The second sound will be switched on at onset time, relatively to the beginning of the first sound. The function works also if sounds do not to overlap in time, for example, when the second sound is switched well after the end of the first sound. If you need to strictly concatenate the sounds (i.e., no silent gap between first and second sound) use the ConcatenateSounds function instead. The function works either with monophonic and stereophonic sounds.

ShuffleSounds

[SoundSeq, pos] = ShuffleSounds(sf, standard, variable, nAFC) [SoundSeq, pos] = ShuffleSounds(sf, standard, variable, nAFC, ISI) [SoundSeq, pos] = ShuffleSounds(sf, standard, variable, nAFC, ISI, 'mode') This function enables to randomize the order of standard(s) and variable sounds in multiple intervals, multiple forced choice tasks. Sounds are concatenated into a single sound vector (SoundSeq) and separated by silent intervals of ISI duration. The function returns the position (pos) of the variable sound. The function works either with monophonic and stereophonic sounds.