I'm trying to create three separate graphs, this code will give you the idea:
f[t_] := Sin[10 t] + Cos[15 t];
Slider[Dynamic[dx], {0.01, 1}]
var = Dynamic[Fourier[Table[f[t], {t, 0, 100, dx}]]];
ListLinePlot[Abs[var]]
ListLinePlot[Re[var]]
ListLinePlot[Im[var]]
This won't work because var hasn't been evaluated an so ListLinePlot/Abs/Re/Im does not recognize it as a list of numbers. Dynamic has to wrap ListLinePlot.
Wrapping ListLinePlot and everything else with Dynamic works. But then I would have to calculate Fourier[Table[... once for each graph. Per principle, I don't want to have this duplication of code.
This is a way that avoids duplication of code but is not as semantic as my proposed not working example above, plus it puts all series in one graph and not in three separate:
Dynamic[
ListLinePlot[
(#[Fourier[
Table[f[t], {t, 0, 100, dx}]
]]) & /@ {Abs,Re,Min}, DataRange -> {0, 100}
]
]
Hopefully you can see now what I am trying to achieve. Something like my first piece of code except it should work. How can I do that?
