I want to plot the Fourier transform of

$$f(t)=\int_{0}^{t}\exp\left(-\frac{1}{1-s^{2}}\right)\,ds,\qquad\text{if }|s|<1,\text{ otherwise }0$$

x = -2:0.01:2 % Position vector Fs = 1000; % Sampling frequency T = 1/Fs; % Sampling period L = 1000; % Length of signal t = (0:L-1)*T; % Time vector s = @(x)heaviside(x+1).*heaviside(-x)+heaviside(x).*heaviside(1-x); % Step function r = @(x) exp(-1./(1-x.^2)).*s(x); % Bump function f = zeros(size(t)); for i = 1:length(t) f(i) = integral(r,0,t(i)); end Y = fft(f); % Fourier transformed function plot(1000*t(1:50),Y(1:50))

enter image description here

But it doesn't look anything like how I would expect it to look. Does anyone have any suggestions?

  • $\begingroup$ what would you have expected? $\endgroup$ – tired Jan 19 '17 at 21:13
  • $\begingroup$ @tired On Mathematica I produced something very different. $\endgroup$ – Jason Born Jan 19 '17 at 21:14
  • $\begingroup$ I think you mistyped if $|s|<1$ instead of $|t|<1$ $\endgroup$ – polfosol Jan 19 '17 at 21:14
  • $\begingroup$ @polfosol $f(t)=\int_{0}^{t}g(s)\,ds$ where $g\in C^{\infty}_{0}(\mathbb{R})$ and is given by $g(s)=\exp\left(-\frac{1}{1-s^{2}}\right)$ if $|s|<1$ and $0$ otherwise. $\endgroup$ – Jason Born Jan 19 '17 at 21:21
  • $\begingroup$ Since $f(t)$ has a nonzero constant value for $t \ge 1$, this does not have a Fourier transform (as a function). As a tempered distribution, the main terms in its Fourier transform will be a constant multiple of $\pi \delta(k) - 1/k$ (the Fourier transform of the Heaviside function), where $\delta$ is the Dirac delta. $\endgroup$ – Robert Israel Jan 19 '17 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.