Sample analog function, forward and inverse Fourier transforms
a=50;
controlVar( a, 30 );
f(x)=0.7*sin(2*Pi*a*x) + sin(2*Pi*120*x); //compose a signal
fs(x)=sampleL(f, 0, 1, 1000);
F(x)=dft1(fs);
plot({abs(F)},{atan( real(F) / imag(F))});
plot(fs,idft1(F));
Real-time spectrogram, hystogram, oscillogram and a Fourier transform
sf=10000;
f(x)=recordSound(sf);
plot( histogramS( f, 19 ) );
a=spectrum(f,512);
plotOption(a,"threshold",.1);
plot({abs(fft1(f))});
plot(f,0,.01,1,-.01);
Real-time playback
sf=10000;
f(x)=recordSound(sf,2048);
plot(f);
playSound(f);
//now change the sampling frequency to say sf=4000;
Play in reverse
//start with a sampled function from loadSound() or recordSound()
gg(x)=f(lengthS(f)*stepS(f)-x);
playSound(gg);
loadS and loadSound demo
f(x)=loadSound("/home/iii/iii123.wav");
plot(f);
playSound(f);
saveS(f,"/home/iii/iii.ttt");
g(x)=loadS("/home/iii/iii.ttt",startS(f),stepS(f));
plot(g);