SlideShare a Scribd company logo
1 of 6
Download to read offline
The role of filters in reducing noise of specific
wavelengths in biomedical signals: An introduction
to low-pass, high-pass, and bandpass filters
Austin Lefebvre1,*, Jericho Hallare1, and Bruce Wheeler1
1Department of Bioengineering, University of California, San Diego, United States
*Assignment submitted by this student
ABSTRACT
The use of low-pass filters, high-pass filters, and a combination of both allows for noise reduction in situations where interference
is impeding data collection. We discuss and demonstrate optimal use of each type of filter, and their effects on the output
signal. The use of a first order low-pass filter allows for the filtration of high frequency noise, while the first order high-pass
filter allows for the filtration of low frequency noise whose signal we amplify using an operational amplifier, both using only
one energy-storing component. By combining a low-pass and a high-pass filter, a bandpass filter is created, where the input
first passes through the high-pass filter to filter out the low frequency signals, then passes through the low-pass filter to
filter out the high frequency signals, thus only outputting the signals in a desired frequency range. This band-pass filter is
tested using noisy ECG data input through Matlab, and output through an oscilloscope. We also discuss the method and
usefulness of digital filtration, with which signal filtration can be performed on a high level, using a microprocessor and complex
mathematical operations. To demonstrate this, we use LabVIEW to create and filter different analog signals and perform Fast
Fourier Transforms.
Introduction
In a biomedical setting, EEG and ECG data may be hard to interpret directly, due to interference in the equipment’s wiring,
or due to other unwanted local electrical signals in the body. For this reason, the signal is applied through a variety of filters
to allow a relatively noise-free output to pass, rid of any unwanted frequencies. If our measured frequencies are AC, but we
manage to pick up an unwanted DC offset, we can use a high-pass filter with a very low cut-off frequency to remove the offset,
and then amplify our signal using an op-amp.
The most simplistic of filters are first-order passive filters, constructed using only one energy-storing component (such
as a capacitor or an inductor) and one resistor. Depending on the layout, the circuit will allow either high frequency, or low
frequency signals to pass through to the output, feeding the rest of the unwanted signal to the ground. In the case of a low-pass
filter, a resistor is put in series with the output, while a capacitor is put in parallel with it. A capacitor’s reactance is inversely
proportional to the frequency. A capacitor with a high reactance will not allow much current to flow through it. In consequence,
only the low frequency outputs will pass through the capacitor unaffected, while the high frequency outputs above the cut-off
frequency become attenuated. A high-pass filter is easily made by switching the capacitor and the resistor on the circuit. This
allows the capacitor to allow signals of only frequencies above the cut-off frequency to pass through it, since it will act like an
open circuit with high reactance at low frequencies. To analyze the circuit in a simpler manner, the input and output voltages
are represented as steady-state phasors, while the resistor and capacitor are represented as impedances. The circuit is clearly a
voltage divider using equation 1, and the gain of the circuit can thus be found with equation 2. The cut-off frequencies for both
the high-pass and low-pass filters are calculated using equation 3. Graphically representing the magnitude and phase of passive
filters is most commonly done through the use of Bode plots. To compute the magnitude, the desired frequency is plugged in to
the gain equation above and the gain is converted to decibels, using equation 4. This magnitude is then plotted against a log
scale of the frequency. To compute the phase, we take the arctan of the gain at the desired frequency. Bode plot calculations
using MATLAB are also described in more detail in the results section.
An active filter can be used in order to amplify our output signal. Although not described in depth in this paper, simply
connecting a low-pass filter to an inverting or non-inverting op-amp can make a low-pass active filter. Often times, our signal
will have a DC offset interfering with our desired AC signal. To filter out this DC offset, a high-pass filter can be created to
remove the DC noise, and the filter connected to an amplifier, which will in turn amplify the AC portion of the signal. Either
an inverting or non-inverting amplifier can be used, with an increased dynamic stability in the latter case. Furthermore, by
connecting both the low-pass and high-pass filters together, we can create a band-pass filter, allowing wavelengths in only a
specific range of frequencies to pass through the circuit. This utilizes both the blockage of high frequency waves from the
low-pass circuit, and the blockage of the low frequency waves from the high-pass circuit, enhanced with the op-amp to create
high gain, low noise signal. Often times, these band-pass filters will have unavoidable ripples in their stop-band and pass-band
due to finite impulse response approximations.
In certain high precision scenarios a steeper frequency response slope may be required. Higher order filters can be a solution,
but are more complex and require more space, along with a higher cost. As filter order increases, the circuit becomes harder to
build, and more expensive to afford the required components. Fortunately, digital filters are readily available at a much lower
cost, and can perform accurate, high order filtering. The filter type can be chosen through the software program depending on
what is necessary while the user determines the number of inputs to use. The more inputs used, the more ideal the filter, but the
longer delay between input and output. These digital filtering methods are discussed in the results section, using LabVIEW
to simulate Finite Impulse Response filtering. These filters have impulse responses that go to zero in a finite amount of time,
and its output is determined by the summation of the circuit’s current and past input values. Another type of digital filter, the
Infinite Impulse Response, will not be discussed in detail, but is also useful, as is has impulse responses that may never go to
zero, and is very similar to the hardware filters described earlier.
In the materials and methods section, various filters will be designed and analyzed, and biomedical signals will be
incorporated through them. A simple first-order low-pass filter will be built and connected to an active first-order high-pass
filter, creating a band-pass filter. A simulated ECG signal will be run through the bandpass filter and the effectiveness of the
filter will be analyzed. We will also simulate a low-pass digital filter using LabVIEW and Fast Fourier Transform on the signal.
Methods
Low-Pass Filter
A first-order low-pass filter was built as laid out in Figure 1 using a standard breadboard. The resistor and capacitor values
were substituted into equation 3 to obtain a predicted cutoff frequency of 16.09 Hz. Setting the frequency generator to a value
that is 10 times less that the predicted cutoff frequency to ensure it is in the pass-band, and multiplying the magnitude of the
transfer function at this frequency by 0.707 determined the actual cutoff frequency of 15.92 Hz. A bode plot was designed,
using MATLAB’s bode and tf functions in accordance with the lab manual for exercise 4, giving Figure 2.1 The output of the
low-pass filter was measured at the input signals of the cutoff frequency of 15.9Hz, and then measured at 10%, 50%, 200%, and
1000% of the cutoff frequency to demonstrate the functionality of the filter.
Figure 1. Low-pass Filter Design with measured
resistance and capacitor values.
Figure 2. Low-pass Bode Diagram created with
MATLAB and overlaid with measured values
corresponding with Table 1
Active High-Pass Filter
A first-order low-pass filter was built as laid out in Figure 3 using a standard breadboard. The resistor and capacitor values were
substituted into equation 3, using R1 as the R value, to obtain a predicted cutoff frequency of 0.81 Hz. A LM741 op-amp was
set up according to the specifications sheet with an input voltage of +/- 10V.2 Setting the frequency generator to a value that is
100 times the predicted cutoff frequency to ensure it is in the pass-band, and multiplying the magnitude of the transfer function
at this frequency by 0.707 determined the actual cutoff frequency of 0.720 Hz. A bode plot was designed, using MATLAB’s
bode and tf functions in accordance with the lab manual for exercise 4, giving Figure 4.1 The output of the low-pass filter was
2/6
measured at the input signals of the cutoff frequency of 0.720 Hz, and then measured at 10%, 50%, 200%, and 1000% of the
cutoff frequency to demonstrate the functionality of the filter.
Figure 3. Active High-pass Filter Design with
measured resistance and capacitor values.
Figure 4. Active High-pass Bode Diagram created with
MATLAB and overlaid with measured values
corresponding with Table 2
Bandpass Filter
The output of the high-pass filter was connected to the input of the low-pass filter to create a bandpass filter and connected to
an oscilloscope to measure their collective output. The frequency was lowered until the high-pass cutoff was observed and
subsequently raised until the low-pass cutoff was observed in order to demonstrate the functionality of the combined filter.
LabVIEW Simulation, Filtering and Analysis
Using the LabVIEW FILTERSIM VI downloaded in the Lab 4 folder, a signal is simulated and filtered digitally. The VI was
run and set to the sine frequency to 10 Hz with the knob. The low-pass cutoff frequency was then modified with the other cutoff
knob. The filter was then changed to high-pass, and the filter cutoff knob was modified to demonstrate and subsequently record
the effects.
Simulation with MATLAB and Filtering With Band-Pass Circuit
Using the signal ECGNoise downloaded in the Lab 4 folder, which is an ECG signal corrupted with 60Hz noise, the MATLAB
script provided in the lab manual of exercise 4 was generated and run (supplemental MATLAB section). The generated signal
was connected to the input of the band-pass analog filter built above and output to an oscilloscope in order demonstrate the
effectiveness of the bandpass filter in an applicable biomedical setting.
Results
Low-Pass Filter
Using the low-pass filter designed in Figure 1, the magnitude of the transfer function was measured at 10%, 50%, 200%, and
1000% of the cutoff frequency. The actual cut-off frequency was determined to be at 15.92Hz. This is the frequency at which
the magnitude of the transfer function is 0.707 times the pass-band magnitude. At 10%, the frequency was set to 1.592Hz. At
50% the frequency was set to 7.96Hz. At 200% the frequency was set to 31.84Hz. Finally, at 1000% the frequency was set to
159.2Hz. Figure 5 depicts the input signal (channel 1) and the output signal (channel 2) after being run through the low-pass
filter near the cut-off frequency – a frequency of 15.89Hz. From this oscilloscope display, the input and output voltages were
obtained at each test frequency, after changing the input signal on the function generator. The gain was then calculated using
the obtained input and output voltages and plugging in the values to equation 2. That gain was then converted to a decibel
magnitude and compared to the bode plot of Figure 2 that was created using MATLAB, as described in the Materials and
Methods section. The results are laid out in Table 1.
3/6
Figure 5. Low-pass filter output
with an input set to the cut-off
frequency. Picture taken by cellphone.
Figure 6. High-pass filter output
with an input set to the cut-off
frequency. Picture taken by cellphone.
Figure 7. Bandpass filter output
with an input set to within the pass
band. Picture taken by cellphone.
Active High-Pass Filter
Using the high-pass filter designed above, the magnitude of the transfer function was measured at 10%, 50%, 200%, and 1000%
of the cutoff frequency. The actual cut-off frequency was determined to be at 0.720Hz. This is the frequency at which the
magnitude of the transfer function is 0.707 times the pass-band magnitude. At 10%, the frequency was too low to properly
set on the function generator, and thus was omitted from the data. At 50% the frequency was set to 0.369Hz. At 200% the
frequency was set to 1.444Hz. Finally, at 1000% the frequency was set to 7.154Hz. Figure 6 depicts the input signal (channel 1)
and the output signal (channel 2) after being run through the active high-pass filter near the cut-off frequency – a frequency of
0.720Hz. From this oscilloscope display, the input and output voltages were obtained at each test frequency. The gain was
then calculated using the obtained input and output voltages and plugging in the values to equation 2. That gain was then
converted to a decibel magnitude and compared to the bode plot of Figure 4 that was created using MATLAB, as described in
the Materials and Methods section. The results are laid out in Table 2.
Input Amp pk-pk (V) Output Amp pk-pk (V) Output/Input (V/V) Frequency (Hz)
1.08 0.92 0.8519 15.87
1.08 0.98 0.9074 1.59
1.08 0.98 0.9074 7.96
1.08 0.78 0.7222 31.8
1.08 0.28 0.2593 160
Table 1. Low-pass test frequencies and their input, output, and gain.
Input Amp pk-pk (V) Output Amp pk-pk (V) Output/Input (V/V) Frequency (Hz)
0.48 1.6 3.3333 0.72
0.48 1 2.0833 0.369
0.48 2.08 4.3333 1.44441
0.48 2.38 4.9583 7.1537
Table 2. Active high-pass test frequencies and their input, output, and gain.
Bandpass Filter
After connecting the output of the active high-pass filter to the input of the low-pass filter, the frequency of the input signal
was varied until the signal started getting cut off due to being outside of the pass band. The passband of the bandpass filter
was measured to be between 0.850Hz and 14.5Hz, and exemplified in Figure 7. The Matlab simulation was run through the
bandpass and the resulting output is displayed in Figure 8.
4/6
Figure 8. Low-pass filter output with an input set to the cut-off frequency. Picture taken by cellphone.
LabVIEW Simulated Filter and Fast Fourier Transform
The LabVIEW VI was modified and set to simulate a signal of a certain frequency and then run through a filter, while also
being modified by a Fast Fourier Transform. A result from the simulation is shown in Figure 9 below.
Figure 9. Signal simulation before and after passing through a low-pass filter simulation by LabVIEW along with its
computed Fast Fourier Transforms.
Discussion
While analyzing the actual cutoff frequency of the low-pass filter, it was clear that the actual cutoff frequency was not exactly
equal to the calculated cutoff frequency. However, the measured value had only a 1.06% error, and thus was extremely close to
the calculated cutoff frequency. In most situations, this error is negligible and the low-pass filter can be used reliably to filter
out high frequency signals. On the other hand, the comparison of bode plot vs. measured value had a significant deviation and
is cause for concern, but is likely due to noise in our hardware. The active high-pass filter had a 11.11% error. Although this
filter has a much higher error than the low-pass filter, it is still reasonably reliable, and can still be used in many situations
where low frequency signals must be filtered out, and when DC offsets are contributing to noisy signal outputs. The bode plot
was extremely similar to our measured values and can be reliably used to predict frequency values for varying magnitudes. The
added complexity of the op-amp, as well as higher resistor values most likely contributed to the larger error. The bandpass filter
had a 8.73% error, deviating slightly from both the predicted high-pass and low-pass filter frequency cutoffs slightly. Again,
although this error is higher than the low-pass filter’s error, it is still reasonably reliable to use when only frequencies of a
specific range are wanted.
The LabVIEW filters performed exactly as expected. When adjusting the filter cutoff frequency there were times when the
filtered signal did not immediately drop to the cutoff frequency, but this is expected, as there is a delay between the input and
output of the signal due to internal processing.
The noisy ECG signal that was run through our constructed band-pass filter was successfully amplified and its useful peak
data was much more visible compared to the noisy baseline below it. The amplifier also caused the signal to invert, but this
should not cause any difficulties in data collection as it is easily reverted, either with another op-amp, or through the use of
computer programs.
5/6
Conclusion
Biomedical signals can readily become interpretable by the use of filters, and the processing of signal data can be done with
reduced noise output, as well as a removal of DC offsets, all while amplifying the wanted signal. While handmade circuits
can be useful in low-level filtration, often times biomedical signals are vastly complicated and filtration is much more easily
attained through complex digital software. With the current available technology, biomedical engineers can readily interpret
complex signals and create new and innovative technology to advance the future of medicine.
References
1. Wheeler. Laboratory 4 filters. TritonEd (2016).
2. Corporation, N. S. Lm741 data sheet. National (2000).
Acknowledgements
Thank you to the TA’s Edward Catoiu and Rui Wang for the extensive help throughout the entire experiment.
Additional information
Equations
Vout = Vin ∗
Xc
Xc +R
(1)
Gain(
V
V
) =
Vout
Vin
(2)
fc =
1
2π ∗RC
(3)
Gain(db) = 20log10(
Vout
Vin
) (4)
MATLAB Code
ECG Simulation:
load ECGNoise;
s=daq.createSession(‘ni’)
s.Rate=1000
addAnalogOutputChannel(s,’Dev1’,0,’Voltage’)
queueOutputData(s,ECGNoise);
startForeground(s);
Post-Lab Question 5
To construct this circuit, a low-pass filter must be built using an op-amp. The cut-off frequency is 300Hz, and using equation 3
RC must be 5.31∗10−4. A peak-to-peak input voltage of 200µV, and peak-to-peak output voltage of 5V is also given. Using
equation 2 the gain is 25000V
V . It is easier to first choose an available capacitor value, and then calculate the required resistor
value afterwards, as variations in capacitors are usually limited. If a capacitor of value 0.1µF is used, we must then use a
resistor of value 5310Ω. The gain can then be modified by first making sure adequate power is supplied to the op-amp, and also
adjusting the frequency until it is within the passband. The LM741 op-amp can be used in this situation, as the large signal
voltage gain is high enough to amplify the signal to the desired gain.
6/6

