fs = 10e3

fs =

       10000

tt=0: 1/fs  :1


tt=0: 1/fs  :1;
whos tt
  Name      Size           Bytes  Class

  tt        1x10001        80008  double array

Grand total is 10001 elements using 80008 bytes

tt=0: 1/fs  :1-1/fs;
whos tt
  Name      Size           Bytes  Class

  tt        1x10000        80000  double array

Grand total is 10000 elements using 80000 bytes

y=sin(2*pi*440*tt);
sound(y,fs)
sound(y,fs)
sound(y,fs)
sound(y,fs)
sound(y,fs)
sound(y,fs)
sound(y,fs)
sound(2*y,fs)
sound(2*y,fs)
sound(5*y,fs)
soundsc(5*y,fs)
y = y / max(abs(y));
y=square(2*pi*440*tt);
sound(y,fs)
y=sawtooth(2*pi*440*tt);
sound(y,fs)
y = randn(size(tt));
whos y
  Name      Size           Bytes  Class

  y         1x10000        80000  double array

Grand total is 10000 elements using 80000 bytes

sound(y,fs)
y= [ sin(2*pi*100*tt) sin(2*pi*400*tt) sin(2*pi*800*tt) ];
whos y
  Name      Size           Bytes  Class

  y         1x30000       240000  double array

Grand total is 30000 elements using 240000 bytes

sound(y,fs)
f=[300 400 600 800 1000];
y=[]

y =

     []

size(f)

ans =

     1     5

size(f,1)

ans =

     1

size(f,2)

ans =

     5

for k = 1:length(f)
y = [y sin(2*pi*f(k)*tt)];
end
sound(y,fs)
m=0:12

m =

  Columns 1 through 7 

     0     1     2     3     4     5     6

  Columns 8 through 13 

     7     8     9    10    11    12

f=440*2^(m/12)
??? Error using ==> ^
Matrix must be square.

f=440*2.^(m/12)

f =

  Columns 1 through 4 

  440.0000  466.1638  493.8833  523.2511

  Columns 5 through 8 

  554.3653  587.3295  622.2540  659.2551

  Columns 9 through 12 

  698.4565  739.9888  783.9909  830.6094

  Column 13 

  880.0000

f=440*2.^((0:12)/12)

f =

  Columns 1 through 4 

  440.0000  466.1638  493.8833  523.2511

  Columns 5 through 8 

  554.3653  587.3295  622.2540  659.2551

  Columns 9 through 12 

  698.4565  739.9888  783.9909  830.6094

  Column 13 

  880.0000

for k = 1:length(f)



y=[]

y =

     []

for k = 1:length(f)
y=[y sin(2*pi*f(k)*tt(1:2000)) ];
end
sound(y,fs)
f=440*sqrt(2).^((0:12)/12)

f =

  Columns 1 through 4 

  440.0000  452.8930  466.1638  479.8234

  Columns 5 through 8 

  493.8833  508.3552  523.2511  538.5836

  Columns 9 through 12 

  554.3653  570.6094  587.3295  604.5396

  Column 13 

  622.2540

y=[]

y =

     []

for k = 1:length(f)
y=[y sin(2*pi*f(k)*tt(1:2000)) ];
end
sound(y,fs)








clear
whos
dur = 1

dur =

     1

fs=10e3

fs =

       10000

tt=0:1/fs:dur-1/fs;
tau=1

tau =

     1

env=exp(-tt/tau);
plot(env)
env=exp(-tt/2*tau);
plot(env)
env=exp(-tt/tau/3);
plot(env)
env=exp(-tt/(tau/3));
plot(env)
y=square(2*pi*440*tt);
y = y .* env;
plot(y)
sound(y,fs)
env=exp(-tt/(tau/10));
y=square(2*pi*440*tt);
z = y .* env;
sound(z,fs)
env=exp(-tt/(tau/0.2));
z = y .* env;
sound(z,fs)
helpwin linspace
helpwin logspace
exit