From: Jerry Avins on
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.
�����������������������������������������������������������������������
From: Tim Wescott on
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
From: PhilipOrr on
>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.
From: Tim Wescott on
On 07/22/2010 06:30 AM, Mark wrote:
> On Jul 22, 5:32 am, "PhilipOrr"
> <philip.orr(a)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
From: Jerry Avins on
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.
�����������������������������������������������������������������������