More Related Content

What's hot

Amplifier frequency response(part 1)
Amplifier frequency response(part 1)Amplifier frequency response(part 1)
Amplifier frequency response(part 1)Jamil Ahmed
 
Communicationlabmanual
CommunicationlabmanualCommunicationlabmanual
Communicationlabmanualjkanth26
 
DENOISING OF ECG SIGNAL USING FILTERS AND WAVELET TRANSFORM
DENOISING OF ECG SIGNAL USING FILTERS AND WAVELET TRANSFORMDENOISING OF ECG SIGNAL USING FILTERS AND WAVELET TRANSFORM
DENOISING OF ECG SIGNAL USING FILTERS AND WAVELET TRANSFORMIJEEE
 
Comm introduction
Comm introductionComm introduction
Comm introductionmkazree
 
Eecb351 exp 8 ask fsk
Eecb351 exp 8 ask fskEecb351 exp 8 ask fsk
Eecb351 exp 8 ask fskZufayri Chan
 
Positive feedback: Oscillators
Positive feedback: OscillatorsPositive feedback: Oscillators
Positive feedback: OscillatorsYeshudas Muttu
 
Simple Wireless Radio Data Link
Simple Wireless Radio Data LinkSimple Wireless Radio Data Link
Simple Wireless Radio Data Linkguesta0b04c
 
