DSPRelated.com
Forums

software anti-aliasing filter.

Started by Unknown September 13, 2014
Hey guys,

I designed a system to acquire certain physiological signals and recorded these signals using a data acquisition card (agilent u2531a specifically). the problem is when designing the circuit i was unable to place an anti-aliasing filter before feeding the signal to the data acquisition device. The card does not have a software selectable filter at the input stage either. is there a way to implement this anti-aliasing filter in software (the signals are being processed offline)? all ideas welcome. Thanks very much.

zoul
On 9/13/2014 6:24 AM, zoulzubazz@googlemail.com wrote:
> Hey guys, > > I designed a system to acquire certain physiological signals and recorded these signals using a data acquisition card (agilent u2531a specifically). the problem is when designing the circuit i was unable to place an anti-aliasing filter before feeding the signal to the data acquisition device. The card does not have a software selectable filter at the input stage either. is there a way to implement this anti-aliasing filter in software (the signals are being processed offline)? all ideas welcome. Thanks very much.
The short answer is no, it is impossible to add a general anti-alias filter to digital samples after the analog to digital conversion has been done. The reason is that the purpose of the antialias filter is to limit the bandwidth of the incoming signal before the sampling process. The sampling process limits the bandwidth of the sampled data so that any frequency content outside of this bandwidth is aliased into the bandwidth. Once this has happened, there is no way to generally separate the aliased content from the intended content. If you have specific signals you wish to exclude and aliased content is not created at the exact same frequencies as the intended content, then you can add specific filters to remove those signals. Otherwise there is nothing you can do after the signal has been sampled. One other thought. You say the card does not have a "software selectable" filter, but does it have any filter? If it has an adequate filter for the maximum sample rate and you are currently running at a slower sample rate you can instead record your signals using the higher sample rate. Assuming the existing antialias filter works adequately at that sample rate you can then apply a digital filter to remove any interfering out of band signals and decimate down to the sample rate you want in the end. The filter and decimate can be combined into one operation making it more efficient. -- Rick
On Sat, 13 Sep 2014 06:38:19 -0400, rickman
<gnuarm@gmail.com> wrote:

