Professional Documents
Culture Documents
RC.1
+
x(t)
-
y(t)
C
This document describes, by example, how to analyze passive circuits using Fourier transform methods, both by hand and by
using M ATLAB. The methods apply generally to diffeq systems.
This 1st-order example is simple enough that both the time-domain and frequency-domain approaches have comparable effort. But
for more complicated (higher-order) systems, the frequency-domain method is often easier than solving diffeqs and/or convolution.
Therefore, this 1st-order example serves to illustrate the methods in the simplest possible setting.
The key FT properties used are: convolution property, linearity, and (time-domain) differentiation property.
Find diffeq from circuit (210).
Find frequency response H()from circuit.
Find frequency response H()from diffeq.
Find diffeq from frequency response H().
Find impulse response h(t) from frequency response H().
Find step response from H().
Find response to eternal sinusoid.
Find response to causal sinusoid.
Compute and plot all of the above using M ATLAB.
Find diffeq from circuit
d
d
y(t). x(t) = vR (t) + y(t) = Ri(t) + y(t) = RC dt
y(t) + y(t).
By KCL and KVL: i(t) = C dt
So we have derived the following diffeq by time-domain circuit analysis:
y(t) + RC
d
y(t) = x(t).
dt
(RC-1)
X()
Y ()
=
ZC ()
R + ZC ()
so cross dividing:
H() =
ZC ()
Y ()
=
=
X()
R + ZC ()
1
jC
1
jC
+R
1
.
1 + jRC
(RC-2)
1
Y ()
=
.
X()
1 + jRC
RC.2
d
y(t) = x(t).
dt
1
H()ejt d.
Use inverse FT integral: h(t) = 2
1
j+a
1/RC
1
=
.
1 + jRC
j + 1/RC
if real(a) > 0. So H() is already in a form that can use that result. So by table lookup:
h(t) =
1 t/RC
e
u(t).
RC
(RC-3)
For higher-order systems, one usually needs PFE to simplify H() before taking the inverse FT to find h(t).
Find step response
Time-domain convolution approach
Useful if impulse response h(t) is known and easily integrated.
Z
u(t) h(t) s(t) = h(t) u(t) =
Frequency-domain approach
F
Since u(t) U () = () +
response is
S()
=
=
1
,
j
h( ) d
by the convolution property of the FT and the sampling property of (), the FT of the step
1
1
= H(0)() +
H()
H()U () = H() () +
j
j
1
1
1
+
[H() H(0)] = H(0)U () +
[H() H(0)],
H(0) () +
j
j
j
where the second line is small simplifying trick. Taking the inverse FT we see that the general form of the step response is
s(t) = H(0)u(t) + z(t), where Z() =
1
[H() H(0)].
j
1/RC
1
1
.
s s + 1/RC
s=j
1/RC
1 1/RC (s + 1/RC)
1
1
1 =
=
.
s s + 1/RC
s
s + 1/RC
s + 1/RC
RC.3
1
,
j + 1/RC
so taking the inverse FT (by table lookup) we get the following (transient) response:
z(t) = et/RC u(t).
Thus the system step response is:
(RC-4)
To check this answer, we should be able to differentiate the step response and get back the impulse response. Applying the product
rule and sampling property:
1 t/RC
d
t/RC
s(t) = (t) e
e
(t)
u(t)
h(t) =
dt
RC
1 t/RC
1 t/RC
e
e
u(t) =
u(t).
= (t) e0 (t) +
RC
RC
Find response to eternal sinusoid
Time domain approach: tedious convolution.
Frequency domain approach (derived using Fourier series):
x(t) = cos(0 t + ) LTI H() |H(0 )| cos(0 t + + \H(0 )),
so in this particular example the response to x(t) = cos(0 t + ) is
1
1
1
cos 0 t + + \
=p
cos 0 t + tan1 0 RC ,
y(t) =
1 + j0 RC
1 + j0 RC
1 + (0 RC)2
since
\ 1 + j1
0 RC
=\
(RC-5)
1 j0 RC
1 j0 RC
=\
= \1 j0 RC = tan1 0 RC.
(1 + j0 RC)(1 j0 RC)
1 + (0 RC)2
cos(0 t + )u(t)
j
j cos 0 sin
[e ( 0 ) + ej ( + 0 )] +
,
2
(j)2 + 02
[( 0 ) + ( + 0 )] +
H()
Y () = X()H() =
2
(j)2 + 02
j
[H(j0 )( 0 ) + H(j0 )( + 0 )] +
H()
=
2
(j)2 + 02
j
H()
= |H(0 )| [ej( 0 ) + ej( + 0 )] +
2
(j)2 + 02
j
j cos 0 sin
[e ( 0 ) + ej( + 0 )] +
+ Z()
= |H(0 )|
2
(j)2 + 02
j cos 0 sin
jH() |H(0 )|[j cos 0 sin ]
j
=
,
Z() =
2 H() |H(0 )|
2
2
2
(j) + 0
(j) + 0
(j)2 + 02
RC.4
where H(j0 ) = |H(0 )|ej , and the last step is a simplifying trick. Thus
y(t) = |H(0 )| cos(0 t + ) + z(t),
where we must find z(t) from the inverse FT of Z().
For our RC circuit, H() =
1 2
1+q
1
1+jRC ,
so |H(0 )| = 1
q 2
1+q
=
=
=
=
=
1+q2
j + 0 q
j
1
(j)2 + 02 1 + jRC
1 + q2
2
j[1 + q ] (1 + jRC)(j + 0 q)
1
(j)2 + 02
(1 + jRC)[1 + q 2 ]
j + jq 2 j 0 q (j)2 RC jRC0 q
1
(j)2 + 02
(1 + jRC)[1 + q 2 ]
2
RC[0 + (j)2 ]
1
(j)2 + 02 (1 + jRC)[1 + (0 RC)2 ]
1
1
RC
=
.
(1 + jRC)[1 + (0 RC)2 ]
1 + (0 RC)2 j + 1/RC
1
et/RC u(t),
1 + (0 RC)2
so
y(t) = |H(0 )| cos(0 t + )u(t)
1
et/RC u(t).
1 + (0 RC)2
(RC-6)
The first part is the steady state response, and the second part is the transient response, which decays away at a rate associated
with the time-constant of the RC circuit.
RC.5
d
y(t) = b0 x(t),
dt
where a1 = 0.5, a0 = 1, and b0 = 1. To use these values in M ATLAB, we construct coefficient arrays in descending order of
derivatives, i.e. [aN aN1 . . . a0 ] and [bM bM 1 . . . b0 ]. If any of the coefficients are zero, then one must include those zeros in
the coefficient array in M ATLAB.
M ATLAB plot of the frequency response H()
Here is how to plot magnitude and phase response over the range
0 to 10Hz (on a linear scale) using M ATLABs freqs command.
Note that the freqs command expects radians/sec, not Hz, as the
units of the 3rd argument.
|H(2 f)|
RC=0.5
0.5
0
0
4
6
f [Hz]
Phase response of RC circuit
10
10
0
H(2 f)
a = [0.5 1];
b = [1];
f = linspace(0, 10, 100);
H = freqs(b, a, 2*pi*f);
clf, subplot(211), plot(f, abs(H))
xlabel(f [Hz]), ylabel(|H(2\pi f)|)
title(Magnitude response of RC circuit)
text(8, 0.8, sprintf(RC=%g, a(1)))
subplot(212)
plot(f, angle(H))
xlabel(f [Hz]), ylabel(\angle H(2\pi f))
title(Phase response of RC circuit)
print(fig_rc_mag, -deps)
0.5
1
1.5
2
0
6
f [Hz]
RC.6
The following code plots the impulse response h(t) over the time
interval 0 to 5 seconds. All diffeq systems are causal (provided M
N , which always occurs for real systems like RLC circuits), so we
only need to plot h(t) for t > 0.
2
1.8
1.6
1.4
1.2
h(t)
a = [0.5 1];
b = [1];
t = linspace(0, 5, 100);
sys = tf(b,a);
h = impulse(sys, t);
clf, plot(t, h)
xlabel(t), ylabel(h(t))
title(Impulse response of RC circuit)
print(fig_rc_h, -deps)
1
0.8
0.6
0.4
0.2
0
0
3
t
RC.7
y(t) Matlab
y(t) analytical
steady state
0.4
0.2
y(t)
0
0.2
0.4
0.6
0.8
0
0.5
1.5
2
t [sec]
2.5
3.5
RC.8
j + 3
. Then
(j + 3)2 + 52
1/RC
s + 1/RC
s+3
.
2
2
(s + 3) + 5 s=j
To find y(t), we must first expand Y () using PFE. We do this for RC=0.5:
s+3
2s + 6
2s + 6
2
= 3
.
=
s + 2 (s + 3)2 + 52
(s + 2)[(s + 3)2 + 52 ]
s + 8s2 + 46s + 68
M ATLABs residue command will automatically find the poles (roots of denominator) and residues (numerators) for this polynomial. The following commands:
b = [2 6]
a = [1 8 46 68]
[r,p,k] = residue(b,a)
returns the following output:
r =
-0.0385
-0.0385
0.0769
p =
-3.0000
-3.0000
-2.0000
k =
[]
- 0.1923i
+ 0.1923i
+ 5.0000i
- 5.0000i
The ps and rs come in pairs, each corresponding to a single term in the PFE as follows:
0.0385 + j0.1923
0.0769
0.0385 j0.1923
+
+
.
Y () =
s (3.0000 + j5) s (3.0000 j5) s (2) s=j
Typing abs(r(1)), angle(r(1)) yields 0.1961, -1.7682, so r1 = 0.1961ej1.7682. Taking the inverse FT yields:
y(t)
=
=
The first term is the forced response, and the second term is the transient response.