Introduction To Antenna Impedance Tuner And Aperture Switch
Introduction To Antenna Impedance Tuner And Aperture SwitchIntroduction To Antenna Impedance Tuner And Aperture Switch
Introduction To Antenna Impedance Tuner And Aperture Switchcriterion123
 
Encoding1
Encoding1Encoding1
Encoding1munir09
 
Angle Modulation.pdf
Angle Modulation.pdfAngle Modulation.pdf
Angle Modulation.pdflaiyon
 
Noise Analysis in Op Amp
Noise Analysis in Op AmpNoise Analysis in Op Amp
Noise Analysis in Op AmpPremier Farnell
 
Class2 13 14_g_hz_differential_signaling
Class2 13 14_g_hz_differential_signalingClass2 13 14_g_hz_differential_signaling
Class2 13 14_g_hz_differential_signalingdouglaslyon
 
Communication Engineering - Chapter 6 - Noise
Communication Engineering - Chapter 6 - NoiseCommunication Engineering - Chapter 6 - Noise
Communication Engineering - Chapter 6 - Noisemkazree
 
Oscilloscope Lab
Oscilloscope LabOscilloscope Lab
Oscilloscope Labcyberns_
 

What's hot (20)

Amplifier frequency response(part 1)
Amplifier frequency response(part 1)Amplifier frequency response(part 1)
Amplifier frequency response(part 1)
 
