You are on page 1of 11

Alternate Assessment Tool (AAT) Report

Submitted in partial requirement of 5th Semester

DIGITAL SYSTEM USING VERILOG - 19ML5PE2DV


of

BACHELOR OF ENGINEERING
In
MEDICAL ELECTRONICS ENGINEERING

VISVESVARAYA TECHNOLOGICAL UNIVERSITY, BELGAUM

TOPIC: FILTER HIGH FREQUENCY NOISE FROM ECG USING


THIRD ORDER BUTTERWORTH FILTER
SUBMITTED BY:

STUDENT NAME USN

CHINMAYA R BHAT 1BM20MD009

CIMON ACCAMMA 1BM20MD010

SAKSHI MARODIA 1BM20MD043

Under the guidance of


Dr. M.S. Suma,
Associate Professor,
Department of Medical Electronics Engineering, BMSCE

Department of Medical Electronics Engineering


(Accredited by NBA, under Tier 1, 2014-2019)

B. M. S. COLLEGE OF ENGINEERING
(Autonomous Institution Affiliated to Visvesvaraya Technological University, Belgaum)

Bull Temple Road, Basavanagudi, Bangalore-560019


January 2023
TABLE OF CONTENTS

S. No. Topic Page no

1. INTRODUCTION 3

2. CODE 4

3. FLOWCHART 6

4. SIMULATION RESULT 7

5. CONCLUSION 8

6. LITERATURE SURVEY 9

7. ACKNOWLEDGEMENT 10

8. REFERENCES 11

2
INTRODUCTION

Electrocardiogram (ECG) signals are a crucial tool for monitoring the electrical activity of
the heart. They are widely used in the medical field for diagnosing heart conditions and
monitoring the effects of treatment. However, the recorded ECG signals are often
contaminated by high frequency noise, which can interfere with accurate analysis and
diagnosis. To address this issue, one common approach is to use a digital filter to remove the
high frequency noise.

A Butterworth filter is a type of low-pass filter that is commonly used for ECG signal
filtering. The Butterworth filter is characterised by its flat frequency response in the passband
and a roll-off rate that is proportional to the square of the frequency. This makes it an ideal
filter for removing high frequency noise from ECG signals while preserving the important
features of the ECG signal, such as the QRS complex and the T-wave.

In this AAT, we have described the implementation of a third-order Butterworth filter in


Verilog for filtering high frequency noise from ECG signals. Verilog is a hardware
description language (HDL) used for digital design and implementation of digital circuits. It
was developed in the 1980s and has since become an industry-standard for designing
complex digital systems, such as microprocessors, digital signal processors, and
field-programmable gate arrays (FPGAs).

The Butterworth filter transfer function can be expressed as follows:

H(s) = 1 / (1 + (s / s_c)^(2n))

where s is the Laplace variable, s_c is the cutoff frequency, and n is the order of the filter. In
this case, we will use a third-order Butterworth filter, so n = 3.

The transfer function can be implemented in Verilog using a combination of mathematical


operations, conditional statements, and hardware primitives.

The simulation of this code has been implemented in ModelSim. ModelSim is a simulation
and debugging tool for digital designs described in hardware description languages (HDLs),
such as Verilog and VHDL. It is widely used in the semiconductor industry for verification
and validation of digital designs, as well as in academia for teaching digital design and digital
logic.

3
CODE

module Butterworth_filter(
input wire clk,
input wire reset,
input wire[15:0] sample,
output wire[15:0] filtered_sample
);

reg[15:0] x[2:0]; // Store the previous 3 samples


reg[31:0] y[2:0]; // Store the previous 3 filtered samples

// Butterworth filter coefficients


parameter N = 3;
parameter b0 = 0.3330;
parameter b1 = 0.6661;
parameter b2 = 0.3330;
parameter a1 = -1.2412;
parameter a2 = 0.4159;

always @(posedge clk or posedge reset) begin


if (reset) begin
x[0] <= 16'h0000;
x[1] <= 16'h0000;
x[2] <= 16'h0000;
y[0] <= 32'h00000000;
y[1] <= 32'h00000000;
y[2] <= 32'h00000000;
end else begin
x[0] <= x[1];
x[1] <= x[2];
x[2] <= sample;
y[0] <= y[1];
y[1] <= y[2];
y[2] <= (b0 * x[2] + b1 * x[1] + b2 * x[0] - a1 * y[1] - a2 * y[0]) << N;
end
end

