3
$\begingroup$

I'd like to compute the response to a step function of a electrical/thermal system. Generally I can "easily" compute the transfer function $H$:

$$H(\omega) = \frac{V_{out}(\omega)}{V_{in}(\omega)}$$

Since the Fourier transform ($\mathcal{F}$) of the Heaviside function is (computed with WA):

$$\mathcal{F}(\theta(t)) = V_{in}(\omega) = \sqrt{\frac{\pi}{2}}\delta(\omega)+\frac{i}{\sqrt{2\pi}\omega}$$

Hence, noting $\mathcal{IF}$ the Inverse Fourier transform:

$$V_{out}(t) = \mathcal{IF} \left\{ \left( \sqrt{\frac{\pi}{2}}\delta(\omega)+\frac{i}{\sqrt{2\pi}\omega} \right) H(\omega) \right\}$$

To check my math I tried to compute the response for a simple RC system:

enter image description here

I should get the well known charge of the capacitor. The transfer function:

$$H(\omega) = \frac{1}{1+i\omega R C}$$

Computing the Inverse Fourier transform ($\mathcal{IF}$) with WA ($R=C=1$) I get:

enter image description here

This would be correct if we were going backward in time :/. So the question is... What am I doing wrong?

I did the same using Laplace Transforms and everything works fine... But I don't understand why.

P.S. I don't want another method, I just want to understand what's wrong in my approach.

P.S. the reason why I am using WA is that for my more complicated system I need to compute the Fourier transforms using WA.

$\endgroup$
1
$\begingroup$

You are doing a mistake while converting $V_{out}(\omega)$ back in time. For your conveninence let me solve the problem. I will use a slightly different notation in which 'j' will represent imaginary numbers instead of 'i' and a factor of $\sqrt{2\pi}$ won't appear around.

Now,

As you've already provided; given an input as a step signal $ v_{in}(t) = u(t)$ whose Continuous-Time Fourier Transform is $ V_{in}(j\omega) = U(j\omega) = 1/j\omega + \pi\delta(\omega)$ and a system Transfer Function $H(j\omega) = 1 / (1+j\omega RC)$ of the linear RC network provided in your example, CT Fourier Transform of the output is given by $V_{out}(j\omega) = V_{in}(j\omega)H(j\omega) $

Simply carry out the algebra to get the result as: $$ V_{out}(j\omega) = ({1\over j\omega} + \pi\delta(\omega)) ( {1 \over 1+j\omega RC}) $$ $$ = {1\over j\omega}{1 \over 1+j\omega RC} + \pi\delta(\omega) ({1 \over 1+j\omega RC}|_{w=0}) $$

$$ = {1\over j\omega}{1 \over 1+j\omega RC} + \pi\delta(\omega) $$ $$ = {A\over j\omega} + {B \over 1+j\omega RC} + \pi\delta(\omega) $$ $$ = {1\over j\omega} + {-RC \over 1+j\omega RC} + \pi\delta(\omega) $$ $$V_{out}(j\omega) = ({1\over j\omega}+ {\pi\delta(\omega)}) + {-RC \over 1+j\omega RC} $$

Now, convert this final form back into time by recognising the first 2 terms as the CTFT of a unit-step u(t) signal and the 3rd term as the CTFT of an right sided exponential signal, and utilizing the linearity property of Fourier Transforms...

$$v_{out}(t) = ICTFT( ({1\over j\omega}+ {\pi\delta(\omega)}) ) + ICTFT( {-RC \over 1+j\omega RC} ) $$

$$ = ICTFT( ({1\over j\omega}+ {\pi\delta(\omega)}) ) + ICTFT( {-1 \over 1/RC + j\omega} ) $$

$$ = u(t) - e^{-t/{RC}}u(t) $$

$$v_{out}(t) = ( 1 - e^{-t/{RC}} ) u(t) $$... As Expected...