Communicationlabmanual
CommunicationlabmanualCommunicationlabmanual
Communicationlabmanual
 
Optical heterodyne detection
Optical heterodyne detectionOptical heterodyne detection
Optical heterodyne detection
 
DENOISING OF ECG SIGNAL USING FILTERS AND WAVELET TRANSFORM
DENOISING OF ECG SIGNAL USING FILTERS AND WAVELET TRANSFORMDENOISING OF ECG SIGNAL USING FILTERS AND WAVELET TRANSFORM
DENOISING OF ECG SIGNAL USING FILTERS AND WAVELET TRANSFORM
 
Comm introduction
Comm introductionComm introduction
Comm introduction
 
Eecb351 exp 8 ask fsk
Eecb351 exp 8 ask fskEecb351 exp 8 ask fsk
Eecb351 exp 8 ask fsk
 
Pulse modulation
Pulse modulationPulse modulation
Pulse modulation
 
Positive feedback: Oscillators
Positive feedback: OscillatorsPositive feedback: Oscillators
Positive feedback: Oscillators
 
Simple Wireless Radio Data Link
Simple Wireless Radio Data LinkSimple Wireless Radio Data Link
Simple Wireless Radio Data Link
 
Introduction To Antenna Impedance Tuner And Aperture Switch
Introduction To Antenna Impedance Tuner And Aperture SwitchIntroduction To Antenna Impedance Tuner And Aperture Switch
Introduction To Antenna Impedance Tuner And Aperture Switch
 
Encoding1
Encoding1Encoding1
Encoding1
 
AM Receivers
AM ReceiversAM Receivers
AM Receivers
 
Angle Modulation.pdf
Angle Modulation.pdfAngle Modulation.pdf
Angle Modulation.pdf
 
lab_13_14_essay
lab_13_14_essaylab_13_14_essay
lab_13_14_essay
 
Noise Analysis in Op Amp
Noise Analysis in Op AmpNoise Analysis in Op Amp
Noise Analysis in Op Amp
 
Ads harmonic balance
Ads harmonic balanceAds harmonic balance
Ads harmonic balance
 
Class2 13 14_g_hz_differential_signaling
Class2 13 14_g_hz_differential_signalingClass2 13 14_g_hz_differential_signaling
Class2 13 14_g_hz_differential_signaling
 
Communication Engineering - Chapter 6 - Noise
Communication Engineering - Chapter 6 - NoiseCommunication Engineering - Chapter 6 - Noise
Communication Engineering - Chapter 6 - Noise
 
Oscilloscope Lab
Oscilloscope LabOscilloscope Lab
Oscilloscope Lab
 
Pluse amplitude modulatiion
Pluse amplitude modulatiionPluse amplitude modulatiion
Pluse amplitude modulatiion
 

Viewers also liked

Rommy djunaedi activities
Rommy djunaedi activitiesRommy djunaedi activities
Rommy djunaedi activitiesRommy Djunaedi
 
BtB Mag Tab GlobalSpec Ad (PQ)
BtB Mag Tab GlobalSpec Ad (PQ)BtB Mag Tab GlobalSpec Ad (PQ)
BtB Mag Tab GlobalSpec Ad (PQ)Kimberly Danforth
 
Kwantologia 11.9 – matematyka.
Kwantologia 11.9 – matematyka.Kwantologia 11.9 – matematyka.
Kwantologia 11.9 – matematyka.Łozowski Janusz
 
Kwantologia 10.9 – eter, itp.
Kwantologia 10.9 – eter, itp.Kwantologia 10.9 – eter, itp.
Kwantologia 10.9 – eter, itp.Łozowski Janusz
 
Kwantologia 10.1 – uwaga!, Tło.
Kwantologia 10.1 – uwaga!, Tło.Kwantologia 10.1 – uwaga!, Tło.
Kwantologia 10.1 – uwaga!, Tło.Łozowski Janusz
 
Aggression its nature, causes, and control - Analysis
Aggression its nature, causes, and control - AnalysisAggression its nature, causes, and control - Analysis
Aggression its nature, causes, and control - AnalysisHina Anjum
 
Drogi na EURO 2012 stan na - 28.02.2011
Drogi na EURO 2012 stan na - 28.02.2011 Drogi na EURO 2012 stan na - 28.02.2011
Drogi na EURO 2012 stan na - 28.02.2011 Michał Jaros
 