assign filtered_sample = y[2][15:0];


endmodule

4
TESTBENCH

module Butterworth_filter_tb();

reg clk;
reg reset;
reg[15:0] sample;
wire[15:0] filtered_sample;

Butterworth_filter dut (
.clk(clk),
.reset(reset),
.sample(sample),
.filtered_sample(filtered_sample)
);

initial begin
clk = 0;
reset = 1;
#10 reset = 0;
#100 sample = 16'h1000;
#100 sample = 16'h2000;
#100 sample = 16'h3000;
#100 sample = 16'h4000;
#100 $finish;
end

always #5 clk = ~clk;

endmodule

5
FLOWCHART

6
SIMULATION RESULT

7
CONCLUSION

From the result, it shows that the unwanted signal in the raw ECG signal is attenuated
through the designed filter. By sharing the delay elements between input coefficients and
feedback coefficients through optimization with Direct Form II structure, the resource
utilization is improved. It is possible to enhance and analyse the performance of the designed
filter by implementing it in Application Specific Integrated Circuit (ASIC).

8
LITERATURE SURVEY

S.NO. PAPER DETAILS INFERENCE


1. Title: Noise Removal from ECG The main objective of this paper is to
Signal Based on Filtering Techniques compare the resource utilization of
hardware realization consumed between
Author: Almalchy, Mohammed & Direct Form I structure and Direct Form II
Ciobanu, Vlad & Popescu, Nirvana structure. The designed filter is verified
using Matlab Filter Design Analysis tool
and realized in hardware using Verilog.
Both the results show that the unwanted
signals in the raw ECG signal are
attenuated through the designed filter

2. Title: Cancellation of high-frequency ECG recordings are often contaminated by


noise in ECG signals using adaptive high-frequency noises, such as power-line
filter without external reference interference, electromyography (EMG)
noise, and instrumentation noise. The use
Author: C. -H. Chang, H. -J. Ko and of adaptive filters in cancelling the noise
K. -M. Chang requires an external reference to estimate
the noise and, in turn, subtracting it from
the noisy ECG.

3. Title: Survey on Filtering Techniques The physiological signals are measured


Applied to ECG Signal. through noninvasive means unless very
critical and hence are very weak in nature.
Author: KJ, Shanthi Bio-amplifiers are applied during signal
acquisition. The signals are weak and
hence susceptible for the electrical
disturbances in the environment. Selection
of Filtering techniques is very important
and is decided by many factors.

4. Title: Noise Removal from ECG The Electrocardiogram (EKG or ECG)


Signal Based on Filtering Techniques is a semi-cyclic, rhythmically, and
synchronous signal with a
Author: Almalchy, Mohammed & cardiac function through the passive
Ciobanu, Vlad & Popescu, Nirvana sensory apparatus in which the apparatus
is performing as a generator of bioelectric
signal mimicking the function of the
heart.

9
ACKNOWLEDGEMENT

We would like to acknowledge Dr. M.S. Suma for her vital cooperation and help in ensuring
the successful completion of our assignment.

We would also like to thank the Department of Medical Electronics Engineering for
providing us with the wonderful opportunity to work on this assignment.

10
REFERENCES

[1]C. -H. Chang, H. -J. Ko and K. -M. Chang, "Cancellation of high-frequency noise in ECG
signals using adaptive filter without external reference," 2010 3rd International Conference
on Biomedical Engineering and Informatics, Yantai, China, 2010, pp. 787-790, doi:
10.1109/BMEI.2010.5639953.

[2] kj, Shanthi. (2020). Survey on Filtering Techniques Applied to ECG Signal. International
Journal of Innovative Technology and Exploring Engineering. 9.
10.35940/ijitee.G1003.0597S20.

[3]Almalchy, Mohammed & Ciobanu, Vlad & Popescu, Nirvana. (2019). Noise Removal
from ECG Signal Based on Filtering Techniques. 176-181. 10.1109/CSCS.2019.00037.

11

You might also like