Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Dr. Dobb's Math Power Newsletter - May 2002


Dr. Dobb's Math Power Newsletter - Vol. 8, No. 5, May 2002 - ISSN 1087-2035

Math Power

Official Publication of Math Power Club
Incorporating LIGHT WORK and COMPUTER WRANGLER
Math Power Club is an Unofficial Club of Pima CC East
Editor and Publisher Emeritus: Homer B. Tilton


Vol. 8, No. 5, May 2002 - ISSN 1087-2035


The Stroud Project
Generating Gaussian pulse trains

In 1988 our shop was awarded a contract by SFC,Inc. (Arnold Stroud), of Kingman, AZ to design and build a Gaussian pulse-train generator. We started with a block diagram defining specifically what we wanted to design. We wanted a Gaussian waveform; and the method chosen was to drive a Gaussian function module with a triangular wave. This is the story of how that was done, related in present tense.

Part I: The overall plan -
The transfer characteristic of the function module is to be Gaussian. That means the output is to be an exponential function of the input. Calling the input x and the output y, a general Gaussian function has the form y=exp(-x2).


Ex.1. The desired end periodic function can be graphed as y=exp(-x2) with x=Arccos(cos t)-/2. Using the graphing program ART.BAT, the command is this:

Comma/Cart 2*pi 1 fnArccos(cos(x))-ph:y=exp(-y^2)

with fnArccos defined by putting a line like this into the batch file:

Echo 32 DEF fnArccos(x)=-Atn(x/Sqr(1-x^2))+PH>>tmp

see MP for Mar. 2001, pages 1, 2 & 5.


Analog microchips are commercially available to perform the squaring and logarithmic operations. The exponentiation operation can be performed by putting a logarithmic chip inside the feedback loop of an operational amplifier. The two chips chosen are the Burr-Brown MPY100 multiplier, and the Burr-Brown 4127 log amp containing a spare operational amplifier. Input and output scales are to be adjustable manually. The pulse frequency will be that of the triangular waveform driver.

A future continuation of this article is planned to detail the design of the GCM-8805 Gaussian Function Module and the TRI-32 Triangular Waveform Generator, as follows:

Part II. The function module
Part III. The waveform generator
Part IV. System integration


Linux talk

Jim Oliver gets our appreciation for helping us out with the CD-ROM driver on our PC named JR. (See lead article in April issue.) We will soon be ready to attempt loading Linux into it. We already have Linux on CD-ROM and want to try using Smart BASIC with it. We'll keep you posted on progress.


COM data files
Simple customizable software lets you type
Greek, math, other characters at the DOS prompt

References:
1. TYPE/data files: What are they? - The Echo - Mar '94, p. 1
2. A Dvorak keyboard - The Echo - Apr '94, p. 1, 2
3. Creating messenger COM files - Computer Wrangler - Dec '95, p. 3
4. Outsmarting Program Demons - Windows Developer's Journal - Mar '96, p. 52

Reference one tells how ANSI escape sequences appearing in a file are executed when the file is displayed using the DOS TYPE command. Reference two tells how to use that fact in a batch file to reassign QWERTYUIOP to ?<>PYFGCRL (and so on) to make a Dvorak keyboard. References three and four tell how to make a COM file which does nothing but display a message. Now, for use with our new PC which we've named JR (see Apr' 02 MP), those methods are combined to form the ultimate in conve- nience in do-it-yourself key reassignment files: a COM data file.

Described next is OLAY4.COM, which provides a Greek and math keyboard overlay at the DOS prompt. No TSR is involved; it relies on ANSI.SYS. Make its first line using this DOS command, where ~186 indicates the ASCII 186 character and so on. (To make the ~186 character depress and hold an Alt key while you key-in 186 in the numeric keypad. NumLock need not be set.)

Echo ~186~11~1~180~9~205~33~195~32 >>OLAY4.COM