Corpos menores do Sistema Solar
Corpos menores do Sistema SolarCorpos menores do Sistema Solar
Corpos menores do Sistema SolarLucas Guimaraes
 
Aplicações da equação de Schrödinger independente do tempo
Aplicações da equação de Schrödinger independente do tempoAplicações da equação de Schrödinger independente do tempo
Aplicações da equação de Schrödinger independente do tempoLucas Guimaraes
 

Viewers also liked (12)

Rommy djunaedi activities
Rommy djunaedi activitiesRommy djunaedi activities
Rommy djunaedi activities
 
BtB Mag Tab GlobalSpec Ad (PQ)
BtB Mag Tab GlobalSpec Ad (PQ)BtB Mag Tab GlobalSpec Ad (PQ)
BtB Mag Tab GlobalSpec Ad (PQ)
 
Työ 2.0
Työ 2.0Työ 2.0
Työ 2.0
 
Kwantologia 11.9 – matematyka.
Kwantologia 11.9 – matematyka.Kwantologia 11.9 – matematyka.
Kwantologia 11.9 – matematyka.
 
Kwantologia 10.9 – eter, itp.
Kwantologia 10.9 – eter, itp.Kwantologia 10.9 – eter, itp.
Kwantologia 10.9 – eter, itp.
 
Kwantologia 10.1 – uwaga!, Tło.
Kwantologia 10.1 – uwaga!, Tło.Kwantologia 10.1 – uwaga!, Tło.
Kwantologia 10.1 – uwaga!, Tło.
 
Longitud e almazan_1°b
Longitud e almazan_1°bLongitud e almazan_1°b
Longitud e almazan_1°b
 
Aggression its nature, causes, and control - Analysis
Aggression its nature, causes, and control - AnalysisAggression its nature, causes, and control - Analysis
Aggression its nature, causes, and control - Analysis
 
Drogi na EURO 2012 stan na - 28.02.2011
Drogi na EURO 2012 stan na - 28.02.2011 Drogi na EURO 2012 stan na - 28.02.2011
Drogi na EURO 2012 stan na - 28.02.2011
 
Corpos menores do Sistema Solar
Corpos menores do Sistema SolarCorpos menores do Sistema Solar
Corpos menores do Sistema Solar
 
Aplicações da equação de Schrödinger independente do tempo
Aplicações da equação de Schrödinger independente do tempoAplicações da equação de Schrödinger independente do tempo
Aplicações da equação de Schrödinger independente do tempo
 
Management of Aggression
Management of AggressionManagement of Aggression
Management of Aggression
 

Similar to LefebvreAustinLab4FormalReport

Sinewave Generation 1. Problem Statement The goal of t.docx
Sinewave Generation 1. Problem Statement The goal of t.docxSinewave Generation 1. Problem Statement The goal of t.docx
Sinewave Generation 1. Problem Statement The goal of t.docxjennifer822
 
Introduction
IntroductionIntroduction
IntroductionFyndi Aw
 
5. An analog filer has system fnction Ha(s)--a (a) (10 pts,) Comvert .pdf
5. An analog filer has system fnction Ha(s)--a (a) (10 pts,) Comvert .pdf5. An analog filer has system fnction Ha(s)--a (a) (10 pts,) Comvert .pdf
5. An analog filer has system fnction Ha(s)--a (a) (10 pts,) Comvert .pdfinfo324235
 
EMI unit-2 signal generators and signal analyzers
EMI unit-2 signal generators and signal analyzersEMI unit-2 signal generators and signal analyzers
EMI unit-2 signal generators and signal analyzersGopalakrishnaU
 
EMI unit-2 signal generators and signal analyzers
EMI unit-2  signal generators and signal analyzersEMI unit-2  signal generators and signal analyzers
EMI unit-2 signal generators and signal analyzersGopalakrishnaU
 
Development of a receiver circuit for medium frequency shift keying signals.
Development of a receiver circuit for medium frequency shift keying signals.Development of a receiver circuit for medium frequency shift keying signals.
Development of a receiver circuit for medium frequency shift keying signals.inventionjournals
 
Module-V-Wave-Analyzers-G.Anitha.ppt
Module-V-Wave-Analyzers-G.Anitha.pptModule-V-Wave-Analyzers-G.Anitha.ppt
Module-V-Wave-Analyzers-G.Anitha.pptMANIMEGALAIMECE
 
AM RECEIVERS 2.docx
AM RECEIVERS 2.docxAM RECEIVERS 2.docx
AM RECEIVERS 2.docxCyprianObota
 
Signal Analysers
Signal AnalysersSignal Analysers
Signal AnalysersDhruv Shah
 

Similar to LefebvreAustinLab4FormalReport (20)

Sinewave Generation 1. Problem Statement The goal of t.docx
Sinewave Generation 1. Problem Statement The goal of t.docxSinewave Generation 1. Problem Statement The goal of t.docx
Sinewave Generation 1. Problem Statement The goal of t.docx
 
Introduction
IntroductionIntroduction
Introduction
 
5. An analog filer has system fnction Ha(s)--a (a) (10 pts,) Comvert .pdf
5. An analog filer has system fnction Ha(s)--a (a) (10 pts,) Comvert .pdf5. An analog filer has system fnction Ha(s)--a (a) (10 pts,) Comvert .pdf
5. An analog filer has system fnction Ha(s)--a (a) (10 pts,) Comvert .pdf
 
EMI unit-2 signal generators and signal analyzers
EMI unit-2 signal generators and signal analyzersEMI unit-2 signal generators and signal analyzers
EMI unit-2 signal generators and signal analyzers
 
EMI unit-2 signal generators and signal analyzers
EMI unit-2  signal generators and signal analyzersEMI unit-2  signal generators and signal analyzers
EMI unit-2 signal generators and signal analyzers
 
