anti-aliasing

J

John Larkin

Jan 1, 1970
0
Well if your system is generating the sine wave then how does it come to
pass that you don't know the frequency? If you're admitting the
possibility of a harmonic or subharmonic output, what makes you think it
will even be constant or a sine. You may need some analog to steer your
processing in the large...like a filter bank or a voltage controlled
variable center frequency band pass or something or IF swept mixer
thing, dunno.

-mystified

As addressed elsewhere, I have legit reasons for seeking a general
solution, not to mention that it's an interesting problem. I'm also
planning a couple of future measurement products that absolutely have
no control over the signal frequency, and need accurate signal
analysis from an ensemble of samples, so it's doubly interesting.

John
 
F

Fred Bloggs

Jan 1, 1970
0
John said:
Well, Fred keeps insulting me because I have ideas and design things.
He seems to think that the initial stages of a design, the explore
possibilities phase, is impure and beneath his dignity.

I've known lots of people who couldn't design because they feel
insecure in the early stages, the deliberate uncertainty phase. These
people, if thet are responsible for design (which they shouldn't be)
tend to look for well-analyzed prior art, and if they can't find any,
usually seize onto the first clumsy concept they can come up with, and
then settle into brute-force analysis and implementation of a bad
idea. Design is a creative, chaotic, psychological process that
uptight people don't like and seldom respect.

You could not be more wrong. The phrase I don't like, and what you
really mean when you say "chaotic," is AD HOC. There are many really bad
features that go along with the descriptor AD HOC, the primary one of
which is you don't really know what you're doing. I use 'you' here in
the general sense and not in reference to you specifically. The only
thing I know for sure is, whatever you come up with, it will be ugly. LOL
 
J

Jim Thompson

Jan 1, 1970
0
You could not be more wrong. The phrase I don't like, and what you
really mean when you say "chaotic," is AD HOC. There are many really bad
features that go along with the descriptor AD HOC, the primary one of
which is you don't really know what you're doing. I use 'you' here in
the general sense and not in reference to you specifically. The only
thing I know for sure is, whatever you come up with, it will be ugly. LOL

Actually Fred, you perpetually pontificate, but you don't win, place
or even show. SHOW us a product of your design.

...Jim Thompson
 
F

Fred Bloggs

Jan 1, 1970
0
Jim said:
Actually Fred, you perpetually pontificate, but you don't win, place
or even show. SHOW us a product of your design.

...Jim Thompson

You take it as pontificating because you don't know anything. Testing to
achieve reasonable coverage and characterization of ad hoc algorithm
performance is an ongoing and important area of state-of-the-art research.
 
J

Jim Thompson

Jan 1, 1970
0
You take it as pontificating because you don't know anything. Testing to
achieve reasonable coverage and characterization of ad hoc algorithm
performance is an ongoing and important area of state-of-the-art research.

How about some positive suggestions instead of negative BS ??

...Jim Thompson
 
J

John Larkin

Jan 1, 1970
0
You could not be more wrong. The phrase I don't like, and what you
really mean when you say "chaotic," is AD HOC. There are many really bad
features that go along with the descriptor AD HOC, the primary one of
which is you don't really know what you're doing. I use 'you' here in
the general sense and not in reference to you specifically. The only
thing I know for sure is, whatever you come up with, it will be ugly. LOL

Of course I know what I'm doing. I sell heaps of stuff to the biggest
areospace, scientific, and instrumentation people on the planet. Some
serious fraction of all the submicron ICs made in the world are
exposed by eximer lasers that my gear fires. My gear is also in close
to half the analytical NMR systems made, and tests - at production and
maintenance levels - jet engines and apu's that, probably, everyone in
this ng depends on to keep them alive.

What do you do?

But new ideas have to come from somewhere, and that somewhere isn't in
equations or textbooks. Of course ideas must be filtered for quality,
in a rigorous manner, but you've got to have ideas first. Of course
the process must be ad hoc on the front end, and the goofier the
better. When you hope to do something you've never done before, and
maybe nobody has ever done before, of course you really don't know
what you're doing; that's the fun part. Especially when you've already
committed to shipping the thing in five weeks.

And our stuff isn't ugly; we regularly get written compliments on its
elegance and quality, and on the quality of the documentation and
support. Show us something you've done.


John
 
P

petrus bitbyter

Jan 1, 1970
0
John Larkin said:
Suppose one (actually, me) were firing an adc at some fixed rate,
ballpark 12 KHz in this case, and the input to the adc was a sine wave
of fixed but unknown frequency. The adc will take a bunch of samples,
ballpark 1000 maybe, and I want to compute the mean (ie, dc value) and
the mean of the abs value of the samples (ie, the ac value). That
works, but sometimes the input frequency aliases against the sample
rate and messes up the data, like gives a big average dc value when
there's really none there.

(This is not a Nyquist issue; the sample rate may be above or below
the sinewave frequency.)

So maybe I can fuzz up the sample rate so that it can't alias against
any constant sinewave frequency.

I could add a pseudo-random delay after every adc sample shot; but the
mean sample rate wouldn't change a lot. Or I could add successive
delays, essentially sweeping the sample rate down.

Any ideas?

John

Why not simply measure the sine waves frequency and choose the sample rate
accordingly? As long as you don't know that frequency it's hard to predict
the influence of any measures you take.

petrus bitbyter
 
P

Phil Hobbs

Jan 1, 1970
0
John said:
For N=1000, (1+1/N) is only 1.001. That won't move an alias very far.
The alias doesn't have to be to DC to mess me up, it just has to be to
a low frequency relative to my total sampling run duration.

If I did it twice, which measurement would I trust? Not the one with
the lowest DC offset, because I'm trying to measure offset.

Even three runs (which would take a lot of time) would be tricky...
would I throw out the one that has the highest DC offset, and average
the other two? Or pick the two that agree best?

Too much work!

John
It doesn't have to move it far--the aliased frequency goes from 0 to 1
cycle per N samples, which gives you a beautiful plot of the waveform.
What's not to like?

If you do it three times, at least two will have similar offsets always.
Majority rules.

Cheers,

Phil Hobbs

Cheers,

Phil Hobbs
 
J

John Larkin

Jan 1, 1970
0
You take it as pontificating because you don't know anything. Testing to
achieve reasonable coverage and characterization of ad hoc algorithm
performance is an ongoing and important area of state-of-the-art research.

Blather.

John
 
R

Robert Baer

Jan 1, 1970
0
Fred said:
Do you intend on using a sample zero mean, or closeness to it, as a
numerical criterion for confidence in the estimate of the mean of
abs(.)? Is there any analytical basis for this that you actually
understand? What range of confidence are you looking for? 75%? 90%?
99.9%? or what? Give us some numbers. There is a form of filtering
derived from principles of artificial intelligence that is more or less
applicable, it is called _____ _____ filtering and it's quite powerful.



The very word "ideas" in this context actually means "guesses." That
would be in keeping with your methodology. The success rate will be a
function of something called the density of useful solutions...
Yes; underline filtering is very powerful, as it puts emphasis on
whatever it oerates upon (usually typed characters).
 
R

Robert Baer

Jan 1, 1970
0
John said:
This is a BIST (self-test) function for a DDS synthesizer. Any
significant mean value would be an indicator that something is wrong
in the stuff that generates the sinewaves. That might be excess dc
offset, clipping, or distortion.


Is there any analytical basis for this that you actually



Certainly.

What range of confidence are you looking for? 75%? 90%?



I'd like to verify that the sinewave amplitude is within, say, 2% of
my target (that's the system spec) and that a 20 volt p-p sine has
below, say, 200 mV of offset. If I don't have aliasing, I'm seeing
offset measurements in the 50 mV range. The BIST subsystem is pretty
simple: a relay diverts the signal from the customer connector into a
12-bit ADC, and the rest is all firmware, including the ADC triggers.


There is a form of filtering



There's no filtering that can remove aliases once they're in the data.




Where do you think new concepts come from? They come from generating a
great number of ideas, and riffs on those ideas, and filtering them
for quality. A filter with no input has no output.

I wouldn't expect ideas from you, because you are hostile to the
chaotic nature of the creative process. Some people are that way, and
can do good work in other ways, but they won't allow themselves to
design.

John
Hmmm....what about some external hardware?
Add a +peak detector and a -peak detector and feed their outputs to
the ADC?
 
J

John Larkin

Jan 1, 1970
0
Hmmm....what about some external hardware?
Add a +peak detector and a -peak detector and feed their outputs to
the ADC?

I only have about a square inch for the BIST stuff, and the board is
done. And I want to measure both the AC voltage (not just its peak)
and any DC offset. The biggest problem is to resolve a small DC offset
(say, 100 mV) by averaging samples of a big (+-10 volt swing) sine
wave.

Firmware is free in production, so there ought to be a way to do this.
Besides, it's an interesting problem.

Frequency-domain artifacts in fast ADCs are often zapped by adding a
couple lsb's of wideband noise to the signal, to smear out
quantization and dnl errors. This kills specific spectral artifacts at
the expense of raising the wideband noise floor.

Nuclear detector histogramming ADCs also benefit from adding noise, to
improve differential linearity and equalize bin size. Some clever guy
figured out that you can add analog noise (with a dac) and then
subtract out the digital equivalent, best of both worlds.

A delta-sigma dac zaps a horrible pwm component by spreading it out
across the spectrum. A delta-sigma adc converts a useless 1-bit adc
into a nice 24-bit one, same idea.

So if a Nyquist-scoffing sampling adc has aliasing artifacts in the
signal spectrum, it seems like time-dithering the triggers can do the
same thing, pulverize an alias and sprinkle it lightly across the
noise floor.

John
 
F

Fred Bloggs

Jan 1, 1970
0
John said:
Of course I know what I'm doing. I sell heaps of stuff to the biggest
areospace, scientific, and instrumentation people on the planet. Some
serious fraction of all the submicron ICs made in the world are
exposed by eximer lasers that my gear fires. My gear is also in close
to half the analytical NMR systems made, and tests - at production and
maintenance levels - jet engines and apu's that, probably, everyone in
this ng depends on to keep them alive.

I don't believe a word you say. Be sure and burn off a copy of that post
to take to your doctor so he/she can recommend the best therapist for
your megalomania...
 
J

John Larkin

Jan 1, 1970
0
I don't believe a word you say. Be sure and burn off a copy of that post
to take to your doctor so he/she can recommend the best therapist for
your megalomania...

You think rhat my web site is a personal fantasy, that nobody actually
buys the stuff?

Lately we're selling a lot of tach/overspeed and thermocouple stuff
into Russia, for the pipeline business. They're ramping us fast and
are rolling in money. They pay us in advance, by bank transfer, in
dollars. Think we should charge euros?

What do you do, Fred?

John
 
J

John O'Flaherty

Jan 1, 1970
0
Say, 2 KHz to 1 MHz. The flat-out sample rate is 12.4 KHz (software
loop, bit-banging a 12-bit serial ADC) which I can slow down on a
per-sample basis, randomly or swept or whatever. I usually take about
1000 samples and average the mean and the software-rectified mean.

Suppose you take samples at a fixed rate. If aliasing is giving a
false value for the offset, then wouldn't looking at even and odd
samples (without resampling), or every third sample, give different
values for the offset by effectively shifting the point in the wave
that was sampled? Then only if that check showed a big discrepancy
would you have to resample at a different rate, very infrequently
giving a longer test.
 
J

John O'Flaherty

Jan 1, 1970
0
Suppose you take samples at a fixed rate. If aliasing is giving a
false value for the offset, then wouldn't looking at even and odd
samples (without resampling), or every third sample, give different
values for the offset by effectively shifting the point in the wave
that was sampled? Then only if that check showed a big discrepancy
would you have to resample at a different rate, very infrequently
giving a longer test.

Thinking again, that wouldn't work if the input were _exactly_ at the
sampling frequency, since all samples would be at the same point in
the wave. So take the first 500 samples at one sample rate, and the
second at a slightly different rate. If there's a difference between
the two data sets, or among subsets within each set, only then do you
have to resample, otherwise average the two results.
 
B

BobW

Jan 1, 1970
0
John O'Flaherty said:
Thinking again, that wouldn't work if the input were _exactly_ at the
sampling frequency, since all samples would be at the same point in
the wave. So take the first 500 samples at one sample rate, and the
second at a slightly different rate. If there's a difference between
the two data sets, or among subsets within each set, only then do you
have to resample, otherwise average the two results.

I was thinking along similar lines. There really is no need to change the
sample rate unless there is *perfect* synchronization between the sampler
and the samplee. The real problem is knowing how many samples to take in
order to get accurate results.

He (Larkin) could probably set up tests to empirically determine the number
of samples needed (for a given amount of accuracy), but there would always
be a level of doubt since there could cases (as a function of production
variances in the two clock sources) that give bogus results. Your technique,
however, would reduce this chance (at the expense of time).

Either way, I'm glad it's not my problem. ;-}

Bob
 
N

Nico Coesel

Jan 1, 1970
0
John Larkin said:
Suppose one (actually, me) were firing an adc at some fixed rate,
ballpark 12 KHz in this case, and the input to the adc was a sine wave
of fixed but unknown frequency. The adc will take a bunch of samples,
ballpark 1000 maybe, and I want to compute the mean (ie, dc value) and
the mean of the abs value of the samples (ie, the ac value). That
works, but sometimes the input frequency aliases against the sample
rate and messes up the data, like gives a big average dc value when
there's really none there.

(This is not a Nyquist issue; the sample rate may be above or below
the sinewave frequency.)

So maybe I can fuzz up the sample rate so that it can't alias against
any constant sinewave frequency.

I could add a pseudo-random delay after every adc sample shot; but the
mean sample rate wouldn't change a lot. Or I could add successive
delays, essentially sweeping the sample rate down.

Any ideas?

My first guess is that sampling with well distributed (Gaussian?)
noise should do it. But it probably takes some math to prove it right
or wrong.
 
J

John Larkin

Jan 1, 1970
0
My first guess is that sampling with well distributed (Gaussian?)
noise should do it. But it probably takes some math to prove it right
or wrong.

If you treat each sample event as an impulse, there is probably an
optimum resulting spectrum, and a corresponding time-between-samples
scatter algorithm that may not be just bounded random delay.

Some really smart person should work this out.

John
 
J

John O'Flaherty

Jan 1, 1970
0
I was thinking along similar lines. There really is no need to change the
sample rate unless there is *perfect* synchronization between the sampler
and the samplee. The real problem is knowing how many samples to take in
order to get accurate results.

He (Larkin) could probably set up tests to empirically determine the number
of samples needed (for a given amount of accuracy), but there would always
be a level of doubt since there could cases (as a function of production
variances in the two clock sources) that give bogus results. Your technique,
however, would reduce this chance (at the expense of time).

Either way, I'm glad it's not my problem. ;-}

What I was thinking is, there's not much time burden in looking at
subsets of the data, at least compared to resampling. Then, in the
infrequent case that there is a bad result, more time to resample
would separate the cases of coincidental aliasing from actual failure
of the test.
 
Top