DSPRelated.com
Forums

Sampling: What Nyquist Didn't Say, and What to Do About It

Started by Tim Wescott December 20, 2010
On Mon, 20 Dec 2010 08:14:31 -0800, Tim Wescott <tim@seemywebsite.com>
wrote:

>On 12/20/2010 03:30 AM, Anton Erasmus wrote: >> On Mon, 20 Dec 2010 01:34:44 -0600, Tim Wescott<tim@seemywebsite.com> >> wrote: >> >>> I know there's a few people out there who actually read the papers that I >>> post on my web site. >>> >>> I also know that the papers have gotten a bit ragged, and that I haven't >>> been maintaining them. >>> >>> So here: I've made a start. >>> >>> http://www.wescottdesign.com/articles/Sampling/sampling.pdf >>> >>> My intent (with apologies to all of you with dial-up), is to convert the >>> ratty HTML documents to pdf as time permits, and in a way that leaves the >>> documents easily maintainable and in a form that is easy to look at from >>> the web or to print out, as you desire. >> >> The fonts are terrible. They seem to be bitmap fonts and not vector. >> It looks like you used TeX to generate the document. Go to >> http://www.truetex.com/ for links to quite number of articles on >> how to use truetype fonts in TeX. > >What reader were you using? I'm trying to figure out (a) why some >people think it looks peachy and some think it looks terrible (it looks >great on Evince), and (b) make sure I test it on enough different >readers that I get a true picture of what it looks like to the world at >large.
Looks peachy. Reader: Tracker Software's PDF-XChange viewer, ver 2.5. Edit | Preferences | Rendering set to smooth line art, text, and images; and gamma is set to 1.0. Text is readable down to 50% scaling (about 4.5" apparent page height on a laptop LCD with 1400x1050 pixels) and quite good at 100% and up. Paragraph density (overall 'grayness' on the page) looks even. Looks so-so. Reader: Foxit PDF Reader, ver 4.2. Tools | Preferences | Page Display set to "display texts optimized for LCD screen." Text is discernable but not really readable at 50%. So-so at 100%, with stroke widths not well hinted; vertical strokes on capitals, for example, are much darker than neighboring lower-case letters. Paragraph density looks thin, with the capital letters standing out. You might try Bitstream's Charter, which should be included with most LaTeX distros and avoids the (sometimes painful) chore of using arbitrary typeface packages. -- Rich Webb Norfolk, VA
On 12/20/2010 11:57 AM, Grant Edwards wrote:
> [...] > I don't see anything at all wrong with the font.
Did you zoom way in, e.g., on a single letter? -- Randy Yates % "My Shangri-la has gone away, fading like Digital Signal Labs % the Beatles on 'Hey Jude'" yates@digitalsignallabs.com % http://www.digitalsignallabs.com % 'Shangri-La', *A New World Record*, ELO
On Mon, 20 Dec 2010 12:03:37 -0500, Randy Yates <yates@ieee.org>
wrote:

>On 12/20/2010 11:46 AM, John Larkin wrote: >> [...] >> I sold a couple hundred thousand channels of an AC power meter, used >> for utility end-use surveys, that sampled the power line voltage and >> current signals at 27 Hz. I had a hell of a time arguing with >> "Nyquist" theorists who claimed I should be sampling at twice the >> frequency of the highest line harmonic, like the 15th maybe. > >John, > >If your AC signal had more than 13.5 Hz of bandwidth, how were you >able to accurately sample them at 27 Hz? As far as I know, even >subsampling assumes the _bandwidth_ is less than half the sample rate >(for real sampling).
Read Tim's paper! The thing about an electric meter is that you're not trying to reconstruct the waveform, you're only gathering statistics on it. The 27.xxx Hz sample rate was chosen so that its harmonics would dance between the line harmonics up to some highish harmonic of 60 Hz, so as to not create any slow-wobble aliases in the reported values (trms volts, amps, power, PF) that would uglify the local realtime display or the archived time-series records. From a signal-theory standpoint, the bandwidth of the signal is in fact narrow, so the sample rate can be low. The "signal bandwidth" is actually the sum of the bandwidths of the various spectral harmonic lines, multiples of 60 Hz, mostly of the ugly current waveforms, which is pretty weird when you think of it. The sample-hold is simultaneously undersampling a bunch of narrow but disjoint spectral zones, still following the Shannon rules for each one. Given that, it was a considerable nuisance to come up with that 27.xxx Hz sample rate. Using available crystals. I also used a 7-bit single-slope ADC, which I didn't reveal to the customers because they would have argued over that, too. I did waveform acquisition on demand, in a burst of samples, at some other goofy sample rate, some hundreds of Hz. I sampled over many line cycles, stuck the samples into RAM, and then reordered them to make them equivalent-time sequential. That was fun. 12K lines of MC6803 code! John
On Mon, 20 Dec 2010 01:34:44 -0600, Tim Wescott <tim@seemywebsite.com>
wrote:

