Previous Next Contents

16  Sound

16.1   analyze frequency plot of a sound signal




CALLING SEQUENCE :

analyze (w [,fmin,fmax,rate,points])


PARAMETERS :

fmin,fmax,rate,points : scalars. default values fmin=100,fmax=1500,rate=22050,points=8192;


DESCRIPTION :

Make a frequency plot of the signal w with sampling rate rate. The data must be at least points long. The maximal frequency plotted will be fmax, the minimal fmin.


EXAMPLE :

// At first we create 0.5 seconds of sound parameters.
t=soundsec(0.5);
// Then we generate the sound.
s=sin(440*t)+sin(220*t)/2+sin(880*t)/2;
[nr,nc]=size(t);
s(nc/2:nc)=sin(330*t(nc/2:nc));
analyze(s);

16.2   loadwave load a sound <<wav>> file into scilab




CALLING SEQUENCE :

x=loadwave('file-name');



PARAMETERS :

x : vector


DESCRIPTION :

Read a wav sound file into Scilab. you can transform other sound files into wav file with the sox program.


See Also : savewave X, analyze X, mapsound X



16.3   mapsound Plots a sound map




CALLING SEQUENCE :

mapsound (w,dt,fmin,fmax,simpl,rate)



PARAMETERS :

dt,fmin,fmax,simpl,rate: : scalars. default values dt=0.1,fmin=100,fmax=1500,simpl=1,rate=22050;


DESCRIPTION :

Plots a sound map for a sound. It does FFT at time increments dt. rate is the sampling rate. simpl points are collected for speed reasons. fmin and fmax are used for graphic boundaries.


EXAMPLE :

// At first we create 0.5 seconds of sound parameters.
t=soundsec(0.5);
// Then we generate the sound.
s=sin(440*t)+sin(220*t)/2+sin(880*t)/2;
[nr,nc]=size(t);
s(nc/2:nc)=sin(330*t(nc/2:nc));
mapsound(s);

16.4   savewave save data into a sound <<wav>> file.




CALLING SEQUENCE :

savewave('file-name',x [, rate ]);



PARAMETERS :




DESCRIPTION  :

save x into a wav sound file. you can transform other sound files into wav file with the sox program.


See Also : loadwave X, analyze X, mapsound X


Previous Next Contents