Development of a receiver circuit for medium frequency shift keying signals.
Development of a receiver circuit for medium frequency shift keying signals.Development of a receiver circuit for medium frequency shift keying signals.
Development of a receiver circuit for medium frequency shift keying signals.
 
Module-V-Wave-Analyzers-G.Anitha.ppt
Module-V-Wave-Analyzers-G.Anitha.pptModule-V-Wave-Analyzers-G.Anitha.ppt
Module-V-Wave-Analyzers-G.Anitha.ppt
 
3 (2)
3 (2)3 (2)
3 (2)
 
Comm8(exp.3)
Comm8(exp.3)Comm8(exp.3)
Comm8(exp.3)
 
Pula
PulaPula
Pula
 
EMI Unit II
EMI Unit IIEMI Unit II
EMI Unit II
 
AM RECEIVERS 2.docx
AM RECEIVERS 2.docxAM RECEIVERS 2.docx
AM RECEIVERS 2.docx
 
ADC An Introduction
ADC An IntroductionADC An Introduction
ADC An Introduction
 
Signal Analysers
Signal AnalysersSignal Analysers
Signal Analysers
 
Pagara
PagaraPagara
Pagara
 
Pagra
PagraPagra
Pagra
 
E010523539
E010523539E010523539
E010523539
 
Radio Conformance Test
Radio Conformance TestRadio Conformance Test
Radio Conformance Test
 
Balane
BalaneBalane
Balane
 
Bani
BaniBani
Bani
 