>I know there's a few people out there who actually read the papers that I >post on my web site. > >I also know that the papers have gotten a bit ragged, and that I haven't >been maintaining them. > >So here: I've made a start. > >http://www.wescottdesign.com/articles/Sampling/sampling.pdf > >My intent (with apologies to all of you with dial-up), is to convert the >ratty HTML documents to pdf as time permits, and in a way that leaves the >documents easily maintainable and in a form that is easy to look at from >the web or to print out, as you desire. > >-- >http://www.wescottdesign.com
I'm using Adobe Reader 9 and it looks fine here, even blown way up. Eric Jacobsen Minister of Algorithms Abineau Communications http://www.abineau.com
On 12/20/2010 02:34 AM, Tim Wescott wrote:
> [...] > http://www.wescottdesign.com/articles/Sampling/sampling.pdf
Tim, First let me say that overall the new paper looks really great! I am pleased that you've chosen to utilize (La)TeX - it has served me well for over two decades. There are a few rough edges such as bitmapped fonts (which aren't necessary) and errors in spacing, but I'm sure you'll get those worked out. What does concern me, however, is some of the theory you've presented. Specifically, this section on p.11: Sampling at some frequency that is equal to the repetition rate divided by a prime number will automatically stack these narrow bits of signal spectrum right up in the same order that they were in the original signal, only jammed much closer together in frequency which is the roundabout frequency-domain way of saying that you can sample at just the right rate, and interpret the resulting signal as a slowed-down replica of the input waveform. There are two points in which I challenge the veracity of your assertions: 1. Sampling at a rate of F/N when N is integer will never help subsample a signal since the period of the sampling, N/F, is always a multiple of the repetition rate period 1/F. 2. It seems that to truely, completely sample a repetitive signal in such a way, you would need a sampling period that will never be a multiple of the repetition period. For example, for the 60 Hz example you could use a sample rate of 60 Hz / sqrt(2). But then, even if you sample at such a rate, it would take an INFINITE amount of time to fully sample this signal. It's equivalent to sampling an interval on the real line a point at a time; real analysis tells us that there are an uncountably infinite number of points in such an interval! So, I'm afraid I cannot agree that an accurate sampling of a repetitive waveform can be made in this manner. If you disagree, please show me where my reasoning is wrong. -- Randy Yates % "My Shangri-la has gone away, fading like Digital Signal Labs % the Beatles on 'Hey Jude'" yates@digitalsignallabs.com % http://www.digitalsignallabs.com % 'Shangri-La', *A New World Record*, ELO
On 12/20/2010 12:48 PM, Eric Jacobsen wrote:
> [...] > I'm using Adobe Reader 9 and it looks fine here, even blown way up.
Ha! Interesting... What may be happening is that some font is not embedded, and that if you don't have the TeX fonts installed, the reader is substituting a postscript font, which is vector, so it looks fine. But if you do have TeX fonts on your system, you get them rendered as bitmaps. -- Randy Yates % "My Shangri-la has gone away, fading like Digital Signal Labs % the Beatles on 'Hey Jude'" yates@digitalsignallabs.com % http://www.digitalsignallabs.com % 'Shangri-La', *A New World Record*, ELO
Jan Panteltje wrote:
> On a sunny day (Mon, 20 Dec 2010 01:40:32 -0800) it happened Robert Baer > <robertbaer@localnet.com> wrote in > <UO-dnUZyBpEGuZLQnZ2dnUVZ_gidnZ2d@posted.localnet>: > >> Mikolaj wrote: >>> Dnia 20-12-2010 o 08:34:44 Tim Wescott<tim@seemywebsite.com> napisa&#4294967295;(a): >>> >>>> I know there's a few people out there who actually read the papers that I >>>> post on my web site. >>>> >>>> I also know that the papers have gotten a bit ragged, and that I haven't >>>> been maintaining them. >>>> >>>> So here: I've made a start. >>>> >>>> http://www.wescottdesign.com/articles/Sampling/sampling.pdf >>>> >>>> My intent (with apologies to all of you with dial-up), is to convert the >>>> ratty HTML documents to pdf as time permits, and in a way that leaves the >>>> documents easily maintainable and in a form that is easy to look at from >>>> the web or to print out, as you desire. >>>> >>> >>> My first thought was that fonts look a little bit to thin and bright. >>> I use AcrobatReader 9.4.1, preferences/rendering: LCD,all options checked. >>> >> I agree, the font makes it very difficult to read, and is not >> conducive to enhancing reading over a long term, namely longer than one >> page.. > > I think the fonts look great, watching full screen on a 1680x1050 LCD with > xpdf in Linux. > wget http://www.wescottdesign.com/articles/Sampling/sampling.pdf > xpdf sampling.pdf >
Interesting; I am looking on a 1680x1050 as well (although on Windows) and they look great. Just an observation. -- Les Cargill
"John Larkin" <jjlarkin@highNOTlandTHIStechnologyPART.com> wrote in message 
news:0v1vg6p1838qiv06daj3cftnt4vtggr00s@4ax.com...
> I sold a couple hundred thousand channels of an AC power meter, used > for utility end-use surveys, that sampled the power line voltage and > current signals at 27 Hz. I had a hell of a time arguing with > "Nyquist" theorists who claimed I should be sampling at twice the > frequency of the highest line harmonic, like the 15th maybe.
This is another one of those things where I think university courses have done most of the damage -- not emphasizing that Nyquist only cares about the bandwidth of your signals, but not at all what particular frequencies it is you're using. 2nd most common mis-interpretation (or perhaps, "non-optimal use") of Nyquist I've seen: Figuring that, if you were initially sampling at Fs and neede a brick-wall filter at Fs/2, if you go to, say, 8x oversampling you now need a filter with negligible response by 8*Fs/2 (an easier filter to build)... not realizing that actually all you really need is a filter with negligible response by 8*Fs-Fs/2 (even easier still!). ---Joel
John Larkin wrote:
> On Mon, 20 Dec 2010 12:03:37 -0500, Randy Yates<yates@ieee.org> > wrote: > >> On 12/20/2010 11:46 AM, John Larkin wrote: >>> [...] >>> I sold a couple hundred thousand channels of an AC power meter, used >>> for utility end-use surveys, that sampled the power line voltage and >>> current signals at 27 Hz. I had a hell of a time arguing with >>> "Nyquist" theorists who claimed I should be sampling at twice the >>> frequency of the highest line harmonic, like the 15th maybe. >> >> John, >> >> If your AC signal had more than 13.5 Hz of bandwidth, how were you >> able to accurately sample them at 27 Hz? As far as I know, even >> subsampling assumes the _bandwidth_ is less than half the sample rate >> (for real sampling). > > Read Tim's paper! > > The thing about an electric meter is that you're not trying to > reconstruct the waveform, you're only gathering statistics on it. The > 27.xxx Hz sample rate was chosen so that its harmonics would dance > between the line harmonics up to some highish harmonic of 60 Hz, so as > to not create any slow-wobble aliases in the reported values (trms > volts, amps, power, PF) that would uglify the local realtime display > or the archived time-series records. >
Is this something like heterodyning, then? You're building a detector, not a ... recorder. Right?
> From a signal-theory standpoint, the bandwidth of the signal is in > fact narrow, so the sample rate can be low. The "signal bandwidth" is > actually the sum of the bandwidths of the various spectral harmonic > lines, multiples of 60 Hz, mostly of the ugly current waveforms, which > is pretty weird when you think of it. The sample-hold is > simultaneously undersampling a bunch of narrow but disjoint spectral > zones, still following the Shannon rules for each one. > > Given that, it was a considerable nuisance to come up with that 27.xxx > Hz sample rate. Using available crystals. > > I also used a 7-bit single-slope ADC, which I didn't reveal to the > customers because they would have argued over that, too. > > I did waveform acquisition on demand, in a burst of samples, at some > other goofy sample rate, some hundreds of Hz. I sampled over many line > cycles, stuck the samples into RAM, and then reordered them to make > them equivalent-time sequential. That was fun. > > 12K lines of MC6803 code! > > John > >
-- Les Cargill
David Brown <david.brown@removethis.hesbynett.no> writes:

> On 20/12/10 13:47, John Devereux wrote: >> Jan Panteltje<pNaonStpealmtje@yahoo.com> writes: >> >>> On a sunny day (Mon, 20 Dec 2010 01:40:32 -0800) it happened Robert Baer >>> <robertbaer@localnet.com> wrote in >>> <UO-dnUZyBpEGuZLQnZ2dnUVZ_gidnZ2d@posted.localnet>: >>> >>>> Mikolaj wrote: >>>>> Dnia 20-12-2010 o 08:34:44 Tim Wescott<tim@seemywebsite.com> napisa&#322;(a): >>>>> >>>>>> I know there's a few people out there who actually read the papers that I >>>>>> post on my web site. >>>>>> >>>>>> I also know that the papers have gotten a bit ragged, and that I haven't >>>>>> been maintaining them. >>>>>> >>>>>> So here: I've made a start. >>>>>> >>>>>> http://www.wescottdesign.com/articles/Sampling/sampling.pdf >>>>>> >>>>>> My intent (with apologies to all of you with dial-up), is to convert the >>>>>> ratty HTML documents to pdf as time permits, and in a way that leaves the >>>>>> documents easily maintainable and in a form that is easy to look at from >>>>>> the web or to print out, as you desire. >>>>>> >>>>> >>>>> My first thought was that fonts look a little bit to thin and bright. >>>>> I use AcrobatReader 9.4.1, preferences/rendering: LCD,all options checked. >>>>> >>>> I agree, the font makes it very difficult to read, and is not >>>> conducive to enhancing reading over a long term, namely longer than one >>>> page.. >>> >>> I think the fonts look great, watching full screen on a 1680x1050 LCD with >>> xpdf in Linux. >>> wget http://www.wescottdesign.com/articles/Sampling/sampling.pdf >>> xpdf sampling.pdf >> >> No, they do look a bit "bitmapped" I'm afraid. I am also using xpdf in >> linux. A minor detail though, still quite readable IMO. >> > > Getting /almost/ on-topic again, the issue is, I think, that xpdf > doesn't do anti-aliasing very well and so the fonts look a bit poor at > low resolution. Evince does better. But in general, CMR fonts are > better on high-resolution devices - they were designed for use on > laser printers, not to look nice on screens.
You're right. Acrobat does better still. I guess I'm not used to this since I don't see many bitmapped fonts. (Even with xpdf it is not at all "terrible" by the way, and thanks Tim for posting it). -- John Devereux