Phase of Waves

f=1; (* Frequency *)
ϕ=90; (* Phase *)
Plot[ {Sin[ 2 π  f t],Sin[ 2 π f t+ 2π (ϕ/360)]},{t,0,2}]

Adding Waves

f=1; (* Frequency *)
ϕ=90; (* Phase *)
Plot[ {Sin[ 2 π  f t]+Sin[ 2 π f t+ 2π (ϕ/360)]},{t,0,2}]

Animation #1:

amp1=1.0;
amp2=1.0;
Manipulate[Animate[Plot[{amp1 Sin[ 2 Pi (x+t) ],amp2 Sin[ 2 Pi (x-t) ],amp1 Sin[ 2 Pi (x+t) ]+amp2 Sin[ 2 Pi (x-t) ]},{x,0,n},PlotRange->{-2,2},PlotStyle->{Blue,Green,{Red,Thickness[0.010]}}],{t,0,2}]
,Control[{{n,2},{1,2,3,4,5}}]]

Animation #2:

open={Thickness[0.02],Green,Line[{{-10,-2},{10,-2}}],Line[{{-10,+2},{10,+2}}]} ;
Manipulate[
Animate[
Plot[{Sin[ 2 Pi (x+n t)+π phase ]+Sin[ 2 Pi (x-n t) + π phase],-Sin[ 2 Pi (x+n t) +π phase]-Sin[ 2 Pi (x-n t)+π phase ]},{x,0,n/2},
PlotRange->{-2,2},
PlotStyle->{Blue,Blue},
PlotLabel->{"Frequency = ",n} ,
Axes->False,
Epilog->open
]
,{t,0,1}]
,Control[{n,{1,2,3,4,5}}],Control[{{phase,0},{0->"Pressure",1/2->"Displacement"}}]]

Animation #3:

closed={Thickness[0.02],Green,Line[{{-10,-2},{10,-2}}],Line[{{-10,+2},{10,+2}}],Line[{{0,+2},{0,-2}}]} ;
Manipulate[
Animate[
Plot[{Sin[ 2 Pi (x+n t)+π phase ]+Sin[ 2 Pi (x-n t) + π phase],-Sin[ 2 Pi (x+n t) +π phase]-Sin[ 2 Pi (x-n t)+π phase ]},{x,0,n/4},
PlotRange->{-2,2},
PlotStyle->{Blue,Blue},
PlotLabel->{"Frequency = ",n} ,
Axes->False,
Epilog->closed
]
,{t,0,1}]
,Control[{n,{1,3,5,7}}],Control[{{phase,1/2},{1/2->"Pressure",0->"Displacement"}}]]

Plot #1: Make a Saw-Tooth Wave

fun[x_,c1_,c2_,c3_,c4_,c5_]:=c1 Sin[2 π x]+ c2 Sin[2 π 2 x]+ c3 Sin[2 π 3 x]+ c4 Sin[2 π 4 x]+ c5 Sin[2 π c5 x]

fun[0.1,1,2,3,4,5]

Manipulate[
Plot[fun[x,c1,c2,c3,c4,c5],{x,0,1},PlotRange->{-2,2}],
{{c1,1},-1,1,0.05},
{{c2,0},-1,1,0.05},
{{c3,0},-1,1,0.05},
{{c4,0},-1,1,0.05},
{{c5,0},-1,1,0.05}]

Plot #2: Make a Square Wave

Manipulate[
Plot[fun[x,c1,c2,c3,c4,c5],{x,0,1},PlotRange->{-2,2}],
{{c1,1},-1,1,0.05},
{{c2,0},-1,1,0.05},
{{c3,0},-1,1,0.05},
{{c4,0},-1,1,0.05},
{{c5,0},-1,1,0.05}]

Plot #3:  Challege: Make a different Saw Tooth

Manipulate[
Plot[fun[x,c1,c2,c3,c4,c5],{x,0,1},PlotRange->{-2,2}],
{{c1,1},-1,1,0.05},
{{c2,0},-1,1,0.05},
{{c3,0},-1,1,0.05},
{{c4,0},-1,1,0.05},
{{c5,0},-1,1,0.05}]

Plot Beats:

f1=440; (* Frequency *)
f2=444; (* Frequency *)
Plot[ {Sin[ 2 π  f1 t]+Sin[ 2 π f2 t ]},{t,0,1}]

Hear Beats:

f1=440; (* Frequency *)
f2=444; (* Frequency *)
Play[ {Sin[ 2 π  f1 t]},{t,0,1}]
Play[ {Sin[ 2 π  f2 t]},{t,0,1}]

f1=440; (* Frequency *)
f2=444; (* Frequency *)
Play[ {Sin[ 2 π  f1 t]+Sin[ 2 π f2 t ]},{t,0,1}]

Synthetic Instruments #1:

Play[fun[ 440 x  ,1,1/2,1/3,1/4,1/5],{x,0,1}]

Synthetic Instruments #2:

Play[fun[ 440 x  ,1,0/2,1/3,0/4,1/5],{x,0,1}]