Sinusbølge

Plot[Sin[t],{t,0,2Pi}]

Plot[Sin[2Pi t],{t,0,1}]

Plot[Sin[4 2Pi t],{t,0,1}]

s[t_]:=Sin[2Pi 100t]

Plot[s[t], {t,0,1}]

Play[Sin[2Pi 30t], {t,0,2},SampleRate->44100]

Moll skala over to oktaver

l={0,2,3,5,7,8,11,12}

l1=l+12

ll=Union[l,l1]

rl=Reverse[ll]

lll=Join[ll,Drop[rl,1]]

c=N[2^(1/12)];f0=50; lengde=0.2;

Do[EmitSound[Play[Sin[2Pi f0 t c^lll[[i]]+0.0Random[]],{t,0,lengde}]], {i,1,Length[lll]}]

Firkantpuls

p0[t_]:=With[{tt=t-Floor[t]},Which[And[tt≥0,tt<1/2],1,And[tt≥1/2,tt<1],-1]]

Plot[p0[t], {t,-1,2}]

Play[p0[440t], {t,0,1}]

Play[Sin[2Pi 440t], {t,0,1}]

Trekantpuls

p1[t_]:=With[{tt=t-Floor[t]},Which[And[tt≥0,tt<1/4],4tt,And[tt≥1/4,tt<3/4],2-4tt,And[tt≥3/4,tt<1],4tt-4]]

Plot[p1[t], {t,-1,2}]

Play[p1[440t],{t,0,1}]

Sammenligning

Play[p0[440t], {t,0,1}]

Play[p1[440t], {t,0,1}]

Play[s[t], {t,0,1}]

Modulasjon

AM

t=.

Clear[g]

g[t_]=Sin[20t]-Cos[8t];

Plot[g[t], {t,0,1}]

Ved amplitudemodulasjon multipliseres signalet med sin

Plot[g[t]Sin[440t], {t,0,1}]

Play[g[t]Sin[2Pi 440 t], {t,0,4}]

Play[Sin[20t]Sin[2Pi 440t], {t,0,1}]

Play[Sin[20t]p1[440t], {t,0,1}]

Play[Sin[20t]p0[440t], {t,0,1}]

FM

Plot[g[t], {t,0,1}]

Ved frekvensmodulasjon adderes signalet inn i argumentet til sin.

Plot[Sin[2Pi 20t + 10g[t]], {t,0,1}]

Play[Sin[2Pi 440t + 10g[t]], {t,0,1}]

Play[p0[2Pi 440t + 25Sin[20t]],{t,0,2}]

Play[p1[2Pi 440t + 25Sin[20t]],{t,0,1}]

Play[Sin[2Pi 440 t+25 Sin[20 t]], {t,0,2}]

Klokke-eksempel

fc=80; fm=112; α=0.06; β=0.09; b=4;
w[t_]=Exp[-α t] Sin[2Pi fc t+ b Exp[-β t]Sin[2Pi fm t]];

Play[w[t], {t,0,10}]

w0[t_]:=Exp[-α t] p1[ fc t+ b Exp[-β t]Sin[2Pi fm t]];

Play[w0[t], {t,0,10}]

Samplingsteoremet

Play[Sin[2Pi 2500 t], {t,0,1},SampleRate->4000]