>On 9/13/2014 6:24 AM, zoulzubazz@googlemail.com wrote: >> Hey guys, >> >> I designed a system to acquire certain physiological signals and recorded these signals using a data acquisition card (agilent u2531a specifically). the problem is when designing the circuit i was unable to place an anti-aliasing filter before feeding the signal to the data acquisition device. The card does not have a software selectable filter at the input stage either. is there a way to implement this anti-aliasing filter in software (the signals are being processed offline)? all ideas welcome. Thanks very much. > >The short answer is no, it is impossible to add a general anti-alias >filter to digital samples after the analog to digital conversion has >been done. > >The reason is that the purpose of the antialias filter is to limit the >bandwidth of the incoming signal before the sampling process. The >sampling process limits the bandwidth of the sampled data so that any >frequency content outside of this bandwidth is aliased into the >bandwidth. Once this has happened, there is no way to generally >separate the aliased content from the intended content. > >If you have specific signals you wish to exclude and aliased content is >not created at the exact same frequencies as the intended content, then >you can add specific filters to remove those signals. Otherwise there >is nothing you can do after the signal has been sampled. > >One other thought. You say the card does not have a "software >selectable" filter, but does it have any filter? If it has an adequate >filter for the maximum sample rate and you are currently running at a >slower sample rate you can instead record your signals using the higher >sample rate. Assuming the existing antialias filter works adequately at >that sample rate you can then apply a digital filter to remove any >interfering out of band signals and decimate down to the sample rate you >want in the end. The filter and decimate can be combined into one >operation making it more efficient. >
A quick Google search indicates that the card seems to be a general-purpose high-speed (2 MSmpl/sec) device, with no input filters (typical for such devices). However, since this is for "physiological signals", which have very low bandwidths, all the OP needs is a simple RC filter, if anything. However, most physiological signals are obtained using some kind of preamp, with its own gain and filters. EKG and EEG typically use differential amps with built-in filters. 300-3000 Hz is typical for EEG, for example, and EKG is even lower. So I suspect that the signal will come to the card with more than enough filtering already... nothing further will be needed for anti-aliasing. Best regards, Bob Masta DAQARTA v7.60 Data AcQuisition And Real-Time Analysis www.daqarta.com Scope, Spectrum, Spectrogram, Sound Level Meter Frequency Counter, Pitch Track, Pitch-to-MIDI FREE Signal Generator, DaqMusiq generator Science with your sound card!
rickman <gnuarm@gmail.com> wrote:
> On 9/13/2014 6:24 AM, zoulzubazz@googlemail.com wrote:
>> I designed a system to acquire certain physiological signals >> and recorded these signals using a data acquisition card >> (agilent u2531a specifically). the problem is when designing >> the circuit i was unable to place an anti-aliasing filter >> before feeding the signal to the data acquisition device.
> The short answer is no, it is impossible to add a general anti-alias > filter to digital samples after the analog to digital conversion has > been done.
(snip)
> One other thought. You say the card does not have a "software > selectable" filter, but does it have any filter?
There is always a filter. There is wire inductance, capacitance, and limited bandwidth of amplifiers along the way. At high sampling rates, that might be enough. At low rates, probably not.
> If it has an adequate > filter for the maximum sample rate and you are currently running at a > slower sample rate you can instead record your signals using the higher > sample rate. Assuming the existing antialias filter works adequately at > that sample rate you can then apply a digital filter to remove any > interfering out of band signals and decimate down to the sample rate you > want in the end. The filter and decimate can be combined into one > operation making it more efficient.
It is interesting that high-end digital cameras (DSLRs) have had a low-pass filter in front of the sensor for some years, but the newest, highest resolution ones, often don't. (Simpler cameras usually don't, as the optical system is its own low pass filter.) An optical (lens) system has a diffraction limited spatial frequency. Sensor are now good enough such that no additional filtering is needed. -- glen
On 9/13/14 7:39 AM, Bob Masta wrote:
> On Sat, 13 Sep 2014 06:38:19 -0400, rickman > <gnuarm@gmail.com> wrote: > >> On 9/13/2014 6:24 AM, zoulzubazz@googlemail.com wrote: >>> >>> I designed a system to acquire certain physiological signals and recorded these signals using a data acquisition card (agilent u2531a specifically). the problem is when designing the circuit i was unable to place an anti-aliasing filter before feeding the signal to the data acquisition device. The card does not have a software selectable filter at the input stage either. is there a way to implement this anti-aliasing filter in software (the signals are being processed offline)? all ideas welcome. Thanks very much. >> >> The short answer is no, it is impossible to add a general anti-alias >> filter to digital samples after the analog to digital conversion has >> been done. >> >> The reason is that the purpose of the antialias filter is to limit the >> bandwidth of the incoming signal before the sampling process.
...
> > A quick Google search indicates that the card seems to be a > general-purpose high-speed (2 MSmpl/sec) device, with no > input filters (typical for such devices). > > However, since this is for "physiological signals", which > have very low bandwidths, all the OP needs is a simple RC > filter, if anything.
... if the input is so grossly oversampled to begin with (depends on which physiological signals (ECG might be slower than brain or neural impulses), then the OP *might* want to hang a software low-pass filter on the input signal even after sampling. and he might want to downsample to something lower than 2 MHz, in which case that *would* be a "software anti-aliasing filter". -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
On Sat, 13 Sep 2014 03:24:22 -0700, zoulzubazz wrote:

> Hey guys, > > I designed a system to acquire certain physiological signals and > recorded these signals using a data acquisition card (agilent u2531a > specifically). the problem is when designing the circuit i was unable to > place an anti-aliasing filter before feeding the signal to the data > acquisition device. The card does not have a software selectable filter > at the input stage either. is there a way to implement this > anti-aliasing filter in software (the signals are being processed > offline)? all ideas welcome. Thanks very much.
Do this simple experiment: Take any 10-page document. Copy all of the pages of the document onto just one sheet, right on top of each other. Is there a way to reconstruct the original document? That's what you're trying to do by anti-aliasing after the fact. Once a signal component has been sampled, the information about its original position in the spectrum is GONE. You can only reconstruct if you know where the original position in the spectrum might have been -- which is what anti-alias filters do. But -- why do you think you need anti-aliasing? It can't be because you've analyzed the original signal and determined that it had spectral content that COULD alias, because, frankly, to ask the question you asked indicates that you can't do the math (or that you _really_ weren't thinking). There are times -- and measuring physiological signals is often one of those times -- where the information you remove from your signal by anti- aliasing filters causes greater degradation to the sampled signal than the erroneous information that is added by sampling. If you're sampling enough to catch the required features of the data, and if there's not an excess of broadband noise that's being aliased down into your result, then you may not need, or even want, anti-aliasing. I suggest you read this. It may help: http://wescottdesign.com/articles/Sampling/sampling.pdf -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
On Saturday, September 13, 2014 6:24:22 AM UTC-4, zoulz...@googlemail.com wrote:
> Hey guys, > > > > I designed a system to acquire certain physiological signals and recorded these signals using a data acquisition card (agilent u2531a specifically). the problem is when designing the circuit i was unable to place an anti-aliasing filter before feeding the signal to the data acquisition device. The card does not have a software selectable filter at the input stage either. is there a way to implement this anti-aliasing filter in software (the signals are being processed offline)? all ideas welcome. Thanks very much. > > > > zoul
Zoul, I think you are mistaken. The following document indicates that the Agilent u2531a does indeed have filtering which corresponds to a pretty high sample rate. http://cp.literature.agilent.com/litweb/pdf/5990-3505EN.pdf Whether it is programmable or not, it doesn't say. You could sample it for the bandwidth given (HUGE) and down sample it in software to get a signal without aliasing. What input sample rate are you using? Having said that, given the bandwidth you are probably concerned with, I think you have chosen the wrong device for the job, and one far more expensive than required (MSRP $2058). I would look around for a more useful, much cheaper solution. What is the sample rate that you ultimately want to use? What are your required DAC specs? Dirk
On Saturday, September 13, 2014 6:24:22 AM UTC-4, zoulz...@googlemail.com wrote:
> Hey guys, > > > > I designed a system to acquire certain physiological signals and recorded these signals using a data acquisition card (agilent u2531a specifically). the problem is when designing the circuit i was unable to place an anti-aliasing filter before feeding the signal to the data acquisition device. The card does not have a software selectable filter at the input stage either. is there a way to implement this anti-aliasing filter in software (the signals are being processed offline)? all ideas welcome. Thanks very much. > > > > zoul
Zoul, I think you are mistaken. The following document indicates that the Agilent u2531a does indeed have filtering which corresponds to a pretty high sample rate. http://cp.literature.agilent.com/litweb/pdf/5990-3505EN.pdf Whether it is programmable or not, it doesn't say. You could sample it for the bandwidth given (HUGE) and down sample it in software to get a signal without aliasing. What input sample rate are you using? Having said that, given the bandwidth you are probably concerned with, I think you have chosen the wrong device for the job, and one far more expensive than required (MSRP $2058). I would look around for a more useful, much cheaper solution. What is the sample rate that you ultimately want to use? What are your required ADC specs? Dirk
On Sat, 13 Sep 2014 03:24:22 -0700 (PDT), zoulzubazz@googlemail.com
wrote:

