You are on page 1of 17

An analog and a discrete

filter

(ELTE,IK) An analog and a discrete filter 1 / 17


The RC circuit

The RC circuit and its equation

Figure: The so called RC circuit

Input voltage: x(t). Output voltage (on the capacitor): v (t).


The electric current in the circuit: i(t).
Kirchhoff’s voltage law: The directed sum of the potential differences
(voltages) around any closed loop is zero.
Ri(t) + v (t) = x(t)
Since v = Q/C and i(t) = Q 0 (t) we have Q 0 (t) = C · v 0 (t). Thus
0
(ELTE,IK) RCv (t) +
An analog andva (t) x(t).
=filter
discrete 2 / 17
The RC circuit

Solution of the de.

The homogeneous equation


t

The equation: RCv 0 (t) + v (t) = 0. The solution: vh (t) = Ke RC .

A particular solution
By variation of constants:

Z t
t −s
1 −
vp (t) = e RC x(s) ds.
RC −∞

The complete solution


t Z t t −s
− 1 −
v (t) = Ke RC + e RC x(s) ds.
RC −∞
(ELTE,IK) An analog and a discrete filter 3 / 17
The RC circuit

Assume: constant 0 input generates constant 0 output.


It can only happen if K = 0. Consequently:
Z t t −s
1 −
Ax(t) := v (t) = e RC x(s) ds.
RC −∞
A is linear
If Ax1 = v1 and Ax2 = v2 then

Z t
t −s
1 − 
A(λ1 x1 + λ2 x2 )(t) = e RC λ1 x1 (s) + λ2 x2 (s) ds
RC −∞
Z t
t −s
1 −
= λ1 e RC x1 (s) ds
RC −∞
Z t
t −s
1 −
+ λ2 e RC x2 (s) ds
RC −∞
= λ1 Ax1 (t) + λ2 Ax2 (t)
(ELTE,IK) An analog and a discrete filter 4 / 17
The RC circuit

Properties (cont.)

A is time invariant
Let y (t) = x(t − t0 ) and Ax = v . Then

Z t
t −s
1 −
Ay (t) = e RC x(s − t0 ) ds
RC −∞
substituting u = s − t0
Z t−t0 t − (u + t0 )
1 −
= te RC x(u) du
RC −∞
Z t−t0 (t − t0 ) − u
1 −
= e RC x(u) du
RC −∞
= v (t − t0 )

(ELTE,IK) An analog and a discrete filter 5 / 17


The RC circuit

Properties (cont.)

A is realizable (causal)
Z t t −s
1 −
Ax(t) := v (t) = e RC x(s) ds.
RC −∞
The upper limit of the integration is t. This means that v (t) = Ax(t)
determined by the past values of the input signal x only.

A is stable, continuous
Taking the norm kxk∞ := supt∈R |x(t)| we obtain:

Z t
t −s Z t t −s
1 − 1 −
|Ax(t)| ≤ e RC kx(s)k∞ ds ≤ kxk∞ e RC ds
RC −∞ RC −∞
= kxk∞ ,

i.e. kAxk∞ ≤ kxk∞ . The system is continuous with respect to this


norm. (ELTE,IK) An analog and a discrete filter 6 / 17
The RC circuit

The RC circuit is filter

The output in form of convolution

Z t
t −s Z ∞
1 −
Ax(t) = e RC x(s) ds = h(t − s)x(s) ds =: (h ∗ x)(t),
RC −∞ −∞

