Category Archives: Biomedical Signal Processing

Digital Notch Filter for 60Hz Power Line noise elimination

Relevant Notes:

The following hardware limitation has been observed while testing the OMAP-L138 LCDK frequency response: lower frequencies (1-5 Hz) input amplitudes were significantly attenuated at the output, while the amplitudes of the higher frequencies (>5 Hz) had a gain of 0 dB.

Since the ECG frequency range is approximately 1-20 Hz, in order to get an undistorted signal it was needed to modify the characteristics of the Digital Filter so that the amplitudes of the low frequencies inputs would be increased, but the amplitudes of the higher frequencies (>5Hz)  inputs would remain unchanged.

To bypass the hardware limitation, described above, a constant 40 dB gain was added to the Filter Transfer Function to increase the amplitudes of the low frequency inputs;  the Q factor value of the filter was decreased so that the amplitudes attenuation would being at frequencies of 5 Hz and above. This would cancel the 40 dB gain at higher frequencies.

As a result, a well-working Digital Filter C code has been created. The following Figures represent  recorded ECG samples, obtained after having been processed by means of the Digital Notch Filter.

(Real time ECG – normal breathing. Click on the Figure to see a larger image)



(Accelerated ECG at the exhale. Click on the Figure to see a larger image)



The following file contains a sample Digital Notch filter C code, needed to eliminate the 60Hz Power Line interference from the acquired ECG signal. The code has been created as a part of a CCS project that was launched to an OMAP-L138 LCDK . 

Enjoy =)

Digital Notch Filter

First Real Time ECG Sample Acquired into MATlab workspace

Today I was able to acquire a number of my own real time ECG  samples,  filter the   60 Hz power line noise out of the signals by means of the digital Notch Filter C code, launched to OMAP-L138 LCDK, and record the result into MATlab work space using  MATlab DAQ Toolbox.

(Please, click on the picture below to see the enlarged image)



Being able to record real time ECG signals into MATlab allows us to further process data using MATlab programming tools.  Thus, at this point it has been decided to replace the WinDSK8 software, initially used in the project, with MATlab. The Tutorial about “how to get started with WInDSK8” will still be placed on this website.

Getting started with ADS1298ECG-FE PDK

ADS1298ECG Front-End PDK is a set of two TI boards (MMB0 and ADS1298ECG FE), designed for evaluation of real time ECG signals. The kit is compatible with CCS and can be programmed, using C/C++. However, the board comes already factory preprogrammed for basic applications and has a 60Hz eliminating component. Therefore ADS1298ECG Front-End PDK can be used as a great demonstration of Biomedical signal acquisition, A/D conversion, and filtering for students. The board is supplied with its own software, needed to display the acquired data. The latest version of the software is freely available on the TI website. This tutorial will walk you through each step, needed to acquire your own ECG signal with ADS1298ECG-FE PDK.

  1. Downoload the ADS1x98/8RECG-FE evaluation tool software from the TI website, using the link provided below:

NOTE: Make sure to install the software before connecting the ADS1298ECG-FE PDK to the PC. Otherwise the board may not be recognized by the system.

        2.   Connect the board J1 output to a PC USB input (the connection cable comes with the kit) . Then power the ADS1298 board, using the Power adaptor, included in the kit. The Figure below shows the correct connections.

adsfe                                                                                                             3. Launch the ADS1x98/8RECG-FE evaluation software. Make sure it recognizes the board and finds the firmware (the process may take a few minutes). Once the communication between the ADS1298 board and evaluation tool software has been established, you will see a “ready” message in the top right corner of the window.

         4. To test the communication between the ADS1298 board and the evaluation tool software, click on the “ADC register” button. The Settings configuration, needed for testing, is shown in the following Figure (please, make sure you change the signal types for all channels by right-clicking on the “Channel input” and choosing the “Test signal” from the menu).

test signal                                                                                                             5.  Click on the “ACQUIRE”  button on top of the window. Then Click on the “Analysis” button, located next to the “ADC register” button in the top left corner of the window.

6.   You should see the following square wave signal:

square                                                                                                             7.   Now that the communication has been established and tested, you are ready to acquire your own real time ECG signal. The D15 input is used for electrode connections. However, it is important that you use a ribbon cabble instead of inserting the wires directly into the on-board D15 pins.

8.  The D15 pins are connected to the jumpers, “responsible” for ECG leads. ADS1298ECG-FE PDK allows to use up to 12 leads, but for simplicity, we’ll stick to a 3 leads ECG acquisition (LL, RA, LA).  The pins configuration is represented in Figure below:


Connect the 3 electrodes to your Right wrist, Left Wrist and Left leg and insert the oposite sides of the wires into the corresponding pins of the D15 ribbon cable.

9.    Click on the “ADC regulator” in the evaluation tool window. Then change the Channel inputs to the “Normal Elecrode” as it is shown in the following Figure.

normal electrodes                                                                                                            10.   Click on the “Analysis” button and then Click on “Acquire” and on “Continuous”. Now you should see your ECG signal being recorded continuously on the screen:



Digital Notch filter

Now we have a working digital Notch filter, needed to eliminate the 60Hz Power line interference from an ECG signal. The filter was implemented by  writing a C/C++ code and inserting it into a Code Composer Studio Project. As it has already been mentioned, Code Composer Studio is compatible with TI OMAP-L138 LCDK, so we were able  to load the code to the board and run it. The video, linked below, shows that the filter attenuates the amplitude of the 60Hz input signal while keeping the amplitudes of  other frequencies inputs unchanged.

Digital notch filter demonstration

The Code for the Notch filter will be posted under the “Code examples”  tab on this website.  =)

Some progress regarding Experiment 3.

Using the analog amplifier circuit, built for Experiment 2, we have been able to record an ECG signal on a digital oscilloscope screen.


After having connected the analog amplifier’s output (pin 6 of the U4 op-amp) to the analog Line  In  input of the OMAP-L138 LCDK board, we were able to obtain a  digital    signal of approximately 1 Hz frequency with clearly distinguishable QRS peaks on a PC screen, using the Oscope/Analizer function of the winDSK8 software. The signal, however, was distorted by  a  60Hz noise, which is to be removed by means of a digital Notch filter.  The results  for  filtered ECG signal, as well as the   lab guide for Experiment 3 will be posted soon.