= #JxnPortable\docs\plot_examples\demos\STS_Skript_Kap2.jxn

owner = @Frame( "STS_Skript_Kap2" )
#JXN:include/SliderInclude.jxn
owner.setFont( @java.awt.Font( "Dialog", 0, 12 ) )
!
N0 = slider.add( "N0", 50., 2., 500. )
seed = slider.add( "seed", 0, 0, 100 )
ar = slider.add( "ar", 0.5, 0., 2. )
!
f = 100.
A = 2.
Ar = ar A
phi = 0.
P = 2
T = 1 / f
dt = T / N0
t = @JxnRealArrayAlgebra( 0., 2 T, dt )
xt = A sin( 2 PI f t + phi )
st = Ar JxnRealArrayAlgebra.noise( length t, round seed )
pf1 = plot( t, xt, B ).add( curve( t, xt, R, 30 ) ).add( curve( t, xt, R, 21 ) ).setXYLabels( "t", "x(t)" )
pf2 = plot( t, st, B ).add( curve( t, st, R, 30 ) ).add( curve( t, st, R, 21 ) ).setXYLabels( "t", "s(t)" )
pf3 = plot( t, xt + st, xt, st ).setXYLabels( "t", "x(t) + s(t)" )
pf4 = plot( t, xt + st, sw( xt + st, -1. + 0 t, 1. + 0 t ) )
!
#JXN:include/Grid4Include( pf1, pf3, pf2, pf4 )
#JXN:include/FrameInclude.jxn