NEED TO DO Q5-Q10.
Provide required screen captures and explanations organized appropriately
Instructions:
Plagiarism free
Solutions generated from any AI platform is strictly Prohibited
Referencing and formatting Style APA
Need Typed Solutions only./nBE 312 - Lab #8
Lab 8: ECG Noise and Filtering
I. Background
The Electrocardiogram (ECG/EKG) is an electrical signal produced by the heart muscle. It has an amplitude of about 1mV, so a good amplifier is necessary. Electrical noise or electromagnetic interference (EMI), is generated by many common appliances, such as: power lines, lights, computers, cell phones, etc. When the ECG signal is amplified the noise is amplified as well and often swamps the ECG signal. Signal conditioning the ECG signal is necessary to acquire a good quiet ECG.
The IX-TA-220 Recorder has the ability to output through the Stimulator any signal that is being recorded on its input, including the iWire ports. In this lab, we are going to perform two experiments. Experiment 1 focuses on using software filters to remove noise from the ECG signal. Experiment 2 uses a hardware filter that you assemble on the breadboards to remove noise from the ECG signal.
Experiment 1
1) Record the ECG from the subject using the iWire-B3G.
2) Introduce some 60Hz noise into the ECG recording, by spreading the electrode cables.
3) Identify the frequency of the noise using the spectrum analyzer.
4) Filter the signal using various software filters.
5) Compare the ECG recorded by the iWire-B3G with the filtered ECG.
Experiment 2
1) Record the ECG from the subject using the iWire-B3G.
2) Output the signal recorded by the iWire-B3G using the S1 Stimulator.
3) Send the ECG signal to the breadboard, using the C-BNC-BB cable.
4) Filter the signal on the breadboard.
5) Send the filtered signal back to the IX-TA-220, using the C-DIN-BB cable.
a. The C-DIN-BB cable also provides +5V and -5V power to power the circuit.
6) Compare the ECG recorded by the iWire-B3G with the filtered ECG
II. Setup
Equipment Required
. PC or Mac Computer
· IX-TA data acquisition unit and power supply
· USB cable
· ROAM Wireless ECG
· Labscribe: Settings>BioInstrumentation>ECGFilter-ROAM
. C-DIN-BB: Din to Breadboard cable
· C-BNC-BB: BNC to Breadboard cable
•
A-BREADBOARD: Breadboard
. Alcohol swabs
· Disposable ECG electrodes
1
BE 312 - Lab #8
Build the Filter Circuit
The first step is to construct a filter on the breadboard. The "breadboard" is a board that is used to create simple prototype electrical circuits without circuit boards or soldering to connect the components. An example is shown in Figure 1.
GLOBAL SPECIALTIES
Va
Vb Vc
!
ABCDE - FONIJ
ABODE
FGHI
.. 5
35
40
ABCD
Figure 1. Example breadboard. The one you use may look slightly different.
Breadboards have internal electrical connections that are common for all breadboards. Some holes are are electrically connected to each other inside the breadboard, while others are not. As shown in Figure 2, the long rows or columns of holes (usually indicated with a blue line, or black line, or red line along them) are all electrically connected inside the board. Thus a wire plugged into one of these holes will be electrically connected to all the others in that long row or column.
The central array of holes are connected differently. These are shown with the letters (A B C D E), (F G HIJ), and numbered rows (1,2,3,4 ... ). In each row A-E are all electrically connected. And F-J are electrically connected. But, (A-E) are not connected to (F-J). Rows are not connected either. Also note that if there are multiple (A-E) or (F-J) columns, they are all separate and not connected.
2
BE 312 - Lab #8
SPECIALTTES
+
ABCDE
FGHIJ
+
5
5
All the holes in this row are electrically connected in the breadboard
All the holes in this row are electrically connected in the breadboard (5 holes)
All the holes in this row are electrically connected in the breadboard (5 holes)
10
10m
KEL
15 KER
A
20
25
All the holes in this column are electrically connected in the breadboard.
A and B are separate, and are not electrically connected (although the holes in A are connected to each other and the holes in B are connected to each other).
Figure 2. Close-up of the breadboard explaining the internal connectivity.
For this lab, you will use a second order (2-pole) low pass filter as the hardware filter. The schematic is shown in Figure 3.
C2
0.22µF
R2
R1
U1
+
S1_Input
+
Output_A5
V1
V2
30.1k
30.1k
C1
TL062
+
0.22JF
5v
-5v
Figure 3. Schematic of the low pass filter you will build and use.
This filter is a Sallen Key 2-pole low pass filter. Its job is to remove 60Hz electrical noise picked up from fluorescent lights, computers, and AC power lines. Figure 4 shows this circuit as a "Fritzing diagram" which is a picture representation of what your circuit on the breadboard should look like
3
BE 312 - Lab #8
when completed.
1
in
10
FGHIJ
TL062
ABCDE
Figure 4. Fritzing diagram of the low pass filter.
Construct the circuit as shown and double check that the wires and components are all connected correctly. Once this is done, go to the breadboard setup and connect to the iWorx.
Breadboard Setup
1. Insert the BNC connector on the end of the C-BNC-BB cable into the S1 stimulator port of the TA.
2. Connect the other end of the C-BNC-BB cable to the breadboard.
3. Insert the DIN8 connector of the C-DIN-BB cable into the A5 port of the TA.
4. Connect the other end of the C-DIN-BB cable to the breadboard.
See Figure 5 and Figure 6 for pictures of these connections. Do these after the circuit has been assembled. Once everything is connected, continue to the next step and place the ECG electrodes.
4
BE 312 - Lab #8
C-DIN-BB +5 V
C-DIN-BB -5 V C-DIN-BB + Input
C-DIN-BB - Input
C-DIN-BB Ground
C-BNC-BB Signal
C-BNC-BB Ground
25
25
20
25
Vb
abcde
-
+
Figure 5. Photo of the breadboard with circuit. Note the wires to be connected to the iWorx box.
iWorx TA-ROAM
hij
a
REKAM
ROAM Wireless
HV Stimulator
O
A2
A4
iWire
LV Stim
A3
A5
A6
A7
PT
1
.2
S1
S2
BREADBOARD
WB-104-1
Va
C-BNC-BB
Figure 6. Breadboard connection to the iWorx box.
ECG Setup
5
BE 312 - Lab #8
1. Disconnect the ROAM from the dock and place the electrodes as shown in Figure 7.
REKAM
Figure 7. Electrode placement for ECG signal acquisition.
2. Instruct the subject to sit quietly with their hands in their lap. If the subject moves, the ECG trace will move off the top or bottom of the screen. If the subject moves any muscles in the arms or upper body, electromyograms (EMGs) from the muscles will appear on the ECG recording as noise.
6
BE 312 - Lab #8
III. Experiments
Aim: To record an ECG and identify the noise and use software filters.
Procedure
1. The provided ECGFilter LabScribe setting file has been preset with the following settings. The instructions in the Appendix are for your information and to help you modify other iWorx lab experiments to add the option for additional signal conditioning.
2. If you set everything up and connected the breadboard correctly, you should be able to see the hardware filtered data in Labscribe during/after the ECG data collection (Channel A5)
3. Introduce noise into the ECG signal, by spreading out the ECG leads. Separate the black cable (negative) from the red (positive) cable so environmental noise is picked up by the amplifier.
4. Click on the Record button, located on the upper right corner of the LabScribe Main window. The signal should begin scrolling across the screen.
Note: If the user clicks the Record button and there is no communication between the iWorx unit and computer, an error window will appear in the center of the Main window. Make sure the iWorx unit is turned on and connected to the USB port of the computer. Click OK and select the Find Hardware function from the LabScribe Tools menu.
5. Click on the AutoScale All button on the LabScribe toolbar, to Autoscale all the channels.
Half Display Double Display
New File
Save File
Analysis
XY Plot
Journal
Marks
Time
Time
Two Cursors
Preview
View Menu
Macro
1.23
Default View
IXTA View
Off
M
review
Open File
Main/Home
FFT
Find/Found Hardware
Meters
Stimulator
Zoom Between Cursors
Auto
One Cursors
Rec/Stop
Scale
Figure 8. Labscribe toolbar.
6. Record for two minutes.
7. Click Stop to halt the recording and click File -> Save As to save your data file.
. Channel A12: Raw ECG is the Raw ECG signal recorded by the iWire-B3G.
· Channel S1: Stim 1 is the output of the Stimulator that is sent to the breadboard
· Channel A5: Filtered ECG is the Filtered output of the ECG signal, after signal conditioning on the Breadboard.
8. The signals on A12 and S1 are the same, and should be noisy.
Experiment 1: ECG and 60 Hz Noise - Software Filters
The first analyses will be performed using software filters.
7
BE 312 - Lab #8
Identifying the frequency of the noise.
Click on the FFT icon to switch to FFT window (see Figure 9).
SnapToGrid <
FFT
>
V2-V1
T2-T1
Mea
Add Function
Raw ECG
28.430
18.000
6220.88€
4 5%
-5.5K-
-6K-J
-6.5K-
-7K-
-7.5Kč
0 msec
4.855 sec
9.710 sec
14.565 sec
19.415 sec
<
* Power Spectrum of Raw ECG
Q Q Q AQ & # Freq. Resolution = 1 Hz
Normalize
Power1
Power2
Frea1
Frea2
Add Function
0.000
4.000
75.000
1
0.95ª
0.9
0.85
0.75-
07
0.65
06
Power
0.55
0.5-
0.45-
0.4
0.35-
0.3-
0.25
02
0.15-
0.1
0
€
20
40
60
80
Figure 9. Raw signal and FFT of the signal.
· Choose the Raw ECG channel (highlighted in the image above).
. Make sure you have enough data in the window, You may need to click on the double display time to increase the displayed data.
· Place the cursors in the Raw ECG channel to select the region to perform the FFT.
. Click the AutoScale All button above the FFT graph. You will then see the FFT of the selected signal in the bottom graph.
· The signal strength near DC is too high in this case to see the noise components.
· Place the Cursors in the FFT window around 4 Hz and around 75Hz, Then click on the Zoom Between Cursors icon above the FFT graph.
· The FFT graph will now show data between 4 Hz and 75 Hz.
. Click on the Autoscale All button for the FFT graph to autoscale the data.
· Place the second cursor on the peak, you will see that it is at 60Hz.
We have thus determined that the main source of our noise is at 60 Hz.
8
BE 312 - Lab #8
Snap ToGrid <
> V2-V1
T2-T1
Mean Add Function
Raw ECG
640.890
16.795 6248.905
NUL
0 msec
4.855 sec
9.710 sec
14.565 sec
19.415 sec
<
* Power Spectrum of Raw ECG
& #* Freq. Resolution = 1 Hz
] Normalize
Frea
Frea2
Power1
Power2 Add Function
6.000
50.000
1365.067 4245.915
4 6K-
4.4K-
4.2K-
4K
3 8K-
3.6K
3.4K
3.2K
3K
2.BK
2.6
Power
2.4K
22K
2K
1.8K
1.6K-
1.4K-
1.2K
1000
800
600
400
200-
.
.
.
10
15
.
20
25
30
.
.
. .
.
35
40
50
.
. .
. .
55
60
65
70
7
Figure 10. FFT power spectrum zoomed.
Software Filters for reducing the noise:
Option1: Notch Filter:
The notch filter can be used to remove 60Hz noise.
To create a channel with the notch filter.
. Click on the fx on the Raw ECG channel bar.
· Choose 60 Hz notch filter. You may select to filter out the harmonics as well.
. . . .
Notch Filter Dialog
X
50 Hz Notch Filter
60 Hz Notch Filter
filter 3rd harmonic
filter 2nd harmonic
OK
Cancel
. Click OK.
A notch filter channel is now created.
Option2: FIR Filter:
A FIR (finite impulse response) filter can be used to reduce the noise in the signal.
To create a channel with an FIR filter:
. Click on the Raw ECG channel bar.
· Set the Low and High cutoff. For human ECG, a low cutoff of 0.1Hz and a High Cutoff of 35Hz works well.
· Choose the filter type and the order of the filter.
9
BE 312 - Lab #8
Filter Setup Dialog
X
Filter Type :
Hamming Window(default)
V
Low Cutoff
0.1
Filter Order ( odd number)
2001
High Cutoff
35
0
50
100
Frequency
Frequences in Color are passed while those in white are blocked
OK
Cancel
Figure 11. FIR filter setup window.
Labscribe window with the two filter options is shown below.
Speed: 200 s/sec
Display Time:
7.110 sec
Mark
ALL T2-T1( 10.930 sec - 8.560 sec)= 2.370 sec
- A1:Raw ECG Spirometer Q Q Q fx
V2-V1= 107.050 mV
-4.5K-
-5.5K-
-6K-
É -6.5K-
-7K
-7.5K-
C1:Comp Ch 1 Notch Filter(Raw ECG) @ @ @ fx
V2-V1= 83.387 mV
-5.25K-
-5.75K-
>-6.25K-
É
-6.75K-playerml
-7.25K-
-7.75K
C2:Comp Ch 2 FIR Filter(Raw ECG) @ @ @ fx
V2-V1= - 11.419 mV
1.25K
750-
250
mV
-250
-750
-1.25K_
6.190 sec
7.965 sec
9.745 sec
11.520 sec
13.295 sec
Figure 12. Signals compared.
Experiment 2: ECG and noise - Hardware Filter
Refer to the channels S1 and A5 in Labscribe for these analyses.
Compare peak values of the signal before and after filtering. Try to use the FFT analysis on the filtered signal.
IV. Wrap Up
When you are done with the lab, carefully remove all components and wires from the breadboard and return all to the case. Please be neat and careful!
10
BE 312 - Lab #8
V. Report Questions
1. Include screen captures/pictures of all channels recorded.
2. Provide a screen capture of the FFT the raw signal. What is the frequency of the noise? Does this match what the lab says it should be?
3. Provide a screen capture image of the filtered signal using the Notch Filter. Does this remove the noise?
4. Provide a screen capture image of the filtered signal using the FIR Filter. Does this remove the noise?
5. Which software filter was better? Why do you think this was the case?
6. (a) What is the TL062? (b) Provide a pin label diagram for the TL062. What pins did you use?
7. Assuming all electronic components in your hardware filter are "ideal," derive the H(jw) transfer function for the low pass filter. Use Matlab or Excel to create a Bode plot showing |H| in dB vs frequency. Frequency plot should start at 0.1 Hz and go up to 10,000 Hz (log scale, of course). Indicate the "cut-off frequency" on the plot.
8. Does the hardware filter remove the noise from the raw signal?
9. Can you apply the FFT analysis to the hardware filtered signal? If so, what does it show about the noise? Can you compare this to the software filtered noise?
10. Which of the three filters seemed to work best removing noise?
11
BE 312 - Lab #8
VI. Appendix A: Labscribe Setup information
Open the Preferences dialog, by choosing Edit->Preferences from the Main Menu.
. Channels Tab.
· Enable the Channels to be recorded and Label them. These channels will be used:
- A5 (Filtered ECG): This is the output of the Filter
- il 2 (Raw ECG): This is the ECG measured by the iWire-B3G
- S1 (Stimulator): This is what the Stimulator is outputing, which is same as the Raw ECG Channel. You do not have to enable this channel.
Preferences Dialog
X
Channel
Stimulator
Views
Sequences
Options
Events
Acquisition Mode
Start
Stop
Chart
V
User
Speed 1000 V Samples/Sec v
v
User
2
Display Time
12.184000
sec
Title
Mode/Function
Y Max
Y Min
Add Function
Units
Color
A
A1
Raw Ch 1
Off
5.000000
-5.000000
Add Function
Units
A2
Raw Ch 2
Off
5.000000
-5.000000
Add Function
Units
A3
Raw Ch 3
Off
5.000000
-5.000000
Add Function
Units
A4
Raw Ch 4
Off
5.000000
-5.000000
Add Function
Units
A5
Filtered ECG
DIN8
0.334837
-0.202036
Add Function
Units
A6
Raw Ch 6
Off
5.000000
-5.000000
Add Function
Units
DO2
DO2
Off
5.000000
-5.000000
Add Function
Units
A8
Raw Ch 8
Off
5.000000
-5.000000
Add Function
Units
EM1
EM1
Off
5.000000
-5.000000
Add Function
Units
EM2
EM2
Off
5.000000
-5.000000
Add Function
Units
i1 1
i1 1
Off
5844.3311
-1897.861
Add Function
Units
i1 2
Raw ECG
DC-10kHz 50mV
-0.962093
-2.382150
Add Function
Units
i13
i1 3
Off
1.944953
-1.486055
Add Function
Units
i1 4
i14
Off
0.380391
-0.202361
Add Function
Units
SpO2
Sp02
Off
5.000000
-5.000000
Add Function
Units
HR
HR
Off
5.000000
-5.000000
Add Function
Units
S1
Stim 1
Record
0.628298
-0.461561
Add Function
Units
S2
S2
Off
5.000000
-5.000000
Add Function Units
>
OK
Cancel
· Stimulator Tab
· Choose S1 stimulator
· Set the mode to Analog Channel
· Choose A12: Raw ECG as the analog channel to be send to the Stimulator output
12
BE 312 - Lab #8
Enable Start Stimulator with Recording.
Channel
Stimulator Views
Sequences
Options
Events
S1
v
Import Settings
Analog Channel
A12:Raw ECG
v
Analog Channel
> Start Stimulator with Recording
Time Resolution
0.05 msec
v
Toolbar Steps
Frequency
1
Amplitude (V)
0.1
Time
0.1
A
13