If you type that, the ~186-~195 part should look like this: and ~32 is just a space. Enter that command to put the first line into your file. (The double >> redirector insures that if there is already a file by that name it won't be wiped out, but simply added to.)

Now load OLAY4.COM into your favorite no-frills text editor and type this second line of the file; replace hyphen (-) with the escape character, ~27. (If you use EDIT, Ctrl-P must be punched before Alt-27 will type the escape character. John Woram: "EDIT recognizes keystroke combinations used by Microsoft Word and WordStar.")

-[0;120;244p-[0;121;245p-[0;122;174p-[0;123;175p-[0;124;248p-[0;125;155p

That assigns keys ! thru ^. The pattern repeats with successive lines. Put $ at the end of the file. (Hidden text can be added following $.) ANSI.SYS must be loaded before the file will work; i.e., the line Device=C:\ANSI.SYS (then reboot) must be in the CONFIG.SYS file, referencing the appropriate directory.

OLAY4.COM provides these assignments, with Alt acting as the shift key:

Mark those characters on the front face of the keycaps. Send a formatted diskette & sufficient return postage to me (HBT) for a copy of OLAY4.COM. The file can serve as a template (i.e., it can be COPY'd, and the copy edited) to perform an entirely different set of key assignments in an OLAY5.COM file.

Some ANSI.SYS typewriter-key codes

Here is information needed to create your own keyboard-overlay file using the procedure given in "COM data files" above.

           Alt-Z  0;44    Alt-A  0;30    Alt-Q  0;16    Alt-!  0;120
           Alt-X  0;45    Alt-S  0;31    Alt-W  0;17    Alt-@  0;121
           Alt-C  0;46    Alt-D  0;32    Alt-E  0;18    Alt-#  0;122
           Alt-V  0;47    Alt-F  0;33    Alt-R  0;19    Alt-$  0;123
           Alt-B  0;48    Alt-G  0;34    Alt-T  0;20    Alt-%  0;124
           Alt-N  0;49    Alt-H  0;35    Alt-Y  0;21    Alt-^  0;125
           Alt-M  0;50    Alt-J  0;36    Alt-U  0;22    Alt-&  0;126
                          Alt-K  0;37    Alt-I  0;23    Alt-*  0;127
                          Alt-L  0;38    Alt-O  0;24    Alt-(  0;128
                                         Alt-P  0;25    Alt-)  0;129
                                                        Alt-_  0;130
                                                        Alt-=  0;131

This Smart BASIC miniprogram will display the extended ASCII characters along with their ASCII numbers:

Echo For i=0 to 127:j=4+i mod 20:k=9+8*(i\20):Locate j,k:u=i+128:?u chr$(u): next: Locate 23,1 |ok

Invoke it at the DOS prompt with Smart BASIC accessible. Make a printout using PrntScrn with your printer configured to print those characters.

Recall that Smart BASIC is simply GWBASIC.EXE renamed to OK.EXE.

Write for free book info from Echo Electronic Press/8401 E.Desert Steppes Dr. Tucson AZ USA 85710. Some titles:

Full-size books:
The PC Math Handbook: Using Smart BASIC;
Easy Calculating at a DOS Window;
DOS from a Different Angle: The Complete Handbook of Redirection and Piping;
Assembly Language Programming for Cowards;
Back to BASICs;
Faster than Light: A Historical Survey;
MATH POWER Vol. 1 & 2;


Handbooks, 50 pages or less:
Mathematics for Computer Programmers;
PC Typewriter: 21st Century Typing;
PC Calculator;
PC Grapher;
DOS_CAD;
DOS Redirection & Piping: Secrets Revealed;
DOS 7;
Narrative: A Primer on C-language Programming;

Mail Matters

Dear Homer - Thank you for your newsletter. I came late to this conversation so perhaps what I have to say has already been said. I think the word 'imaginary' to describe numbers that are not 'real' is misleading because all numbers are imaginary in the wider sense of that word. / When I studied math, I was so used to working in the complex field that I came to think of the reals as a restricted set of numbers rather than think of the complex numbers as an expanded one. But when I count my son's piggies I stick to the reals. I guess that's why we continue to call them 'real'. Nonetheless, I have been told that you can be killed by ki volts of electricity (where i is the square root of -1, and k is insufficiently small) and that's real enough for most people. / Yours / Jimmy Snyder [email protected]

Right on, Jimmy! ...HBT

Book review by HBT -

Title: Selected Papers on Three-Dimensional Displays

Editor: Stephen A. Benton; Series Editor: Brian J. Thampson
Publisher: SPIE Optical Engineering Press, 2001, ISBN 0-8194-3893
Where to write for copies: SPIE - The International Society for Optical Engg. P.O. Box 10, Bellingham, WA 98227-0010 USA;
Publisher web site: http://www.spie.org/bookstore
Physical: Hard covers; 8x11 inches; 431+xxv pages.
Contents: Preface; Introduction; Figure 1. The 3D "road map"; [text]; Biblio- graphy; Author Index; Subject Index

Contains many papers, including historic definitive ones from 1838, by Charles Wheatstone, Sir David Brewster, Oliver Wendell Holmes, James Clerk Maxwell. Most papers in English, one in German, four in French, two in Russian. Also contains patents, both US and foreign.

The book is subdivided into 12 sections:
1 Vision; 2 Stereoscopes; 3 Wavelength-Multiplexed Displays; 4 Time-Multi- plexed Displays; 5 Polarization-Multiplexed Displays; 6 Autosterescopy: Specular Displays; 7 Autostereoscopy: Parallax Stereograms; 8 Lenticular Displays; 9 Integral Photography; 10 "Slice-Stacking" Displays; 11 Holography; and 12 Holographic Stereograms.

I was made aware of the book because it contains my 1977 paper, "An autostereoscopic CRT display" in Section Seven, pp. 284-288.

How high is a delta pulse?

Remember the Dirac delta function, (x)? That rascal which is 0 everywhere except that (0)=? We were interested in seeing what relationship, if any, there is between the infinite magnitudes (0) and |1/(x=0)|=. (See Apr issue for explanation of notation.)

In the book WAVEFORMS a proof is presented in App. B that |1/x|(x) equals 2(x). That seemed to be a natural, desirable state of affairs, and certainly it was within the realm of possibility. The property of (x) that causes it to "pick out" the value of its multiplier at x=0 would mean that if

        |1/x|<img src="/maillists/images/delta12.gif" width="5" height="10">(x)=<img src="/maillists/images/delta12.gif" width="5" height="10">(x)<img src="/maillists/images/delta12.gif" width="5" height="10">(x)=<img src="/maillists/images/delta12.gif" width="5" height="10"><sup>2</sup>(x)                                (1)

then

        <img src="/maillists/images/omega12.gif" width="10" height="9"><img src="/maillists/images/delta12.gif" width="5" height="10">(x)=<img src="/maillists/images/delta12.gif" width="5" height="10"><sup>2</sup>(x)                                             (2)

and

        <img src="/maillists/images/omega12.gif" width="10" height="9"><img src="/maillists/images/delta12.gif" width="5" height="10">(0)=<img src="/maillists/images/delta12.gif" width="5" height="10"><sup>2</sup>(0).                                            (3)

That was 1986. It seemed for a while that the proof was a good one; but with the passage of time it's become clear that that was a forlorn hope. It appears that the amplitude of the delta pulse (its value at 0), while qualitatively infinite, is unrelated to ; and that the infinite numbers (0) and belong to "disjoint" sets, as a certain crowd is wont to say. But we would like (0) to be "joined with" if that can be done without contradiction.

Although (0) appears not to be naturally related to , we might minimally define it as being an infinity of the same order meaning it could be written (0)=k, where k is finite and positive, and see where that takes us.

One place it takes us is to (x)/|x|=2(x)/k and to the validity of eq. (2) & (3) as well, except for the factor k, and those can be handy relationships to have as they result in certain reductions in notation as indicated on p.140 of WAVEFORMS. However, we really must engage in more-probing analyses of the "joining" which are designed to expose potential anomalies.


Contrary numbers

The challenge is to solve the equation |7x+1/2|=-4. The answer given by the author was, as expected, that there is no solution. (That author being R. David Gustafson, Concepts of Intermediate Algebra, Brooks/Cole Publ., 1996, ISBN 0-534-33859-3, page 216. See the "Warning.") That is, there is no real, imaginary, complex, nor hysteretic number solution. In an earlier issue of MATH POWER (1995/WK35, Aug. 24th, Vol. 1, #1, p. 4) we toyed with equations of that type. Let's call such impossible number solutions contrary numbers since those equations use absolute value in a contrary sense.

Let (Greek letter mu) be the unit contrary number such that ||=-1. Write the equation to be solved |w|=-4 where w=7x+1/2. So w=4 and 7x+1/2=4, giving x= -1/14+4/7, and that is one answer. Is there another? Contrary numbers are real in the world where 4 is defined as -2. Certainly that world has just as much right to exist as one in which 4 is defined as 2.

So now it remains to catalog the properties of and to find some fantastic application for these contrary numbers! Do that, and you might become as renowned and important as Charles Steinmetz (1865-1923). Never heard of him? He's the dude who developed the complex number algebra of alternating-current circuits which every electrical engineer must know today.

Things the DOS experts missed

Over the years, DOS experts liked to point out how Microsoft missed some useful commands. Well, my friend, DOS is such a versatile platform that it is doubtful if anyone knows its full potential.

If your library has scads of books on DOS, try to find descriptions of the following in them just for the fun of it. Chances are you won't be able to. These are all things that have been described in past issues of MATH POWER and COMPUTER WRANGLER. They all work with DOS 3 thru 7; that includes Windows PCs.

Write us with your constructive comments regarding these techniques and others you would like to see that you can't find in your DOS books. Remember to use U.S. mail and address your letters to me, Homer. Thanks.


1. Calculating with BASIC without leaving DOS. Only GW-BASIC can do this in a portable platform. See MP for Aug '00, p. 2.

2. Showing Gregorian, Julian, other calendars for all time at the DOS prompt without a program. The command is the program. See MP for Nov '00.

3. Graphing with Smart BASIC without leaving DOS using simple batch files. See MP for Mar '01 and May '01.

4. An easy patch of COMMAND.COM to make COMMA.COM to normalize the operation of equal sign and comma, so DOS doesn't treat them as spaces. See MP for Mar '01, p. 5.

5. Assigning/reassigning an entire keyboard using a simple COM data file. See MP for May '02, p. 2.

6. A dozen "Obscure PC commands." See MP for Aug '00.

7. Using batch commands at the DOS prompt. See THE ECHO/COMPUTER WRANGLER for Jun '95, p. 1.

7. Multiline DOS commands that perform unique functions. See MP for Aug '00, p. 3.

8. Finding the DOS version number behind your Windows PC. (VER only returns the Windows version #.) See MP for Aug. '00, p. 3.

-- More, much more. --


Written reader comments are invited on all material. Those intended for my attention must be submitted by US Mail to my Tucson address. All such comments are subject to being published unless requested otherwise. They may also be subject to editing. ... Homer Tilton, Editor
The hard copy version of MATH POWER is published as a shareletter; that means you are permitted to make not-for-profit copies from it for distribution to your colleagues and students.

MATH POWER is published monthly. It is published and edited by Homer B. Tilton under the auspices of Pima Community College, East Campus, 8181 E. Irvington Rd. Tucson, AZ 85709-4000. All material is copyrighted by Homer B. Tilton unless otherwise noted. A limited number of copies may be made at educational institutions for internal use of faculty and students. For more extended copying or to request additional copies contact the Editor at the above address. Letters and editorial material are welcome. All submitted material may be published in MATH POWER, and edited, unless specifically requested otherwise.

 


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.