diff dsp/synth/noise.m @ 34:c75bb62b90a9

Imported audio synthesis tools.
author samer
date Sun, 20 Jan 2013 19:05:05 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dsp/synth/noise.m	Sun Jan 20 19:05:05 2013 +0000
@@ -0,0 +1,10 @@
+% noise - white noise generator
+%
+% noise :: 
+%    D:natural ~'maximum duration to expect',
+% -> (   nonneg  ~'sampling frequency', 
+%        N:1..D  ~'duration' 
+%     -> [[1,N]] ~'some noise') ~'function to generate white noise'.
+function gen=noise(maxdur)
+	buf=randn(1,maxdur);
+	gen=@(fs,dur)buf(1:dur);