>Hey guys, > >I designed a system to acquire certain physiological signals and recorded t= >hese signals using a data acquisition card (agilent u2531a specifically). t= >he problem is when designing the circuit i was unable to place an anti-alia= >sing filter before feeding the signal to the data acquisition device. The c= >ard does not have a software selectable filter at the input stage either. i= >s there a way to implement this anti-aliasing filter in software (the signa= >ls are being processed offline)? all ideas welcome. Thanks very much. > >zoul
Aliasing will be a problem if there was signal energy (or interference energy, or ANY energy) at frequencies above half the sample rate. Once aliasing happens, you can't undo it in the parts of the signal that have been corrupted by it. So the first thing to do if figure out if your system generates or picks up any energy above half the sample rate. If not, which is entirely possible for a low-bandwidth sensor or a constrained system, then you're in luck, but you're not in luck until you really confirm this. If you confirm that there IS energy above half the sample rate, characterise it because all hope may not be lost. If there is aliasing, you may, in fact, be able to fix the aliasing in software aftersampling under certain conditions. If the desired signal is bandlimited to much less than half the sample rate and the aliased energy folded into the supported spectrum outside of the desired spectrum, then you can remove it with a digital low-pass filter that only passes the desired spectrum. So it is potentially possible to run a software anti-aliasing filter, but only if your signal was significantly oversampled and the aliased energy (if any) was outside of the desired signal spectrum. Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
On Sat, 13 Sep 2014 11:57:26 -0500, Tim Wescott
<seemywebsite@myfooter.really> wrote:

>On Sat, 13 Sep 2014 03:24:22 -0700, zoulzubazz wrote: > >> Hey guys, >> >> I designed a system to acquire certain physiological signals and >> recorded these signals using a data acquisition card (agilent u2531a >> specifically). the problem is when designing the circuit i was unable to >> place an anti-aliasing filter before feeding the signal to the data >> acquisition device. The card does not have a software selectable filter >> at the input stage either. is there a way to implement this >> anti-aliasing filter in software (the signals are being processed >> offline)? all ideas welcome. Thanks very much. > >Do this simple experiment: > >Take any 10-page document. Copy all of the pages of the document onto >just one sheet, right on top of each other. > >Is there a way to reconstruct the original document? > >That's what you're trying to do by anti-aliasing after the fact.
[Snipped by Lyons] Hi Tim, That "paper copy example" is one terrific analogy to what happens with aliasing. GOOD JOB! [-Rick-]