Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- xf = With[{
- i = Function[{t0, t1, x0, x1},
- Evaluate@
- Integrate[(x0 + (x1 - x0)/(t1 - t0) *(t - t0))*
- Exp[-2*Pi*I*f*t], {t, t0, t1}]]},
- Compile[{{f, _Real}, {t, _Real, 1}, {x, _Real, 1}} ,
- Total@i[Most[t], Rest[t], Most[x], Rest[x]]]
- ];
- LogPlot[{Abs@xf[f, funX, fun1], Abs@xf[f, funX, fun2],
- Abs@xf[f/a, funX, fun2]/a}, {f, -50, 50}, PlotRange -> All, Frame -> True,
- FrameLabel -> {"Frequency [Hz]", "Amplitude", "Amplitude spectrum"},
- PlotLegends -> {"Original signal", "Time scaled"},
- ImageSize -> Large, PlotStyle -> {Red, Blue, Green}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement