DSPRelated.com
Forums

Anti-aliasing advice for de-interleaved signals

Started by PhilipOrr July 21, 2010
On 7/22/2010 5:32 AM, PhilipOrr wrote:
> Many thanks for the fast responses. > > I would like to take a truly simultaneous differential measurement, however > I can't with this system. The analogue signal is already being switched > between the two inputs, and my sampling is simply synchronised with the > switch rate so that I detect an interleaved version of the two signals.
I can imagine two things that that might mean.
> I also agree that I would ideally need to AA filter before I sample, > however I can't do this because the filter would remove the switching > signal (fswitch = fs).
How would filtering the signal affect the control? I can see two ways that you could implement this (not very useful) scheme. You could use a controlled inverter (Hard to build!) that inverts alternate samples, or you could pass the signal through an inverter, then select the original and inverted signals alternately for sampling. (Transient management is much easier the second way.) ...
> By subtracting the two signals I expected to see this reduced noise. > However I don't. Clearly my view of the situation is lacking! Why do I not > get reduced noise by this subtraction? In fact, the noise seems a bit > worse, not better. ...
Inverting the signal also inverts any noise. Ignoring the time offset, subtracting one channel from the other restores both the original signal and the original noise. All the useless processing may add noise of its own. Your signal is analog. The system noise is analog. There is probably a good analog way to keep them separate, but there is probably no way, analog or digital, to separate them after you allow them to mix. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
On 07/22/2010 02:32 AM, PhilipOrr wrote:
> Many thanks for the fast responses. > > I would like to take a truly simultaneous differential measurement, however > I can't with this system. The analogue signal is already being switched > between the two inputs, and my sampling is simply synchronised with the > switch rate so that I detect an interleaved version of the two signals. > > I also agree that I would ideally need to AA filter before I sample,
If you need to anti-alias filter _at all_ you'd need to do it before you _switch_.
> however I can't do this because the filter would remove the switching > signal (fswitch = fs). (Perhaps oversampling so that I could AA filter > without removing the differential at fswitch, and then averaging/decimating > down after ADC could solve this.) > > Currently, after de-interleaving I have the two 500 Hz signals. I subtract > these from each other to get a differential signal. This is because they > contain information on the same measurement but with equal and opposite > polarity - however the noise should be identical in both (I thought).
That depends on the nature of the noise. If it is slow compared to 500Hz, and if it arises after the polarity switch, then it'll get pounded down. If, on the other hand, the noise is fast or if the bias is there before the switch (or contributed _by_ the switch) then it won't. Analog switches are wonderful things, but you cannot just toss them into a circuit willy-nilly and expect good results.
> Therefore when I subtract I get double the signal power and suppress the > common noise. Is this reasoning correct or overly simplistic / wrong?
Per the constraints I mention above, you'll double the signal _amplitude_ and suppress the common-mode noise. If the noise is uncorrelated between the + and - samples then your SNR will go up by 3dB. If the noise is all post-switching bias then your SNR will go up immensely. If the noise is pre-switching bias or induced in the switches itself, it won't get diminished by much, if at all.
> By subtracting the two signals I expected to see this reduced noise. > However I don't. Clearly my view of the situation is lacking! Why do I not > get reduced noise by this subtraction? In fact, the noise seems a bit > worse, not better. Do I need to AA filter the 500 Hz signals before > subtraction??
You've never justified needing anti-aliasing filters at all. I think your problem here isn't aliasing; I think the problem is that your analog circuitry isn't working the way you expect, so your overall scheme isn't working well either. I've done AC-coupled DAC conversions very similar to this, but running in the other direction. The first time we did it the system worked outstandingly, exceeding all expectations (including the performance of the sensor manufacturer's "we know how to make our sensor happy" interface board). The second time we did it we got rushed and complacent, and didn't control the offset at every single point after the switching. This lack showed as a significant sensor bias, and we had to rework a circuit board after shipping a number of rather marginal systems. It's a great scheme, in my mind, but if the analog section isn't right the whole thing isn't right. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
>the point I was trying to make and you are still missing is what you >call "interleaving" is also "sampling" When the other part of the >system does the "interleaving" of the two singals, that is >sampling.... if there are components in the signal above 250 Hz then >you need the AA filter ahead of the sampling/interleaving... >
I do understand what you mean. The problem is that in this system the two signals are never separate at any stage. They are not sampled then interleaved digitally. It is an optical fiber system. There is an optical path switch that is changing the signal sent to the photodetector. My sampling of the photodetector outputs is synchronised with the optical switch. So the 'interleaving' stage is done before I can apply any AA filtering. If there were two separate photodetectors then I could easily filter both as you say, but in this system I have to use a switch and so they are both in the same signal before I can apply filtering - before they are even a voltage. There is no electronics until after the photodetection, by which stage the signals are already 'interleaved'. Unfortunately.
On 07/22/2010 06:30 AM, Mark wrote:
> On Jul 22, 5:32 am, "PhilipOrr" > <philip.orr@n_o_s_p_a_m.eee.strath.ac.uk> wrote: >> Many thanks for the fast responses. >> >> I would like to take a truly simultaneous differential measurement, however >> I can't with this system. The analogue signal is already being switched >> between the two inputs, and my sampling is simply synchronised with the >> switch rate so that I detect an interleaved version of the two signals. >> >> I also agree that I would ideally need to AA filter before I sample, >> however I can't do this because the filter would remove the switching >> signal (fswitch = fs). (Perhaps oversampling so that I could AA filter >> without removing the differential at fswitch, and then averaging/decimating >> down after ADC could solve this.) >> >> Currently, after de-interleaving I have the two 500 Hz signals. I subtract >> these from each other to get a differential signal. This is because they >> contain information on the same measurement but with equal and opposite >> polarity - however the noise should be identical in both (I thought). >> Therefore when I subtract I get double the signal power and suppress the >> common noise. Is this reasoning correct or overly simplistic / wrong? >> >> By subtracting the two signals I expected to see this reduced noise. >> However I don't. Clearly my view of the situation is lacking! Why do I not >> get reduced noise by this subtraction? In fact, the noise seems a bit >> worse, not better. Do I need to AA filter the 500 Hz signals before >> subtraction?? > > the point I was trying to make and you are still missing is what you > call "interleaving" is also "sampling" When the other part of the > system does the "interleaving" of the two singals, that is > sampling.... if there are components in the signal above 250 Hz then > you need the AA filter ahead of the sampling/interleaving... > > Read up on stereo FM multiplexing, it is an anaolog system, but the L > and R channels are "sampled" or interleaved. The ADC QUANTIZES the > signals. The AA filter is needed when a signal is SAMPLED and it > sounds like in your system that happens when the 2 signals are > "interleaved" into one. > > I agree with the others about doing the differential summing in the > analog domain and pass the result through ONE AA filter and one A/D.
Should I find those posts so I can disagree with them? Monolithic SAR A/D converters generally have _really crappy_ bias specifications -- you can expect that a 16-bit SAR ADC will have a bias of ten or twenty LSBs, and this bias will have a vicious drift with temperature that makes it impossible to calibrate out for all but the shortest of time intervals. I can't answer for sigma-delta ADCs because somehow I've never ended up using one in anger, but I wouldn't be surprised if their performance is spotty in this regard. By switching the polarity of the input signal between samples you can effectively eliminate this ADC bias -- if you do your job right. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
On 7/22/2010 10:13 AM, PhilipOrr wrote:
>> the point I was trying to make and you are still missing is what you >> call "interleaving" is also "sampling" When the other part of the >> system does the "interleaving" of the two singals, that is >> sampling.... if there are components in the signal above 250 Hz then >> you need the AA filter ahead of the sampling/interleaving... >> > > I do understand what you mean. The problem is that in this system the two > signals are never separate at any stage. They are not sampled then > interleaved digitally. > > It is an optical fiber system. There is an optical path switch that is > changing the signal sent to the photodetector. My sampling of the > photodetector outputs is synchronised with the optical switch. So the > 'interleaving' stage is done before I can apply any AA filtering. If there > were two separate photodetectors then I could easily filter both as you > say, but in this system I have to use a switch and so they are both in the > same signal before I can apply filtering - before they are even a voltage. > There is no electronics until after the photodetection, by which stage the > signals are already 'interleaved'. Unfortunately.
Maybe I misunderstood your system. What is the cause of the noise and how does it enter the system? I hope you aren't using a delta-sigma converter with a multiplexed input. Those things need many samples to settle. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
On 07/22/2010 07:13 AM, PhilipOrr wrote:
>> the point I was trying to make and you are still missing is what you >> call "interleaving" is also "sampling" When the other part of the >> system does the "interleaving" of the two singals, that is >> sampling.... if there are components in the signal above 250 Hz then >> you need the AA filter ahead of the sampling/interleaving... >> > > I do understand what you mean. The problem is that in this system the two > signals are never separate at any stage. They are not sampled then > interleaved digitally. > > It is an optical fiber system. There is an optical path switch that is > changing the signal sent to the photodetector. My sampling of the > photodetector outputs is synchronised with the optical switch. So the > 'interleaving' stage is done before I can apply any AA filtering. If there > were two separate photodetectors then I could easily filter both as you > say, but in this system I have to use a switch and so they are both in the > same signal before I can apply filtering - before they are even a voltage. > There is no electronics until after the photodetection, by which stage the > signals are already 'interleaved'. Unfortunately.
One of the top-ten mistakes that I see in digital systems design is some variation of the following statement: "I am sampling, therefore I need an anti-alias filter". You don't, necessarily. See http://www.wescottdesign.com/articles/Sampling/sampling.html for details. In fact, the system as you describe it _can't_ have an anti-alias filter put in. The sampling process destroys information; once that information is destroyed you can't bring it back. Unless you are decimating (i.e. sampling further), any post-sampling filter you put in will not have any affect on aliasing, and therefore cannot be an anti-aliasing filter. If aliasing is a problem, you'll have to live with it. If you've got some other system problem, you'll need to find it. Have you connected an oscilloscope to the ADC input and monitored the input signal vs. the ADC start-of-conversion command? The exercise may be illuminating. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
On Jul 22, 10:13=A0am, "PhilipOrr"
<philip.orr@n_o_s_p_a_m.eee.strath.ac.uk> wrote:
> >the point I was trying to make and you are still missing is what you > >call "interleaving" is also "sampling" =A0 When the other part of the > >system does the "interleaving" of the two singals, that is > >sampling.... if there are components in the signal above 250 Hz then > >you need the AA filter ahead of the sampling/interleaving... > > I do understand what you mean. The problem is that in this system the two > signals are never separate at any stage. They are not sampled then > interleaved digitally. >
in other words, your interleaved samples represent the signal (or it's negative) at the "interleaved" times of sampling. right? then, before subtracting, you need to advance one sample (let's say it's the even indexed sample) *ahead* 1/2 sample and the other sample (the odd one) behind 1/2 samples, so that they represent simultaneous sampling before you subtract one from the other. also, as Tim pointed out, this should take care of any DC bias in your ADC. if the error components are uncorrelated, their power will add (double) and their voltages will will increase by sqrt(2). but the legitimate component of your signal (what you want) will double and you will get *slightly* (3 dB) better signal-to-noise ratio. it's not a bad way to do things before the days of sigma-delta converters. i did this myself (a medical instrument with a very slow sampling rate and 12-bit converter) in 1979. have never done anything like it since. r b-j
Guys, thanks very much. 

I think you are right in that I am barking up the wrong tree with the
'aliasing problem'. Perhaps this is not really what I need to do to improve
this system.

In short, I thought the majority of the noise in this system would be
correlated between these two channels, and that by subtracting them from
one another I would remove the noise - especially at lower frequencies -
allowing me to get larger SNR on my differential signal.

However it seems the noise is not reduced, and when I look closely at the
waveforms it is clear that the noise is visibly uncorrelated between the
two signals. I'm now trying to identify at what point in the scheme this
noise is being introduced (it must be after the switch of course). Since
they both use the exact same path and components for detection after the
switch (but out of time with each other) this is proving quite difficult.

It may be photodetector noise or quantization noise, and by subtracting the
signals I am effectively doubling the strength of this random noise as
someone mentioned above. Does this sound correct? Could this be suppressed?
Perhaps I can't improve it further because of the limited freedom I have in
this scheme.

It probably sounds like I'm not getting anywhere but this is all very
helpful for me, so thanks again.
>in other words, your interleaved samples represent the signal (or it's >negative) at the "interleaved" times of sampling. right? then, >before subtracting, you need to advance one sample (let's say it's the >even indexed sample) *ahead* 1/2 sample and the other sample (the odd >one) behind 1/2 samples, so that they represent simultaneous sampling >before you subtract one from the other. > >also, as Tim pointed out, this should take care of any DC bias in your >ADC. if the error components are uncorrelated, their power will add >(double) and their voltages will will increase by sqrt(2). but the >legitimate component of your signal (what you want) will double and >you will get *slightly* (3 dB) better signal-to-noise ratio. > >it's not a bad way to do things before the days of sigma-delta >converters. i did this myself (a medical instrument with a very slow >sampling rate and 12-bit converter) in 1979. have never done anything >like it since. > >r b-j >
As for the ADC, I'm putting the photodetector straight into a National Instruments PXI analogue input. The processing (de-interleaving, subtraction, FFT) is then done in LabVIEW. At the moment I am not shifting any samples like you say. My understanding of DSP is limited as I'm sure you have noticed. What I am doing is constantly sampling but using shift registers to store sample A, then get sample B and subtract. i.e. Sample - Store as A Sample - Store as B -> Subtract B-A Sample - Store as A Sample - Store as B -> Subtract B-A (Differential output at fs/2). or Sample - Store as A Sample - Store as B -> Subtract B-A Sample - Store as A -> Subtract B-A Sample - Store as B -> Subtract B-A (Differential output at fs). As it stands, I don't even know which of the above is more technically sound. I have been trying both.
On 07/22/2010 08:48 AM, PhilipOrr wrote:
> Guys, thanks very much. > > I think you are right in that I am barking up the wrong tree with the > 'aliasing problem'. Perhaps this is not really what I need to do to improve > this system. > > In short, I thought the majority of the noise in this system would be > correlated between these two channels, and that by subtracting them from > one another I would remove the noise - especially at lower frequencies - > allowing me to get larger SNR on my differential signal. > > However it seems the noise is not reduced, and when I look closely at the > waveforms it is clear that the noise is visibly uncorrelated between the > two signals. I'm now trying to identify at what point in the scheme this > noise is being introduced (it must be after the switch of course). Since > they both use the exact same path and components for detection after the > switch (but out of time with each other) this is proving quite difficult. > > It may be photodetector noise or quantization noise, and by subtracting the > signals I am effectively doubling the strength of this random noise as > someone mentioned above. Does this sound correct? Could this be suppressed? > Perhaps I can't improve it further because of the limited freedom I have in > this scheme. > > It probably sounds like I'm not getting anywhere but this is all very > helpful for me, so thanks again.
Any truly random noise, i.e. photodetector, ADC, or circuit noise, will double in power when you do the subtraction. But if the thing you're measuring isn't moving too fast, the measurements will be highly correlated, which means that when you do the subtraction the _amplitude_ will double -- which means that the power will go up by a factor of four. So your signal to noise ratio should improve. This is what you do by averaging: if your noise is a white process and you add up N samples, the noise power will go up by N (i.e. the expected noise amplitude goes up by sqrt(N)). But if your signal isn't moving significantly over those N samples the _signal_ power goes up by N^2. Then you divide the sum by N, and you're left with the original signal and 1/sqrt(N) of the noise power. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html