What's the noise in this signal ? (Beginner question)

There is this raw ECG signal that I have obtained its frequency content in Matlab. The signal was sampled at 600Hz. The following is signal and the frequency content. I want to know what the interferences are. I'm very new to DSP, and I feel like I'm lacking some common sense to understand a signal by looking at it.

It looks like to me the isolated peaks are the noise. How can I tell which one the noise is?

• It looks like mains pickup, checking earth connections, i.e poor earth or earth loops could be the reason for this. – porphyrin Apr 20 at 11:24
• I agree with the answers/solutions but be aware that neonatal heart rate is high; say 190 beats per second. And if you are diagnosing the features, they are quite (certainly) at higher rates. In addition, high frequency ventilation can be high; rates of 6.7–40 Hz. These frequencies would "modulate" external heart sensing. ncbi.nlm.nih.gov/pmc/articles/PMC5464224 – rrogers Apr 20 at 19:13

From the spectrogram (frequency domain plot) you have a large signal at 60 Hz and harmonics. This will be mains pickup if this was recorded in a area with a 60 Hz mains supply. On the upper time plot this signal has a peak to peak amplitude of about 0.5 units. (Note that there are 30 cycles over 500 ms.)

It looks like to me the isolated peaks are the noise.

As JRE and MBaz suggest, it helps to know what your wanted signal looks like. The Wikipedia article on ECG gives an idealized view of a ECG trace (as well as some actual plots). You should be able to see that the isolated peaks are actually part of your wanted signal. Your patient seems to have a pulse rate of about 75 bpm.

All your wanted signal seems to be below 25 Hz. To get rid of the mains interference one way would be to low pass filter the signal or use a comb notch filter to remove 60 Hz and its harmonics. A notch filter may have less effect on your wanted signal but whatever filter is used you need to consider how its amplitude and phase response will affect your wanted signal.

An alternative approach is subtraction. You generate a local copy of the interfering signal and subtract it from the raw input leaving behind the wanted ECG. As this isn't based on a filter there are no unwanted amplitude or phase effects on the signal.

Your difficulty does not arise out of a lack of common sense (if any); rather, the reason is that the problem is not well specified. To be able to tell signal from noise, you need to know something about the signal first.

For example, it is impossible to reduce noise in an AM transmission. The audio may sound noisy, but what if the transmitted signal was intended to sound noisy? It's impossible to say!

So, your first step is to learn something about the ECG signal that allows you identify parts of the signal that shouldn't be there, and call them "noise". For example, if you were able to say that a pure ECG signal never has frequency content above 50 Hz, then you could be confident in calling the sinusoids above that frequency "noise".

• Correct. The theoretical idea behind "noise" is that the input you get is a combination of two parts, input=function(signal,noise) or just input=signal+noise. Both contributions are unknown, and you can only estimate them if you have a statistical model of both. – MSalters Apr 15 at 8:05
• @MSalters I don't think you need a statistical model of signal in this case – not when the noise is a pure 60 Hz oscillation. – leftaroundabout Apr 15 at 11:48
• @leftaroundabout: In that case you still have to assume that your signal is sufficiently described by the non-60 Hz parts of the spectrum. But that's indeed an easy first exercise for a DSP course; the math is straightforward. – MSalters Apr 15 at 12:37

You distinguish between noise and signal by understanding your signal - you should have some idea what it will look like.

Alternatively, some "noise" sources are well known so that you know what they look like and can exclude them from the things that might be a signal.

In your case, you have a signal with some known characteristics meeting up with an interference source with known characteristics.

Start with the ECG signal. It has known characterstics. The signal is from an electrocardiogram. It represents heart beats.

What do you know about heart beats?

The most obvious thing is that they are relatively slow. They occur a little more than once per second. Once per second is a frequency of 1 Hz.

Look at your ECG signal plot. You say the sampling rate is 600 samples per second. What part of your signal repeats approximately once per second (every 600 data points or so?) The big spikes. Those are your heart beats.

You had eliminated the big spikes because you thought they were noise and that the constant waves were the signal.

Take a look at the constant wave. It repeats dozens of times in a second. It that were your heart beat, it would sound like a constant hum. You'd have a pulse of over 360 beats per minute.

Your FFT tells you more about the interference. There is a vertical line at 60 Hz. That's the frequency of the AC power as used in the United States - that's what comes out of the power outlets in your home.

You can eliminate the 60Hz as your signal. It is way too fast for a heart beat, and is a common source of interference. In Europe or other parts of the world, 50Hz is more common because they use a 50Hz power line network.

You can also eliminate the 120 Hz and 180 Hz components of the FFT. They are even faster, and they are related to the 60Hz power line frequency.

Given that this is an ECG signal, you can also compare your signal to a picture of someone else's ECG.

There's an image here that shows what an ECG signal looks like.

Here's the image:

• A = ECG with noise and 60Hz interference
• B = ECG with noise
• C = Clean ECG

A looks a lot like your ECG signal. If you clean it up, you get something like C.

You can tell the signal from the noise by either knowing what your signal looks like and picking out that shape, or by knowing what the inteference looks like and ignoring that shape. Either way, you have to know something about your signals to separate them.

As 60 or 50 Hz is pervasive (almost) everywhere, it is difficult to avoid completely. Filtering is frequently the first suggestion, but it is also important to ask if there is no way to avoid or reduce the capturing at the input, and not blindly apply filters.

If the interference is large enough, the following stages (amplifiers and A/D converters) may saturate, and lose the signal entirely. Though I teach DSP, I like to emphasize that we shouldn't forget signal conditioning.

