0

I was doing some basic problems in Fourier transform and using MATLAB to verify my answers. I encountered a problem when I tried to find the Fourier transform expression of the following two signals:

y1 = 2*exp(-t)u[t] + 5*exp(-(t-1)/2)u[t-1]
y3 = cos(2*t)/(4+t^2)

I usually use the fourier function, which works fine for some signals, but here the result is quite unhelpful:

>> fourier(y3,f)

ans = 

    fourier(cos(2*t)/(t^2 + 4), t, f)

The correct answer should be a shifted frequency exponential.

How can I get the desired expression?

My full code:

syms t f;

disp('Fourier transform of y1 = 2*exp(-t)u[t] + 5*exp(-(t-1)/2)u[t-1] is  ');
y1 = (t>=0).*2*exp(-t) + (t>=1).*5*exp(-(t-1)/2);
Y1 = fourier(y1,f);
pretty(Y1)


disp('Fourier transform of y3 = cos(2*t)/(4+t^2) is  ');
y3 = cos(2*t)/(4+t^2);
Y3 = simplify(fourier(y3,f));
pretty(Y3)
Dev-iL
  • 23,742
  • 7
  • 57
  • 99
Zero_Cool
  • 53
  • 1
  • 10
  • sidenote: you might want to use [`heaviside`](https://www.mathworks.com/help/symbolic/heaviside.html) as it is possibly more readable and MATLAB handles symbolic expressions with it better. – Dev-iL Feb 14 '18 at 17:04
  • 1
    sidenote #2: why do you need MATLAB for this? You can use the free [Wolfram Alpha](https://www.wolframalpha.com/input/?i=fourier(cos(2*t)%2F(4%2Bt%5E2))) which is much friendlier... – Dev-iL Feb 14 '18 at 17:25
  • In Matlab's symbolic math, when a function returns something in terms of itself that means it doesn't know how to solve it analytically. Either there is no analytical solution or Matlab doesn't have enough information about assumptions or Matlab just doesn't how to solve it. You can try submitting this example to The MathWorks via a service request to see if they can expand support. – horchler Feb 14 '18 at 22:17

0 Answers0