where (
0, ha t < 0;
h(t) = t
1 − RC
RC e , ha t ≥ 0.

Impulse Response Function


h : the output generated by the unit impulse input.
It will be more transparent in the discrete case.

(ELTE,IK) An analog and a discrete filter 7 / 17


The RC circuit

The transfer function

Recall
Transfer function: H(λ)
Input: x(t) = eλ (t) = e2πiλt .
Output v = Aeλ = H(λ)eλ .

The calculation of the transfer function


The equation: RCv 0 (t) + v (t) = x(t).
Substituting v 0 (t) = H(λ)2πiλeλ (t) we have

(2iπλRC + 1)H(λ)eλ = eλ .

eλ 6= 0, therefore
1
H(λ) = .
1 + 2iπλRC

(ELTE,IK) An analog and a discrete filter 8 / 17


The RC circuit

Low pass filter


1
Energy spcetrum: |H(λ)|2 = .
1+ 4π 2 λ2 R 2 C 2

Figure: The energy spectrum of the RC circuit

(ELTE,IK) An analog and a discrete filter 9 / 17


The RC circuit

Generalization

Butterworth filters
Butterworth filter of order n
1
|H(λ)|2 =  2n .
λ
1+ λ0

RC circuit: n = 1.
Taking the limit n → ∞ : ideal filter.

(ELTE,IK) An analog and a discrete filter 10 / 17


The discrete RC circuit

A discrete filter

Input signal (sequence): x. Output signal: y .


y [k ] = ay [k − 1] + x[k ] (a > 0, k ∈ Z)
Remark: Using the notation ∆yk = yk − yk −1 the equation can be
written in the form of difference equation. Formal similarity with the
differential equation of the RC circuit.
The solution of the equation
Set y [k ] = ak v [k ]. Then

v [k ] − v [k − 1] = a−k x[k ].

Summing them up:


k
X
v [k ] − v [k − j] = a−` x[`] (j ∈ N).
`=k −j+1

(ELTE,IK) An analog and a discrete filter 11 / 17


The discrete RC circuit

Suppose that
0
X ∞
X
|a−n x[n]| = |an x[−n]| < ∞.
n=−∞ n=0

holds for the input signal.


Sufficient conditions: a < 1 and x is bounded.
Natural assumptions:
Boundedness needs no explanations.
If a ≥ 1 then the system is not stable. To this order take the unit
impulse input 
1, n = 0;
x[n] =
0, n 6= 0.
The output is y [n] = an n ≥ 0.

(ELTE,IK) An analog and a discrete filter 12 / 17


The discrete RC circuit
P∞ n x[−n]|
If a < 1 and x is bounded then n=0 |a < ∞. Then the right
side of
k
X
v [k ] − v [k − j] = a−` x[`]
`=k −j+1
is convergent as j → ∞.
This implies the convergence of the left side: the limit
limj→−∞ v [j] = b ∈ R exists.
k
X
v [k ] = b + a−` x[`] .
`=−∞
Hence
k
X
y [k ] = bak + ak −n x[n] (k ∈ Z).
n=−∞
The output of the constant 0 input is 0 : b = 0.
k
X
y [k ] = ak −n x[n].
(ELTE,IK) n=−∞
An analog and a discrete filter 13 / 17
The discrete RC circuit

The properties of the discrete system


If can be proved similarly to the analog case that the system is :
linear,
time invariant,
causal,
stable.
Discrete filter.

Discrete convolution
Let (
an , if n ≥ 0
h[n] =
0 , if n < 0.
Then

X
y [k ] = h[k − n]x[n] =: h ∗ x.
n=−∞

(ELTE,IK) An analog and a discrete filter 14 / 17


The discrete RC circuit

Impulse response
(
1 , if k = 0
The unit impulse: x[k ] =
0 , if k 6= 0.
The impulse response: the output of the unit impulse is

y [k ] = h[k ].

Transfer function
Set z ∈ C, x[k ] = z k . The convergence condition above holds only if
|z| > |a|.
Then
k k  z n ∞  
X
k −n
X
k k
X a n
y [k ] = a x[n] = a =a
n=−∞ n=−∞
a z
n=−k
∞  
 a −k X a n 1 z
= ak = zk a = x[k ].
z z 1− z z −a
n=0
(ELTE,IK) An analog and a discrete filter 15 / 17
The discrete RC circuit

Transfer function (cont.)


z
The transfer function of the system: H(z) = .
z −a
Analytic on the domain |z| > |a|.
Let: |z| = 1, which can be written in the form e2πiλ .
Then z k is a discrete trigonometric function.
The transfer function with variable λ
e2πiλ
H(λ) = .
e2πiλ − a
The energy spectrum
1
|H(λ)|2 = H(λ) · H(λ) =
(cos 2πλt − a)2 + sin2 2πλt
1 1
= 2
= .
1 + a − 2a cos 2πλ (1 − a) + 4a sin2 πλ
2

(ELTE,IK) An analog and a discrete filter 16 / 17


The discrete RC circuit

1
The energy spectrum of the discrete system for a = .
2

3.5

2.5

1.5

0.5
–0.4 –0.2 0 0.2 0.4
lambda

Figure: The energy spectrum of the discrete system

(ELTE,IK) An analog and a discrete filter 17 / 17

You might also like