Using an isolated amplifier at the input, and a reference electrode, go a long way to clean up the signal. Hewlett Packard used to publish a Journal describing their equipment, and have a couple of nice articles on the problems with ECG. Even though ancient by now, the issues haven't changed that much, and articles do a very nice job in describing them:

HP Journal, 1981, October issue, pages 16...: New Plotting Technology Leads to a New Kind of Electrocardiograph. https://www.hpl.hp.com/hpjournal/pdfs/IssuePDFs/1981-10.pdf

HP Journal, 1991, October issue, pages 21...: Measuring the ECG Signal with a Mixed Analog-Digital Application-Specific IC https://www.hpl.hp.com/hpjournal/pdfs/IssuePDFs/1991-10.pdf

So it seems like your actual ECG peaks (QRS complex) have the highest amplitude. That probably makes it the spike that's tallest in your frequency response graph. Also it's the lowest frequency oscillation out of the 3 main oscillations in your ECG, which confirms it.

The low frequency stuff is probably unnoticeable on the actual ECG.

The P and T peaks are probably the frequency that's double the QRS peaks (one P and one T for each QRS).

The fastest oscillation seems to be much faster than 3 times the heartrate here, so it seems that it's not represented in your frequency response graph (it would be way off to the right side). Is this an FFT?

• The ECG spikes have the highest visible peaks in the upper chart, but the spikes in the FFT in the lower chart are at 60Hz and harmonics (60, 120, 180.) The low frequency stuff (below 60Hz) is the ECG. The ECG spikes (QRS) contain mostly low frequency components and only repeat periodically. Since they aren't present all the time they average to a lower intensity in the FFT chart. The 60 Hz signal is lower intensisty in the upper chart, but it is present all the time and thus has a higher average in the FFT. – JRE Apr 15 at 7:56

The isolated peaks in the spectrum at 60Hz and higher are mains interference - 60Hz and its harmonics. Calling it "noise" is usual although IMHO undesirable, since in DSP terms noise is random, whereas interference implies narrowband signals - exactly what you're seeing.

Careful design of the input stage and lead screening may lower the amplitude of this interference. Otherwise, the simplest thing to do is to low-pass filter the signal with a sharp roll-off filter. E.g. take the FFT, zero-out all coefficients past 45Hz or thereabouts, then take inverse FFT of that.

Looks to me like 60Hz noise from mains somewhere in your setup. To fix this in the past, I've made sure that the table I'm working on is either grounded, non-conductive or both. I've even gone as far as to put my setup on a cardboard box in the middle of the room to eliminate pesky 60Hz ambient noise.

Preliminary notes:

• The ECG signal under scope is available as a text file here: ecgbn.txt
• The interferences may consist in: the steady oscillations (at 60 Hz and harmonics) plus a baseline, visible on the slow oscillations of the upper envelope.

The notions of signal and noise are a bit subjective. Think about music: concrete contemporary music (for instance HyperSounds :: Contemporary Sounds) or very heavy death metal (OBITUARY - Sentence Day) may sound noise for one, but music to the other.

Behind this observation lie different types of attitudes: being used to, finding interest in, getting annoyed be, deeming dull... And the attitude may differ between the person primarily interested in the data (the specialist: the geologist, the chemist, the physicist, the physician) and the person who processes the data (signal processing folk, data scientist). I have experienced hard time in geophysics: I was trying to enhance noisy data, and only seeing noise. After a couple of weeks, I admitted my failure to a geophysicist, who said: no, that's interesting, there is a reflection there. It took me time to understands what he meant and saw, but finally helped me improve my algorithms. Signal for one eye can seem noise to the other. This observation also apply to the domain you are using: here, you look into the time and the frequency domains (two different eyes). This is the reason why we generally look at data in different domains, to help us uncover what kind of we can get.

In insight dwells the core of what we can expect from "signal" or "noise". So let us have a look at origins: the term signal hints at:

visible sign, indication," from Old French signal, seignal "seal, imprint, sign, mark

The term noise has complicated origins, between:

"sound of a musical instrument" and "din, disturbance, uproar, brawl"

Assigning a part of data to signal or noise thus requires some clear purpose, which does not mean that the question is fully settled. I therefore prefer to identify a three-part

• what is very informative,
• what is very uninformative,
• what lies in-between, and requires some care and additional processing, modeling, inference.

Going back to your case, the Fourier domain shows that the spectrum bottom, that may represent random noise, is quite flat and low. The steady oscillating pattern in the time signal are so repetitive that one may suspect that they are non very informative for a medical purpose. By filtering the time signal, or selecting parts of the spectrum, you may be able to detect that the isolated Fourier peaks are indeed related to that oscillation. As said elsewhere, a 60 Hz (plus harmonic) is unlikely to be physical, and can indeed be related to power lines. So here, they are likely to belong to inferences. Finally, the top (or upper envelope of the signal displays a little wiggling, that is quite low in the frequency range, and could belong to interference as well. It can be termed baseline wander, drift, background. The paper below may indeed consider both baseline wander and powerline artifact as interferences:

Methods of noise reduction have decisive influence on performance of all electrocardiographic (ECG) signal processing systems. This work deals with problems of baseline wander and powerline interference reduction. It is impossible to reduce effectively these disturbances without signal distortion using a linear filtering approach. Another disadvantage of the linear filters is their long impulse response. This leads to inadmissibly large delay in ECG signal analysis in monitoring and exercise electrocardiography. This work presents a new class of nonlinear filters without these disadvantages. Additionally, using a bank of these filters, powerline interference reduction is possible. Performance of the new method is experimentally compared with the traditional methods of baseline wander reduction using synthetic as well as the signals from the CTS-ECG database.