SRT Matlab/Octave Toolkit Manual



SRT Matlab Audio Toolkit Manual

Revised 2009,2010,2011,2012

Foreword 6

User Notes 7

Simple Oscillators 7

cosine 7

one_shot 7

osc 8

saw 8

sine 8

spike 9

sqr 9

synthesize 9

tri 9

unit 10

Other Sound Generators 10

consonant 10

formant 10

fm_instr 11

mygrain, mygrainu 11

noisefilter 11

pluck, plucklp 12

powernoise 12

Shepard 12

vowel 12

Synthesizer Units 13

vca 13

vcf 13

vco (MATLAB) 14

Filters 14

EQ10 14

FIRhigh 14

FIRlow 15

FIRpass 15

FIRstop 15

flt 16

highshelving 16

lowshelving 16

nlreson 17

parmeq 17

peq (equalizer) 17

shelving 17

Vibrato and Tremolo 18

tremolo 18

vibrato 18

Dynamics Processing 18

agc 18

a_r 19

compexp 19

crossfade 20

env 20

expa_r 20

expattack 20

expdecay 21

FadeIn 21

FadeOut 21

follow 22

inflimit 22

limiter 22

rms 22

Delay Lines 23

allpdelay 23

crossdelay 23

firdelay 23

iirdelay 24

lpiirdelay 24

multiecho 24

tdl, (tapped delay line) 25

pad 25

unidelay 25

vardelay 26

Reverb Units 26

artrvb 26

convrvb 26

multirvb 27

schroeder 27

Spatial Effects 28

autopan 28

delaypan 28

phaseinvert 28

specpan 29

spreader 29

spreadnoise 29

stereopan 30

superpan 30

Pitch- and Time-Shifting Functions 30

deci 30

interp_move (pitch shift) 31

lint 31

pitch_shift 31

pv_move (pitch shift) 31

pvoc (time scale) 32

resample (MATLAB) 32

time_stretch 32

Miscellaneous Digital FX 32

atx (pitch quantization) 32

auto_wah 33

cross_synthesis 33

dispersion 34

flanger 34

fuzzexp 34

f_warp 35

leslie 35

morph 35

mutate 35

noisegt 36

phaser 36

robotize 36

symclip 37

wah 37

wah_wah 37

whisperize 38

Denoising 38

BT (block thresholding) 38

denoise 38

xerase 38

specsub 39

ssubmmse 39

Stereo 39

destereo 39

stereo 39

Data Conversions 40

abs2dbfs 40

dbfs2abs 40

freq2midi 40

midi2freq 41

General Vector Operations 41

colvec 41

fastconv 41

magresponse 41

mix 42

mul 42

pwrspec 42

qnf 42

rev, reverse 43

rowvec 43

trim2 43

tempo 43

Matlab Sound Functions 44

sound, soundsc 44

wavread 44

wavwrite 44

Text-to-speech 45

text2speech 45

tts (Windows only) 45

Text-to-speech For Macintosh 45

Demos 46

agcDemo 46

BTDemo 46

compressionDemo 46

consonantDemo 46

cross_synthesisDemo 46

dispersionDemo 46

FMDemo 46

formantDemo 46

leslieDemo 46

noisegtDemo 46

pvocDemo 46

unidelayDemo 47

vowelDemo 47

Foreword

The Audio Toolkit is a compilation of Matlab functions drawn from many sources. It was possible to make this collection because the results of so many of the most advanced audio research projects have been published in the form of Matlab code. Many of the routines in the Toolkit have been modified somewhat from their original published form. Usually this was done to achieve greater computational efficiency (I attempted to make the execution time of each function no greater than the time it takes to play its output). In some other cases, a function was modified to make it easier to use or to perform an operation different from the one it was originally designed to perform.

The Toolkit is intended primarily for the use of my students. If any of the Toolkit’s routines are used by others for a different purpose, all code not written by me must be properly credited to its authors, and the authors’ restrictions on the use of their code must be respected. The source of each routine is indicated in the M-file below the routine’s definition. Where no source is indicated, I am the author.

Stuart Smith

Chelmsford, MA

August 2011

User Notes

1. Except as noted, Toolkit functions accept either row- or column-vector arguments and return row-vector results.

2. Whenever a Toolkit function does not have a sample rate (sr) parameter, you should assume that the sample rate for both input and output is 44.1 kHz.

3. Toolkit functions have been successfully tested with audio-friendly input arguments, but they do little or no checking of argument values.

4. The Matlab Signal Processing Toolbox contains many additional functions useful for audio signal processing. Check it out.

Simple Oscillators

cosine

y = cosine( freq , dur , sr )

Generates samples of a sinewave of specified frequency and duration.

Inputs:

freq = frequency in Hz

dur = duration in seconds

sr = sample rate in samples per second

Output

y = vector of sine samples

one_shot

y = one_shot( dur , wave , start , finish , sr )

A one-shot oscillator. Creates one cycle of an arbitrary waveform defined in a user-supplied wave table. The table contains one cycle of the desired waveform. A partial cycle can be obtained by specifying start and finish values within the cycle. Example:

s = sine( 1 , 1 , 65536 ) ; % large table is no big deal for Matlab

y = one_shot( 2 , s , 0.25 , 0.75 , 44100 ) ; % middle half of sine

plot( y )

Inputs:

dur = signal duration in seconds

wave = user-supplied vector of one cycle of the desired waveform

start = fraction of cycle where output begins: 0= ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download