Let $t\ge 0$ and let $f_{s}(t)$ be the sampled version of $f(t)$.
If $$f(t)=\begin{cases}\int_{0}^{t}\exp\left(-\frac{1}{1-s^{2}}\right)\,ds,&|s|<1, \\ 0,&\text{otherwise}.\end{cases}$$
I used
Plot[NIntegrate[
Piecewise[{{Exp[-1/(1 - s^2)], Abs[s] < 1}, {0, Abs[s] >= 1}}], {s,
0, t}], {t, 0, 2}
which looks like this:
which is as I would expect.
Then we sample for arbitrary time interval $T=1/10$ to get
$$\begin{aligned}f_{s}(t)&=\sum_{n=-\infty}^{\infty}f(n/10)\delta(t-n/10) \\ &=\begin{cases}\int_{0}^{n/10}\exp\left(-\frac{1}{1-s^{2}}\right)\,ds\cdot\delta(t-n/10),&|s|<1, \\ 0,&\text{otherwise}.\end{cases} \end{aligned}$$
However, for the sampled function, when I use
DiscretePlot[
Accumulate[
Table[
NIntegrate[
Piecewise[
{{Exp[-1/(1 - s^2)]*DiscreteDelta[t - n*0.1], Abs[s] < 1},
{0, Abs[s] >= 1}}],
{s, 0, n*0.1},
AccuracyGoal -> 20],
{n, -20, 20}]],
{t, 0, 2}]
this yields:
which clearly isn't how it should look.
Moreover, when I attempt to perform a discrete time Fourier transform on the sampled data using
Plot[
FourierSequenceTransform[
NIntegrate[
Piecewise[{{Exp[-1/(1 - s^2)], Abs[s] < 1}, {0, Abs[s] >= 1}}],
{s, 0, 0.1 n},
AccuracyGoal -> 20],
{n, -20, 20},
ω],
{ω, -20, 20}]
I fail to get the n
in the FourierSequenceTransform
argument, since it is in the integral limit, I think. But there must be a way to bypass this obstacle?
DiscretePlot[ Accumulate[ Table[Piecewise[{{NIntegrate[Exp[-1/(1 - s^2)], {s, 0, n*0, 1}, AccuracyGoal -> 20]*DiscreteDelta[t - n*0.1], Abs[s] < 1}, {0, Abs[s] >= 1}}], {n, -20, 20}]], {t, 0, 2}]
also fails to yield what I want. $\endgroup$f[t_] := NIntegrate[Exp[-1/(1 - s^2)], {s, 0, Min[1, t]}]
. That's not what your piecewise expression says.. $\endgroup$Plot[NIntegrate[ Piecewise[{{Exp[-1/(1 - s^2)], Abs[s] < 1}, {0, Abs[s] >= 1}}], {s, 0, t}], {t, 0, 2}]
$\endgroup$ListPlot[Table[{t, NIntegrate[ Piecewise[{{Exp[-1/(1 - s^2)], Abs[s] < 1}}], {s, 0, t}]}, {t, 0, 2, 1/10}]]
? $\endgroup$