We're a little crazy, about science!

Day 12: Signal, cutting through the noise

example data

45 separate trials of very noisy data with the average of those trials (black). Believe it or not, this is actually very useful and very real data from something I am currently working on.

Noise, it can be troublesome. Whether you are studying and someone is being loud or you are trying to record something, noise is everywhere <stern look at people who talk during movies>. Interestingly enough the concept of noise in a signal recording sense isn’t all too different from dealing with talkative movie goers, so let’s talk noise!*

This is probably going to be a short, but important topic. Noise is anything we don’t want when we are looking at a signal. If we use our movie analogy the movie would be our signal of interest. This means the noise of the outside world and other movie watchers are our noise. Now, just like in the lab we can do things to mitigate the noise, but we cannot completely eliminate it.

Continuing with our movie analogy, the theater is designed to minimize outside noise. We have noise absorbing curtains hung on the walls and they even sometimes have other special noise absorbing materials built into the walls. We make sure it is nice and dark, ask others to silence their cellphones and ask that the audience remain quite while the movie is playing. Unfortunately, that doesn’t always work that way. There is people eating noisy foods or dealing with noisy packaging, there is always that one person who thinks they are the most important person watching the movie and can use their cell phone anyway. Okay, maybe this is more of a don’t be a jerk in the movies PSA, but it is a very good analogy for what we are talking about.

See noise is everywhere, we can’t escape it. We can shield from it, but it is insidious. The take home message here is that like life, it always finds a way. When we use MRI equipment we can record very tiny magnetic field changes, yay! Unfortunately the earth has a magnetic field, the sun is pumping out high energy particles, and because we are typically scanning living subjects, they are moving even when they try not to (despite your best efforts at remaining still, your heartbeat makes certain that nothing ever stays still, especially inside the body).

Just like the movie theater, we can shield from a lot of this interference and we do! However, other types of noise (like mentioned above) are there, but thanks to math we can work around this! That is because at the heart of this, noise is random! Last post we covered why we use the spectrogram and had this very handy graphic about averaging signals that aren’t time locked (occur exactly that same time after some stimulus).


Averaging signals can remove our base signal by smoothing it, however if our signal is aligned, averaging doesn’t have such an adverse effect on our signals strength.

Last time, we said that averaging signals that were not aligned caused a reduction in the amplitude. That was not what we wanted, but this same principle can be used to our benefit. Say the signal on the left is 110% pure grade noise, we aren’t interested in it, by having multiple recordings we can filter out that noise using averaging across the trials. Now this works well in my field for example because certain signals in the brain (say P300, which consistently occurs 300 ms after a stimulus) are very predictable across individuals and trials so if we align our trials to our stimulus averaging across our trials will have a minor impact on the amplitude response (in this case stimulus is whatever we want it to be, showing someone an image, tasing someone, whatever… okay not really we don’t tase anyone).

Going back to the movie analogy, this would be equivalent of seeing the same movie multiple times. You are almost guaranteed that even if there are noisy people, they wouldn’t be noisy at the same time every time you saw the movie. Ultimately, you would have been able to watch the entire movie without disturbance at each time point at least once, especially if you’ve seen the movie 50+ times, which depending on the experiment isn’t a whole lot of trials, sometimes we perform the same experiment thousands of times, but for a movie goer that is a very high level of commitment.

This is phenomenon is handy because I record biological signals using electrical recordings and we have to deal with lots of noise problems. Thankfully, a lot of competing signals are random enough that we can remove them by averaging across trials. The more trials we have, the more we can eliminate random noise from our actual signal. There is an exact formula to determine how much random noise is eliminated based on the number of trials and after 50-100 trials the benefit of more trials to the amount of noise it removes is diminished to the point where it isn’t typically feasible to do more trials. This isn’t to say that more cannot be done or should not be done, you should always get as many trials as you can, but it means that if you are constrained by time, subjects, or money, then 50-100 should be the target.

Now, you may be wondering what kind of noise do I deal with? There are quite a few different sources of noise and we can go into detail about some of time some other time. For now let’s look at one of those very pervasive examples of noise, specifically line noise (noise from the electrical wiring in the room). It is a very powerful and annoying problem, going back even further in our posts we can see a good example of line noise in our PSD of a heartbeat signal.

Day 2 - pwelch

Power spectrum of EKG signal, notice the huge 60 Hz line noise peak is significantly larger than the actual signal we recorded!

In my case recording people in electrically shielded rooms using a faraday cage is prohibitively expensive (plus I don’t typically carry a person sized faraday cage around with me). So instead we do several things to remove the line noise. Notice in this PSD the line noise is the dominant signal, by a substantial amount, dB is a logarithmic scale, which means our noise component is much, much larger than our EKG signal even at the lower and higher power frequencies. This is despite the fact that we recorded directly on the person’s skin and nowhere near an outlet. Like I said, it was a particularly annoying issue.

The bad news? Averaging doesn’t help with this, remember I said noise is random! Well this is only partly true, most noise is in fact random. HOWEVER, this isn’t the case for line noise, it is a very constant 60Hz (here in the US anyway). So in the case of line noise we have to filter it out using a filter (literally called a filter). We can go over that next time, but for now we’ve covered one way to remove noise and introduced the concept of noise that isn’t random, I think that is enough for one post.

Until next time, don’t stop learning!


*Let’s do this again, I make no claim to the accuracy of this information, some of it might be wrong. I’m learning, which is why I’m here writing all this. If you’re reading this then you are probably trying to learn too. If you see something that is not correct, or if you want to expand on something, please do it. Let’s learn together!!


But enough about us, what about you?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.