LefebvreAustinLab4FormalReport

  • 1. The role of filters in reducing noise of specific wavelengths in biomedical signals: An introduction to low-pass, high-pass, and bandpass filters Austin Lefebvre1,*, Jericho Hallare1, and Bruce Wheeler1 1Department of Bioengineering, University of California, San Diego, United States *Assignment submitted by this student ABSTRACT The use of low-pass filters, high-pass filters, and a combination of both allows for noise reduction in situations where interference is impeding data collection. We discuss and demonstrate optimal use of each type of filter, and their effects on the output signal. The use of a first order low-pass filter allows for the filtration of high frequency noise, while the first order high-pass filter allows for the filtration of low frequency noise whose signal we amplify using an operational amplifier, both using only one energy-storing component. By combining a low-pass and a high-pass filter, a bandpass filter is created, where the input first passes through the high-pass filter to filter out the low frequency signals, then passes through the low-pass filter to filter out the high frequency signals, thus only outputting the signals in a desired frequency range. This band-pass filter is tested using noisy ECG data input through Matlab, and output through an oscilloscope. We also discuss the method and usefulness of digital filtration, with which signal filtration can be performed on a high level, using a microprocessor and complex mathematical operations. To demonstrate this, we use LabVIEW to create and filter different analog signals and perform Fast Fourier Transforms. Introduction In a biomedical setting, EEG and ECG data may be hard to interpret directly, due to interference in the equipment’s wiring, or due to other unwanted local electrical signals in the body. For this reason, the signal is applied through a variety of filters to allow a relatively noise-free output to pass, rid of any unwanted frequencies. If our measured frequencies are AC, but we manage to pick up an unwanted DC offset, we can use a high-pass filter with a very low cut-off frequency to remove the offset, and then amplify our signal using an op-amp. The most simplistic of filters are first-order passive filters, constructed using only one energy-storing component (such as a capacitor or an inductor) and one resistor. Depending on the layout, the circuit will allow either high frequency, or low frequency signals to pass through to the output, feeding the rest of the unwanted signal to the ground. In the case of a low-pass filter, a resistor is put in series with the output, while a capacitor is put in parallel with it. A capacitor’s reactance is inversely proportional to the frequency. A capacitor with a high reactance will not allow much current to flow through it. In consequence, only the low frequency outputs will pass through the capacitor unaffected, while the high frequency outputs above the cut-off frequency become attenuated. A high-pass filter is easily made by switching the capacitor and the resistor on the circuit. This allows the capacitor to allow signals of only frequencies above the cut-off frequency to pass through it, since it will act like an open circuit with high reactance at low frequencies. To analyze the circuit in a simpler manner, the input and output voltages are represented as steady-state phasors, while the resistor and capacitor are represented as impedances. The circuit is clearly a voltage divider using equation 1, and the gain of the circuit can thus be found with equation 2. The cut-off frequencies for both the high-pass and low-pass filters are calculated using equation 3. Graphically representing the magnitude and phase of passive filters is most commonly done through the use of Bode plots. To compute the magnitude, the desired frequency is plugged in to the gain equation above and the gain is converted to decibels, using equation 4. This magnitude is then plotted against a log scale of the frequency. To compute the phase, we take the arctan of the gain at the desired frequency. Bode plot calculations using MATLAB are also described in more detail in the results section. An active filter can be used in order to amplify our output signal. Although not described in depth in this paper, simply connecting a low-pass filter to an inverting or non-inverting op-amp can make a low-pass active filter. Often times, our signal will have a DC offset interfering with our desired AC signal. To filter out this DC offset, a high-pass filter can be created to remove the DC noise, and the filter connected to an amplifier, which will in turn amplify the AC portion of the signal. Either an inverting or non-inverting amplifier can be used, with an increased dynamic stability in the latter case. Furthermore, by connecting both the low-pass and high-pass filters together, we can create a band-pass filter, allowing wavelengths in only a
  • 2. specific range of frequencies to pass through the circuit. This utilizes both the blockage of high frequency waves from the low-pass circuit, and the blockage of the low frequency waves from the high-pass circuit, enhanced with the op-amp to create high gain, low noise signal. Often times, these band-pass filters will have unavoidable ripples in their stop-band and pass-band due to finite impulse response approximations. In certain high precision scenarios a steeper frequency response slope may be required. Higher order filters can be a solution, but are more complex and require more space, along with a higher cost. As filter order increases, the circuit becomes harder to build, and more expensive to afford the required components. Fortunately, digital filters are readily available at a much lower cost, and can perform accurate, high order filtering. The filter type can be chosen through the software program depending on what is necessary while the user determines the number of inputs to use. The more inputs used, the more ideal the filter, but the longer delay between input and output. These digital filtering methods are discussed in the results section, using LabVIEW to simulate Finite Impulse Response filtering. These filters have impulse responses that go to zero in a finite amount of time, and its output is determined by the summation of the circuit’s current and past input values. Another type of digital filter, the Infinite Impulse Response, will not be discussed in detail, but is also useful, as is has impulse responses that may never go to zero, and is very similar to the hardware filters described earlier. In the materials and methods section, various filters will be designed and analyzed, and biomedical signals will be incorporated through them. A simple first-order low-pass filter will be built and connected to an active first-order high-pass filter, creating a band-pass filter. A simulated ECG signal will be run through the bandpass filter and the effectiveness of the filter will be analyzed. We will also simulate a low-pass digital filter using LabVIEW and Fast Fourier Transform on the signal. Methods Low-Pass Filter A first-order low-pass filter was built as laid out in Figure 1 using a standard breadboard. The resistor and capacitor values were substituted into equation 3 to obtain a predicted cutoff frequency of 16.09 Hz. Setting the frequency generator to a value that is 10 times less that the predicted cutoff frequency to ensure it is in the pass-band, and multiplying the magnitude of the transfer function at this frequency by 0.707 determined the actual cutoff frequency of 15.92 Hz. A bode plot was designed, using MATLAB’s bode and tf functions in accordance with the lab manual for exercise 4, giving Figure 2.1 The output of the low-pass filter was measured at the input signals of the cutoff frequency of 15.9Hz, and then measured at 10%, 50%, 200%, and 1000% of the cutoff frequency to demonstrate the functionality of the filter. Figure 1. Low-pass Filter Design with measured resistance and capacitor values. Figure 2. Low-pass Bode Diagram created with MATLAB and overlaid with measured values corresponding with Table 1 Active High-Pass Filter A first-order low-pass filter was built as laid out in Figure 3 using a standard breadboard. The resistor and capacitor values were substituted into equation 3, using R1 as the R value, to obtain a predicted cutoff frequency of 0.81 Hz. A LM741 op-amp was set up according to the specifications sheet with an input voltage of +/- 10V.2 Setting the frequency generator to a value that is 100 times the predicted cutoff frequency to ensure it is in the pass-band, and multiplying the magnitude of the transfer function at this frequency by 0.707 determined the actual cutoff frequency of 0.720 Hz. A bode plot was designed, using MATLAB’s bode and tf functions in accordance with the lab manual for exercise 4, giving Figure 4.1 The output of the low-pass filter was 2/6
  • 3. measured at the input signals of the cutoff frequency of 0.720 Hz, and then measured at 10%, 50%, 200%, and 1000% of the cutoff frequency to demonstrate the functionality of the filter. Figure 3. Active High-pass Filter Design with measured resistance and capacitor values. Figure 4. Active High-pass Bode Diagram created with MATLAB and overlaid with measured values corresponding with Table 2 Bandpass Filter The output of the high-pass filter was connected to the input of the low-pass filter to create a bandpass filter and connected to an oscilloscope to measure their collective output. The frequency was lowered until the high-pass cutoff was observed and subsequently raised until the low-pass cutoff was observed in order to demonstrate the functionality of the combined filter. LabVIEW Simulation, Filtering and Analysis Using the LabVIEW FILTERSIM VI downloaded in the Lab 4 folder, a signal is simulated and filtered digitally. The VI was run and set to the sine frequency to 10 Hz with the knob. The low-pass cutoff frequency was then modified with the other cutoff knob. The filter was then changed to high-pass, and the filter cutoff knob was modified to demonstrate and subsequently record the effects. Simulation with MATLAB and Filtering With Band-Pass Circuit Using the signal ECGNoise downloaded in the Lab 4 folder, which is an ECG signal corrupted with 60Hz noise, the MATLAB script provided in the lab manual of exercise 4 was generated and run (supplemental MATLAB section). The generated signal was connected to the input of the band-pass analog filter built above and output to an oscilloscope in order demonstrate the effectiveness of the bandpass filter in an applicable biomedical setting. Results Low-Pass Filter Using the low-pass filter designed in Figure 1, the magnitude of the transfer function was measured at 10%, 50%, 200%, and 1000% of the cutoff frequency. The actual cut-off frequency was determined to be at 15.92Hz. This is the frequency at which the magnitude of the transfer function is 0.707 times the pass-band magnitude. At 10%, the frequency was set to 1.592Hz. At 50% the frequency was set to 7.96Hz. At 200% the frequency was set to 31.84Hz. Finally, at 1000% the frequency was set to 159.2Hz. Figure 5 depicts the input signal (channel 1) and the output signal (channel 2) after being run through the low-pass filter near the cut-off frequency – a frequency of 15.89Hz. From this oscilloscope display, the input and output voltages were obtained at each test frequency, after changing the input signal on the function generator. The gain was then calculated using the obtained input and output voltages and plugging in the values to equation 2. That gain was then converted to a decibel magnitude and compared to the bode plot of Figure 2 that was created using MATLAB, as described in the Materials and Methods section. The results are laid out in Table 1. 3/6
  • 4. Figure 5. Low-pass filter output with an input set to the cut-off frequency. Picture taken by cellphone. Figure 6. High-pass filter output with an input set to the cut-off frequency. Picture taken by cellphone. Figure 7. Bandpass filter output with an input set to within the pass band. Picture taken by cellphone. Active High-Pass Filter Using the high-pass filter designed above, the magnitude of the transfer function was measured at 10%, 50%, 200%, and 1000% of the cutoff frequency. The actual cut-off frequency was determined to be at 0.720Hz. This is the frequency at which the magnitude of the transfer function is 0.707 times the pass-band magnitude. At 10%, the frequency was too low to properly set on the function generator, and thus was omitted from the data. At 50% the frequency was set to 0.369Hz. At 200% the frequency was set to 1.444Hz. Finally, at 1000% the frequency was set to 7.154Hz. Figure 6 depicts the input signal (channel 1) and the output signal (channel 2) after being run through the active high-pass filter near the cut-off frequency – a frequency of 0.720Hz. From this oscilloscope display, the input and output voltages were obtained at each test frequency. The gain was then calculated using the obtained input and output voltages and plugging in the values to equation 2. That gain was then converted to a decibel magnitude and compared to the bode plot of Figure 4 that was created using MATLAB, as described in the Materials and Methods section. The results are laid out in Table 2. Input Amp pk-pk (V) Output Amp pk-pk (V) Output/Input (V/V) Frequency (Hz) 1.08 0.92 0.8519 15.87 1.08 0.98 0.9074 1.59 1.08 0.98 0.9074 7.96 1.08 0.78 0.7222 31.8 1.08 0.28 0.2593 160 Table 1. Low-pass test frequencies and their input, output, and gain. Input Amp pk-pk (V) Output Amp pk-pk (V) Output/Input (V/V) Frequency (Hz) 0.48 1.6 3.3333 0.72 0.48 1 2.0833 0.369 0.48 2.08 4.3333 1.44441 0.48 2.38 4.9583 7.1537 Table 2. Active high-pass test frequencies and their input, output, and gain. Bandpass Filter After connecting the output of the active high-pass filter to the input of the low-pass filter, the frequency of the input signal was varied until the signal started getting cut off due to being outside of the pass band. The passband of the bandpass filter was measured to be between 0.850Hz and 14.5Hz, and exemplified in Figure 7. The Matlab simulation was run through the bandpass and the resulting output is displayed in Figure 8. 4/6
  • 5. Figure 8. Low-pass filter output with an input set to the cut-off frequency. Picture taken by cellphone. LabVIEW Simulated Filter and Fast Fourier Transform The LabVIEW VI was modified and set to simulate a signal of a certain frequency and then run through a filter, while also being modified by a Fast Fourier Transform. A result from the simulation is shown in Figure 9 below. Figure 9. Signal simulation before and after passing through a low-pass filter simulation by LabVIEW along with its computed Fast Fourier Transforms. Discussion While analyzing the actual cutoff frequency of the low-pass filter, it was clear that the actual cutoff frequency was not exactly equal to the calculated cutoff frequency. However, the measured value had only a 1.06% error, and thus was extremely close to the calculated cutoff frequency. In most situations, this error is negligible and the low-pass filter can be used reliably to filter out high frequency signals. On the other hand, the comparison of bode plot vs. measured value had a significant deviation and is cause for concern, but is likely due to noise in our hardware. The active high-pass filter had a 11.11% error. Although this filter has a much higher error than the low-pass filter, it is still reasonably reliable, and can still be used in many situations where low frequency signals must be filtered out, and when DC offsets are contributing to noisy signal outputs. The bode plot was extremely similar to our measured values and can be reliably used to predict frequency values for varying magnitudes. The added complexity of the op-amp, as well as higher resistor values most likely contributed to the larger error. The bandpass filter had a 8.73% error, deviating slightly from both the predicted high-pass and low-pass filter frequency cutoffs slightly. Again, although this error is higher than the low-pass filter’s error, it is still reasonably reliable to use when only frequencies of a specific range are wanted. The LabVIEW filters performed exactly as expected. When adjusting the filter cutoff frequency there were times when the filtered signal did not immediately drop to the cutoff frequency, but this is expected, as there is a delay between the input and output of the signal due to internal processing. The noisy ECG signal that was run through our constructed band-pass filter was successfully amplified and its useful peak data was much more visible compared to the noisy baseline below it. The amplifier also caused the signal to invert, but this should not cause any difficulties in data collection as it is easily reverted, either with another op-amp, or through the use of computer programs. 5/6
  • 6. Conclusion Biomedical signals can readily become interpretable by the use of filters, and the processing of signal data can be done with reduced noise output, as well as a removal of DC offsets, all while amplifying the wanted signal. While handmade circuits can be useful in low-level filtration, often times biomedical signals are vastly complicated and filtration is much more easily attained through complex digital software. With the current available technology, biomedical engineers can readily interpret complex signals and create new and innovative technology to advance the future of medicine. References 1. Wheeler. Laboratory 4 filters. TritonEd (2016). 2. Corporation, N. S. Lm741 data sheet. National (2000). Acknowledgements Thank you to the TA’s Edward Catoiu and Rui Wang for the extensive help throughout the entire experiment. Additional information Equations Vout = Vin ∗ Xc Xc +R (1) Gain( V V ) = Vout Vin (2) fc = 1 2π ∗RC (3) Gain(db) = 20log10( Vout Vin ) (4) MATLAB Code ECG Simulation: load ECGNoise; s=daq.createSession(‘ni’) s.Rate=1000 addAnalogOutputChannel(s,’Dev1’,0,’Voltage’) queueOutputData(s,ECGNoise); startForeground(s); Post-Lab Question 5 To construct this circuit, a low-pass filter must be built using an op-amp. The cut-off frequency is 300Hz, and using equation 3 RC must be 5.31∗10−4. A peak-to-peak input voltage of 200µV, and peak-to-peak output voltage of 5V is also given. Using equation 2 the gain is 25000V V . It is easier to first choose an available capacitor value, and then calculate the required resistor value afterwards, as variations in capacitors are usually limited. If a capacitor of value 0.1µF is used, we must then use a resistor of value 5310Ω. The gain can then be modified by first making sure adequate power is supplied to the op-amp, and also adjusting the frequency until it is within the passband. The LM741 op-amp can be used in this situation, as the large signal voltage gain is high enough to amplify the signal to the desired gain. 6/6