Professional Documents
Culture Documents
Biomedical Introduccion
Biomedical Introduccion
Biomedical Introduccion
Engineering
Section 1: Basic electronics
Lecture 1.3: Filters
Frequency vs Time domains
The Time Domain refers to describing functions with respect to time, in other words
the value of function x is known for all real values of t
x t A sin t
x(t) X(f)
A
t f / 2 f
0dB 1
Change in magnitude or “Gain”
expressed in dB, so this is
LogLog plot
Stuff we don’t
Noise
Lowpass completely Highpass
removed “Cut off”
frequencies
Bandpass Bandstop/Notch
Filter response overview
In reality we cannot achieve a true “brick wall” filter! Not a limit of electronics or computation
it’s a physics/mathematical one – infinite sharp change in freq. requires infinite signal length
Ideal filter:
• Attenuation is ∞
• Ideal phase in pass band 0deg
• 0 Transition band
• 0 Ripple in pass or stop band
Filtering helps us remove interferences, reduce noise, emphasise certain parts of a signal.
All of which aid further processing and analysis
Sampling – Nyquist Frequency
Another crucial application of filtering is to reduce artefacts when sampling an analogue signal.
For a given sampling rate Fs, the maximum frequency which can be sampled correctly is 0.5Fs.
This is known as the Nyquist frequency.
0.4 Fs Fs 0.6 Fs Fs
2
sine wave F>0.5Fs is reflected in the
sine wave F<0.5Fs sampled ok line 0.5Fs known as folding
Sampling – Nyquist Frequency
Aliasing like this can cause some very weird results!
Best to avoid these frequencies being sampled at all. So use a low pass filter. This is
known as an anti-aliasing filter as it is designed to prevent these aliased signals.
E.g. Digital audio Fs/2 = 22.1 kHz, with an anti-alias cut off at ~20kHz
Transfer functions
As we are interested in describing something that changes with time, it is useful to
express the function block of the system F(t) as an ordinary differential equation (ODE)
x(t) y(t)
y h* x
h(x)
n n 1 2
d y d y d y dy
n
an 1 n 1 a2 2 a1 ao bx
dt dt dt dt
x(t)
X is input function y(t)
Y is output
N is order of the ODE
A0… are coefficients
Transfer functions – Laplace
Z(s)=X(s)H(s)G(s)
X(s) Y(s)
H(s) G(s)
The Laplace transform is an extension of the Fourier transform which allows us to consider
things changing over time. Rather that just sine waves.
Exponential Decays
s j Sine Waves
v (t ) i t R
v
Time domain
I s 1 V 1 I
G( s)
V s R R
Transfer functions of electronic components d x n
n
L n s X (s)
Capacitor v dt
Either definition of current/voltage
relationship gives same result i
C
1
Time domain i t C
dv v(t ) i t dt
dt C
11
Laplace domain I s CsV s V (s) I s
Cs
Transfer function:
I s I
G s Cs V Cs
V s
Transfer functions of electronic components d x n
n
L n s X (s)
Inductor dtv
An inductor resists changes of current by generating i
a voltage in opposition via magnetic induction
L
From Faraday’s Law: di
Time domain v t L
dt
Laplace domain V s LsI s
Transfer function
I s 1 I
G s V 1
V s Ls Ls
Transfer function RC filter example vr
i
The goal is the transfer function, with
vo the output of interest: V
H s 0 s R
vo
Vi s
vi C
Vi s RCsVo s Vo s
Vi s Vo s RCs 1
Transfer function w.r.t. voltage:
V0 s 1 1
H s
Vi s RCs 1 1 s RC
OK, so now what!?
Transfer function – Freq Response
Obtain the frequency domain response by
ignoring the time component of s σ=0
s j j
20 log10 G j
V0 s 1
G s
Vi s 1 RCs
1
G j
arg G j
1 j RC
1 1
c fc
RC 2 RC
“At low freq, no current goes into capacitor. At
high freq all current flows into capacitor”
Passive Filters – High Pass
20 log10 G j
RCs 1
G s fc
1 RCs 2 RC
arg G j
1
RCj c
G j RC
1 RCj
“At low freq, no current can pass capacitor. At
high freq all current flows through capacitor”
Transfer functions – Step response
Vin(s) Vout(s)
H(s) G(s)
Vout 1 1 Vout
2
1
Vin sC1 R1 1 sC2 R2 1 Vin s C1C2 R 1 R2 sC1C2 sC2 R 2 1
Rearranging:
Vout 1
2 This is the answer we want!
Vin s C1C2 R 1R2 s C1C2 C2 R 2 1
Making 2nd Order filter – V 2.0
However…
The circuit now has poor output
Vin
impedance, as it is determined by the
impedance of the second RC filter
Vout
We can improve this by adding a second
buffer at the end. Now the output
impedance is determined by the op-amp
and is theoretically zero.
Vout K
2
Vin s C1C2 R 1 R2 s C2 R1 C2 R 2 R1C1 (1 K 1
Rb
K 1 Gain also alters the roots of the denominator,
Ra so alters frequency response
Active Filters – Sallen Keys
Versatile Op-amp topology
SIGNAL
separable in frequency (noise 1).
But often it is in band (noise 2) i.e. shares
Noise 1
some of the same frequencies
Noise 2
If signal is repeated, align and average across
repeats. As noise is random with respect to
signal i.e. uncorrelated, averaged signal will be f
smoother 10 heartbeats Story of biomedical engineering!
Electrode
Noise ~2V or
~20,000 larger.
So a reduction of
80 dB (10,000)
still not enough!
Mains noise in room
Some graphic material used in the course was taken from publicly available online resources that
do not contain references to the authors and any restrictions on material reproduction.