$\endgroup$
  • $\begingroup$ Thank you very much for your help! So you're suggesting that I'm doing something wrong when using Wolfram Alpha or that Wolfram is doing something weird? Just an additional curiosity, I read on some forums people saying: Laplace trasforms are for transient signals and Fourier transforms are for steady states... Is that wrong? I have the impression that Laplace transforms may be more comfortable for transients such as step functions... But as soon as Fourier converge you could use it as well right? $\endgroup$ – Worldsheep Dec 24 '15 at 18:01
  • $\begingroup$ Probably you'r doing something wrong. Yes it is true that Laplace T. is more generally applicable than FT, including unstable systems, transient responses, (systems with initial conditions) etc, however FT is also a great and necessary tool for frequency analysis. Also don't confuse FT with Sinusoidal Steady State analysis of AC circuits. As you can see from this example you can use FT to analyse transients as well, provided that you allow Generalized Functions such as impulse in the definition of FT, in cases it does not converge formally unlike Laplace T. which always converges $\endgroup$ – Fat32 Dec 24 '15 at 18:39
  • $\begingroup$ can you please upvote the answer, if you consider it as an answer ? $\endgroup$ – Fat32 Dec 24 '15 at 18:41
  • $\begingroup$ It's the first thing I've tried to do, but I don't have enough reputations here in signal processing :(. I'll read your second reply now. $\endgroup$ – Worldsheep Dec 24 '15 at 19:05
  • $\begingroup$ Ok so basically: FT is good as soon as it converges (with or without generalized functions or distribution) with a plus for its physical frequency decomposition meaning. If it doesn't converge then I need the LT? And when talking about LT you mean the unilateral [0 inf[ or the bilateral ]-inf [inf one? $\endgroup$ – Worldsheep Dec 24 '15 at 19:13
2
$\begingroup$

Fat32's derivation of the result via the Fourier transform is correct, but I think that your original question hasn't really been answered ("what am I doing wrong?"). The real reason why WolframAlpha gives you a wrong result is the different definitions of the Fourier transform used by WolframAlpha and the one used by you to derive $H(\omega)$. By default, WolframAlpha uses this definition of the Fourier transform:

$$F(\omega)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}f(t)e^{j\omega t}dt\tag{1}$$

Apart from the factor $1/\sqrt{2\pi}$ (which makes the transform unitary), the actual problem lies in the sign of the exponent. You implicitly assume a negative sign, whereas WolramAlpha uses a positive sign.

There are two ways to solve the problem. Either you change Wolfram Alpha's default parameters using FourierParameters -> {1, -1} as explained here, or you change $H(\omega)$ accordingly, which means that you would need to use

$$H(\omega)=\frac{1}{1-j\omega RC}\tag{2}$$

As an example I tried the second method, and WolframAlpha indeed provides the correct result.

One more thing, for this kind of problems it's usually more convenient to use the Laplace transform because this avoids the use of generalized functions, such as the Dirac delta.

$\endgroup$
  • $\begingroup$ Thank you for your answer. Even before posting on this forum, I tried changing the sign in the transfer function (randomly) and when I discovered that it was giving me the right answer I thought I was doing a sign mistake. Then I remember having the idea of the different definition but I don't know why I gave up on that :/ . I still don't understand why H(w) fixes the sign in Fourier. Where am I implicitly fixing the sign? I mean I have computed H(w) just from the impedances of the capacitor and the resistor. $\endgroup$ – Worldsheep Dec 24 '15 at 22:46
  • $\begingroup$ Ah I think I have understood while writing this post. It coms from the "definizion" of Z_r and Z_c right? $\endgroup$ – Worldsheep Dec 24 '15 at 22:47
  • $\begingroup$ Do you have any idea why WA uses a positive $\omega$ on the forward CTFT contrary to the widely accepted negative $\omega$ by convention ? What is the benefit ? $\endgroup$ – Fat32 Dec 24 '15 at 23:33
  • $\begingroup$ @Worldsheep: Yes, normally differentiation in the time domain corresponds to multiplication with $j\omega$ in the frequency domain. With WA's definition this becomes multiplication with $-j\omega$, so the impedance of a capacitor becomes $-1/j\omega C$, and the impedance of an inductor becomes $-j\omega L$. $\endgroup$ – Matt L. Dec 25 '15 at 11:41
  • $\begingroup$ @Fat32: There's no benefit, just a different convention. According to WA, this is the "modern physics" definition. However, all fields I'm familiar with use the negative sign. $\endgroup$ – Matt L. Dec 25 '15 at 11:43

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.