Using a comb filter to reduce noise/amplitude?

My goal is to reduce the signal's noise and amplitude using comb,fir, or iir filters. I'm not sure where to start as it is not one particular frequency.

Answers (1)

You seem to be filtering an EEG, so there must be a band of specific frequencies you’re interested in. I would use a bandpass filter to include those frequencies and exclude those you’re not interested in.
There are several possibilities, of which the Butterworth design might be the best for most biomedical signals. Decide the frequencies you want to study (perhaps 0.5 to 15 Hz), design your filter with buttord, butter, then tf2sos or zp2sos (the second-order-section representation being more stable), then filtfilt to filter your signal. (The low frequency cutoff of 0.5 Hz removes baseline drift and DC offset.)
I always use freqz to assess the characteristics of a filter before actually using it, to be certain it has the characteristics I want it to have.

6 Comments

Can you expand more on that? I'm not sure how to use any of those functions.
I’ll be glad to. They’re all in the Signal Processing Toolbox, so I assume you have it. The first, buttord, calculates the optimum order of the filter you will need given your filter parameters. The butter function then calculates the transfer function (tf) or zero-pole-gain (zp, zpg) representations. To assure maximal stability, convert these into second-order-sections (sos) representation. Then check the design with the freqz function that will give you a graphical representation of your actual filter design. When you are happy with that, use the phase-neutral filter filtfilt to do the actual filtering. There are ‘shell’ routines that automate this process, but I always prefer to be able to tweak my filters using the lower-level functions because I have more control over the process.
The most important point is to remember to express the filter frequencies scaled from zero (DC) to the Nyquist Frequency, ½ of your sampling frequency: Fn = Fs/2. All your frequencies of interest will be in that region, so it is simply a matter of defining them that way (dividing them by Fn) to the filter functions.
So if you collect your EEG at a 1KHz sampling frequency (Fs=1KHz), Fn=500 Hz, and your passband of [0.5 15] Hz become normalised by Fn to become [0.001 0.030]. Decide whether these are going to be your passband frequencies (preferable) or stopband frequencies (that would then be below and above the passband frequencies by a fixed amount, perhaps 0.2 Hz on the low end and 20 Hz on the high end. Experiment to get the best signal from the filter. If you have other frequencies to consider, change the passbands and stopbands accordingly. You supply these data to buttord, that then calculates the order and passband for your filter that you give to butter to actually calculate the transfer function (or zpg) representation. You then convert either of these to second-order-section representation, test it with freqz to be certain the design meets your needs, and then use it and filtfilt to filter your EEG signals.
I’ll be glad to walk you through it, just not tonight. If you want to upload a representative sample of your data and tell me what you want to do, I might be able to design your filters, test them on the data, and post the requisite code for you to use. Some filters are straightforward to design, others require some effort to finally realise.
This is the signal I'm supposed to filter.
It’s a (1x500) vector. I need to know the sampling interval (Ts) or sampling frequency (Fs). (I usually get these from the time vector, but there isn’t one here.)
That was the hard part, I wasn't given that information.
The problem is that the waveform itself is meaningless without the time vector, even if it’s from a subject without any known pathology. (There are normal ranges, but no normal constants.) When I do an FFT, I can’t find anything like a 50-60 Hz peak that I might normally use to figure out the frequency. I searched PubMed and could find no common sampling frequency for EEG. They ranged from 1-5 KHz. I have no idea what yours could be.
It’s not possible to design a correct filter without knowing the sampling frequency, especially with a signal that appears to have broadband noise. It might be possible to de-noise it somewhat with wavelets, but without the sampling time vector it would still be clinically meaningless.

Sign in to comment.

Categories

Asked:

on 26 Sep 2014

Commented:

on 27 Sep 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!