Wednesday, May 11, 2005

Multiple Input Multiple Output (MIMO) Digital Radio


Multi input multi output (MIMO) digital radio has been receiving publicity lately because of the introduction of MIMO wireless local area networks for PCs (802.11g standard). MIMO has long been used in applications such as cell phones and phased array radar.

There are several ways a transmitter or receiver can use multiple antennas to increase reception. One is called 'beam forming' in which the same signal is transmitted from several antennas, with the signal at each antenna being slightly out of phase with the others. This creates one or more directional signals or 'beams'. The transmitter may identify the locations of the receivers then dynamically change the phase to create beams in the direction of those receivers. You see this all the time on cars that have several antennas or in the arrangement of AM or FM broadcast towers. At the extreme are phased array radars which use hundreds of antennas to track multiple targets. Submarine sonar also uses this 'array' based approach. The receiver can also use multiple antennas to create 'beams' which are really just increased sensitivity in certain directions.

Another type of multiple input receiver is used in cell phones to change the liability of multi-path signal propagation (signals on the same frequency coming in from the transmitter and from reflections off buildings.) into an asset. The problem with multipath propagation is that the different signals take different amounts of time to reach the receiver, so they arrive out of phase with each other. In the extreme two signals arriving 180 degrees out of phase with each other completely cancel each other out. But a receiver can employ a 'rake receiver' to receive each signal separately and then add them in some optimal fashion to actually take advantage of multi-path propagation. First the receiver estimates the number of incoming signals and their delays. This can be done by computing the auto-correlation function of the signal and looking for the peaks in that function. Then the receiver sets up a different matched filter (i.e., correlation filter) for each signal. After reception these signals are recombined in an optimal manner. Alternatively, each antenna can transmit different information (on the same frequency but out of phase) in order to increase bandwidth.

Another method is to transmit one signal with horizontal polarization and the other with vertical polarization, thus doubling the bandwidth. I've heard Bell Labs has come up with a way to use three spatial polarizations.

Of course there are endless variations and combinations of these schemes. For instance, the transmitter may have multiple antennas to create more multi-paths and enhance reception. Or the transmitter may slowly vary the phase on the transmitting antennas with the idea that the receiver will get good signals at least most of the time. If you know more about this subject please let me know.

Monday, May 02, 2005

Stepper Motors: Precise Positioning without Feedback

stepper motor
Rotating Stepper Motor
linear stepper motor
Linear Stepper Motor

Stepper Motors have separate windings for each pole pair. By injecting current into the windings sequentially, the motor's rotor is forced to step from one pole to the next. Thus the sequence the windings are energized in determines the rotation of the motor, typically 1.5 to 60 degrees rotation per step. The advantage here is that when the motor is connected to a mechanical positioning system, the resulting position is determined by the sequence of winding activations. So the controller (microcomputer) which controls the winding energization knows the mechanism's position without any need for position feedback. This is ideal for low cost positioning systems and also for some speed control applications. For example, to move .05 inch the computer might go through a sequence of 50 winding energizations to rotate the motor 50 steps, corresponding to .05 inches. Digital control signals turn power transistors on and off to energize the windigs.

Common applications are for positioning paper in a printer, and for positioning a disk drive head. There are several kinds of stepper motors and many different schemes for arranging the poles and windings. Electronic drive circuits range from simple one transistor switches to sophisticated chopper drives.

Linear positioning can be accomplished by a linear stepper motor without the need for any gears or other mechanisms. Conceptually, a linear motor is a regular rotational motor cut open and laid flat. Instead of a rotating rotor, the linear motor has a "rotor" that moves back and forth in a straight line.

Excellent stepper motor tutorial
Linear stepper motors

Saturday, April 30, 2005

Update on Scilab (Free Matlab/Simulink Clone)

I am still working on Scilab (the Matlab clone) and it's associated block diagram GUI Scios (similar to Simulink). So far I have a working PI controller for a DC motor Laplace Transform I found on the web. Now I'm trying to learn more about how the program works. Scios (the block diagram GUI) essentially generates code which runs in the Scilab window. (I downloaded Scilab 3.1 and additional types of blocks appeared in Scios.)

I had a problem with Scios hanging up and I kept having to close Scilab and restart it. But what was happening was that the Scilab window was waiting for me to answer a prompt. So if Scios appears to hang, go to the Scilab window, scroll all the way to the left, and scroll up and down to see if it's prompting you. You might have to then select control --> resume once or twice. Anyway, it's reliable now.

Scilab is very powerful. About all it's lacking is some of the esoteric tool boxes available Matlab, such as fuzzy logic and neural network tool boxes. I'll try to post another update late tomorrow morning.

Friday, April 29, 2005

Free Matlab/Simulink Clone

I found a free Matlab/Simulink clone on the web called Scilab put out by researchers from INRIA and ENPC. It has an associated simulator with a graphical editor called Scicos. You paste in blocks that can be sources, processes, or sinks such as a graph output. The blocks can be time domain, Laplace transfer functions, Z transfer functions, state-space representations, etc. I was going to report on how well in works but it's taking me awhile to learn it. To try it out I am creating a model of a system consisting of a DC permanent magnet motor, drive electronics, PID controller, and a load. I plan to design the controller in continuous time then convert it to a difference equation using Scilab's bilinear transfer function. Then I will add a sample and hold block to convert the output to discrete form for input into the controller. For now I am using a plain gain block for the drive electronics but would like to convert that block to a model of a PWM motor drive. Also, I may add some friction and noise to the load block. I'll let you know how it comes out.

I think this will be a great tool for designing all kinds of things.

Thursday, April 28, 2005

Digital Signal Processing Chips

DSP chip
Digital filter diagram and corresponding discrete time difference equation
I have taken a lot of digital signal processing courses but never programmed a special purpose Digital Signal Processor chip, so I thought it would be interesting to look into them. DSP chips are microcomputers optimized to implement difference equations and FFTs used for digital (more correctly, 'discrete time') signal processing and digital control. (Link to short pieces on DSPs and DSP chip architecture.) Difference equations are the discrete time analog to continuous time differential equations. In the frequency domain diagram above the z to the minus 1 represents the delay between samples, or n-1 in the time domain equation below. You can go back and forth between discrete time and continuous time using various mathematical approximations, such as the bilinear transform. Most importantly, DSP chips perform add and multiply, and delay operations very quickly. One DSP chip may be powerful enough to perform several algorithms simultaneously. For example, it could filter and compress a voice signal, or it could control multiple DC motors using discrete time PID algorithms. You can easily implement the algorithms yourself or get the code already written, either free or by purchase. Texas Instruments DSPs start at $5. To understand the theory behind them you should take a course on Digital Signal Processing or an on-line tutorial.

I recommend MATLAB (and perhaps SimuLink also) for developing and testing your your own algorithms--MATLAB will automatically generate filters, then graph their response. (If I could have just one engineering software package, it would be MATLAB, which I have seen for as little as $50 on eBay.) Then you can use tools from the DSP vendor for the DSP chip implementation. It's really not that complicated.

Wednesday, April 27, 2005

Career Tip: Stay in School

I know some of my readers are students. For them I have this advice: stay in school. I know it is fashionable to scoff at academics and promote getting out into the real world and making money, but in the long and short run you are far better off to stay in school and get a Ph.D. if possible. Not only will you make more money, but you will have far more career choices and more prestige. If you do eventually go to work for a company you will start at a much higher rank and be able to go much further in your career. As a graduate student you can make enough money to support yourself by being a teaching or research assistant and working on grant projects. Grades won't be a problem since professors rarely give a grade of less than B in a graduate level course. It is not so easy to go back to school once you start working. Also, in school you get the summers off and there are a lot more girls around.

Design Margins and Derating

small design margin.

I had a professor for Power Electronics (he was also my advisor) who was very smart and had a lot of industry design experience. He told us to always use a design margin factor of 3 when selecting a voltage rating for a power semiconductor. I'm not sure if he meant this as a general rule for design. For example, if your maximum power supply is 30 volts, select a transistor that is rated for 90 volts. This is called "derating" to 33%. The 'rule of 3' may be a good rule of thumb in general.

Derating components puts less stress on them and increases their reliability. You want to derate a component for all its specification. Use a part rated for a higher temperature than the worst case temperature in the field.
Manufacturers often give recommended derating factors that go up by temperature as well as temperature derating factors. Follow these, or better yet, exceed them.

There are a number of ways you can increase the reliability of your digital logic. Use logic with slower rise times to mitigate signal integrity problems and decrease radiated emissions. Use ground and power planes on your boards. Use decoupling capacitors near your ICs--a big one for low frequency response and a small capacitor for high frequency response. Do signal integrity analysis (SPICE or Hyperlynx) and check your boards in the lab. The maximum clock speed is determined by adding worst case logic propagation delay to the flip-flop set-up and hold times. Then slow your clock down farther for more margin. Be careful about clock skew: make all your clock traces the same length and use purpose built clock driver and distribution ICs.

Good practice is to always 'worst case' your designs then add on a lot more margin. A different approach that is sometimes (but rarely in my opinion) appropriate is to use statistical analysis such as Monte Carlo simulation. Recall, Monte Carlo is a famous gambling casino. You set up all your parameters to vary randomly, then do perhaps a thousand simulations. Then you arbitrarily choose to accept a design point where only 3 in a thousand simulations show a failure. Monte Carlo analysis may be appropriate for chip design because every chip is tested before it is shipped, but you wouldn't want 3 in a thousand field failures.

Once you have built your hardware somebody needs to test it (Testing is a huge part of electrical engineering). Some tests include shock and vibration testing and stress testing. In stress testing you stress the design (temperature variation, voltage variation, etc.) far beyond what it will experience in the field. This brings out the failure modes which can then be corrected.

The most important thing is that your design work and work reliably. Large design margins may slow the design a little and cost a little more. But a reputation for reliability is crucial to any company, and the design margins are usually invisible to the customer (except they notice it doesn't break). There are exceptions, such as perhaps a microprocessor which is advertised partly on its clock speed. I say the quick and sure way is to use the rule of three.

Tuesday, April 26, 2005

LTspice Problem with Model Libraries Solved

I couldn't get my model libraries to load by pasting ".include hexfet.txt" to the schematic--I kept getting "unable to open file" messages. So I posted a message to the LTspice users group at Yahoo. Panama answered that I need to set my file extensions to always visible in Windows Explorer. I did this, spotted the mismatched file extensions between my .include statement and the actual file names. Now I have no problems running the models from libraries I add; I no longer need to past the model onto the schematic.

Also, no need to draw a new symbol for the hexfet. Select the add symbol icon and choose nmos and place it. Then control right click on the nmos symbol and edit the attributes: Make the prefix name X for subcircuit, InstName U1, and SpiceModel irf7805.

The LTspice users group is going to be invaluable. I got an immediate answer. It's about time for me to post on something other than LTspice though.

groups.yahoo.com/group/LTspice

Adding Models to LTspice -- The 7805

circuit used to test hexFETIdrain versus Vgate (Idrain accidently inverted)

You can add models to LTspice, but it takes some effort to learn how. Most manufacturers have Spice models at their web sites, or you can go to one of many other sites that have models or index to Spice models (see below). You are supposed to be able to add the models to the LIB file, but I haven't succeeded in this yet.

A reader commented that he needed a model for the 7805. With a lot of looking I found a model for the LM7805 linear 3 terminal voltage regulator. This was hard to find since it is an old part and most people don't bother to model linear voltage regulators. They just use an ideal voltage source.

Then I found a site that attempts to index to all Spice models on the web. I found the irf7805 Spice model through this site. The model is on the International Rectifier web site. The device is a power hexFET N channel MOSFET. This device is used for switching in power circuits. This must be the device the reader was looking for since it makes sense to model a switching device.

After a lot of effort I finally succeeded in running simulations with the hexFET. I first had to make a new symbol for the device. This is pretty easy to do. Just select the file menu, and the Create New Symbol. I drew a simple symbol (I used a different than the one you usually see.) consisting of several lines. After drawing the lines you select edit, pins, and add the drain, gate, and source pins. The "schematic pin order" must correspond to the order of the pin list in your Spice model. Finally, select edit, attributes, and enter X for prefix (X is used for .subckt models) and enter irf7805 for SpiceModel. Then save the new symbol in lib\sym as file name "hexfet".

Next create a schematic for testing the model. Select the add component icon and then select "hexfet". Now all you need to do is give LTspice access to the irf7805 spice model. So far the only way I've been able to do that is by putting the model text on the schematic. Select edit, Spice directive, and paste the model into the box. That's it, now you can run simulations.

The irf7805 is an amazing device; it is so good that for most modeling purposes you could use an ideal switch instead of the irf7805 Spice model. The device is so close to perfect that it is hard to verify that the model is working. I did a DC sweep of the gate voltage and saw that the device starts to turn on at 1.9 volts, which agrees with the "VTO=1.84206" statement in the mode. Also my simulation showed a 30uA leakage current from drain to source which agrees with the 50uA max leakage on the spec sheet. The hexFET switches on almost instantly and has about a 30 nsec turnoff time. The term "hexFET" comes from the silicon geometry of the device. I believe that a grid of hexagonal silicon regions with metal conductors between the hexagons is used to minimize the resistance drop in the silicon.

The top diagram shows the circuit used to test the irf7805 hexFET Spice model. The plot is from a DC sweep showing the current through the HexFET as a function of the Gate voltage. (I accidently made the current negative.) Note that the device starts to turn on at about 1.9 volts.

It took a lot of time to figure this stuff out, which is probably why no other electrical engineers have this type of blog.

link to International Rectifier irf7805 Spice model
A site that attempts to index to all Spice models on the web

Sunday, April 24, 2005

Career Tip: Attend a Seminar

Attending an industry meeting or a seminar can give your career a small boost while providing you a short vacation from the office. It is surprising how much useful stuff you can learn in a day when the presentor is knowledgable. Find a gap in your knowledge and a workshop to address it, then ask your manager if he will pay for it. This shows that you are proactive in developing your technical skills and will add to your resume. I took a two week course on Cadence Spectraquest, a Signal Integrity simulation tool, and it made me eligible for several job openings. (See previous post: Signal Integrity Basics.)

Saturday, April 23, 2005

More on Free Spice Circuit Simulators

Schematic entry for SPICE simulation

I have been spending a lot of time looking into more free Spice versions with associated schematic editors and waveform viewers. My conclusion is that I was right when I previously recommended the free spice from Linear Technology (LTSpice/SwitcherCad III). The more I use it the more I realize how powerful it is. First of all, it isn't a demo version like the other Spice versions, so it has no built in limitations. I discovered that it is based on a full featured Spice. The GUI doesn't have all the commands in it, but additional commands can be accessed by pasting a dot command (e.g., .step) onto the schematic. Using this I did temperature and parameter sweeps. Assessing distortion of a sine wave is accomplished by using the built in FFT. The waveform viewer is really excellent. Hierarchical designs are supported. Apparently many companies actually use Linear's spice for their analysis. By the way, you can do board signal integrity checking by using the built in transmission line model. Now a look at the Spice demo versions I downloaded.

Downloading Orcad's demo version of its integrated board development system took about 4 hours for 760 MBytes. This includes schematic capture, Spice, board layout, and auto-router. But the demo version is too limited for anything but extremely simple circuits. If you do board design for a living, you might want to consider spending $13,500 for the regular version. On the up side, you can learn the Orcad tools and put that on your resume--Orcad is an industry standard.

5Spice turned out to be a very powerful simulator with excellent GUI and schematic entry, but the schematic page size limits it to very small circuits. Therefore the demo Version of 5Spice is mainly recommended for learning. It does have a lot of features. However, it's waveform viewer is not nearly as good as LT's viewer. Overall, this is an excellent choice if you can fork out the $200 for the registered version.

TopSPICE is another excellent SPICE, and this one actually includes Monte Carlo analysis. The Demo version supports up to 64 nodes so it can be used for moderate sized circuits.

These are four of many Spice versions available on the Internet. Linear Technology's Spice is the only one with no circuit size limitations and comes with a first class waveform viewer. If you do any circuit design, you absolutely must have Spice.

Thursday, April 21, 2005

The Blog Format Versus the Web Page Format

deep thinker

I have been thinking about eventually switching from the blog format to a regular web page. The blog format is sequential and chronological--the past postings are relegated to relative obscurity. Blogs are best suited to diaries or to information that is relevant to the moment. Most of my postings are, hopefully, of somewhat lasting value. I try to write about things that are useful and informative, not just of passing interest. There are already thousands of excellent web pages and blogs covering breaking technology news and I do not want to compete with them. Also, the blog services make it easy to get started but restrict your presentation and formatting options. A web page could present all the postings much as a magazine cover does, and let the reader pick what he wants to read. I could attach a personal blog to the web page.

Actually, I think the Web has inflicted information overload on us since it emphasizes the moment so much instead underlying truths and principles. We should all (including me) be reading more books and talking to more people face to face.

I am researching a number of topics for future postings, including;


  • Free Spice that allows analysis for production quality design with features like monte carlo simulation, temperature variation, and parameter sweeps. Though I do still recommend the free Spice from Linear Technology.
  • Free integrated design environments (if they exist), that integrate spice, schematic capture, board layout, and the whole design process.
  • Discussion of Orthogonal Frequency Division Multiplexing (OFDM), since it's all the rage now.
  • What it takes to build WIMAX hardware.

Wednesday, April 20, 2005

Signal Integrity Basics

Signal integrity problem, signal with severe ringingDigital signals with short rise times and long trace lengths will be distorted and often cause board failures. For instance, backplanes have high speed signals and long traces so care must be taken to obtain good signal integrity. The principles of signal integrity are well understood and documented. Common solutions for signal integrity problems include series termination (placing a resistor between a signal's driver and the rest of the trace), and end termination (placing a resistor between a signal's destination point and ground). Signal integrity problems can also be caused by ground bounce, trace to trace inductive coupling, and many other things.

I found a workshop given by Dr. Howard Johnson, noted signal integrity
guru, to be packed with useful information. Dr. Johnson' book High-Speed Digital Design is the bible of signal integrity and is a must read for all board designers. You can also get DVD lectures, a free newsletter, and archived articles from Dr. Johnson's web site.

When you study digital design the nets connecting components are usually presented as simple point connections. Actually, the nets are always transmission lines with distributed inductance and capacitance. A signal propagates down the transmission line as a wave which can reflect off the receiving component or the driving component. These reflections can cause the receiver to see multiple logic transitions instead of a single rising edge or falling edge. Problems also usually occur when a component drives multiple receiving components at different locations on the board (because impedance discontinuities arise). For this reason buses should be routed according to an established standard or be carefully analyzed.

The surest way to engineer around reflections is to use a Signal Integrity Simulator, such as Hyperlynx (see previous post). You model the driver, receivers, and trace, and run a simulation to see what the waveform will look like. Then you can try fixes (termination or routing changes) to find a solution to any problems. Signal integrity is a science, not a black art, and it is worth investing a little time and money to avoid pitfalls.

Tuesday, April 19, 2005

New Links and Personal Stuff

I've added a couple of good links to this blog. Richard Giles blogs Richard Giles blogs from Perth Australia about technology, personal stuff, and the west Australia blogging scene. He also runs a couple of web businesses. Maury Wright blogs at On The Verge for EDN magazine about news in the electronics industry. He is an engineer and professional journalist and it shows in the quality of his posts. But his blog is a little obscure, not showing up on my Google searches.

On the personal side, this blog has finally made the search engines, so I'm hoping for an increase in popularity. Yesterday I bought a new fishing rod and reel and went fishing at Rogers Lake in Dakota County. I didn't expect to catch anything so I was shocked when I caught a good sized large mouth bass (15"? Didn't have a ruler), using corn for bait. It was by far the biggest fish I saw anybody there catch. I also caught a couple of sunfish. The Minnesota Twins baseball team is doing pretty well at 8 and 5. They have a young team with a couple of rookies playing, notably Joe Mauer at catcher who is only 21. But I haven't watched a game on TV for several days.

Monday, April 18, 2005

Threads for Programming Multiprocessor Computers ("multithreading")

multithreadingThe introduction by Intel and AMD of microprocessor chips for PCs (as well as publicity about parallel supercomputers) is drawing attention to the programming concept of multithreading. In a multithreaded program blocks of code called threads run concurrently , thus allowing multiple tasks to be performed at the same time. On a multiprocessor computer each thread can be assigned to a different processor so that the threads truly run simultaneously. But on a single processor computer (e.g., today's PCs) the execution is time sliced so that one thread runs briefly, then the next thread, and so on. This simulates concurrency, but the threads are not really running simultaneously. When 'multicore' PC microprocessors find their way into PCs the threads will actually run concurrently on different processors which will greatly speed program execution.

Object oriented languages like Java and C++ (see previous post) contain definitions of 'classes', each of which is then used to implement multiple objects. Each class defines its own small set of variables and subroutines (these subroutines are termed "methods") which are designed to carry out a set well defined operations. For example, a class might define 52 variables to represent a deck of cards and two subroutines, one subroutine to shuffle the cards and another subroutine to deal the cards. Each time the class is implemented you create a new deck of cards. So for blackjack you could have five decks of cards. A class may be extended by including another class within it. This is how threads are created.

To create a thread in C++ or Java you first define a new class (let's say, the "blinking light class") that includes the predefined THREAD class. Then you could implement five "blinking light objects" from this class. When you ran the program all five lights would blink at the same time because all five threads are executing simultaneously. One common application of threads is in GUI interfaces where a thread is dedicated to watching the graphics input screen. Another application is in simulation programs where multiple calculations are carried out at the same time on separate parts of the thing being simulated.

Multi-tasking PC operating systems use time slicing to run several programs thereby appearing to run the programs simultaneously. A multicore PC chip could actually run different programs on different processors simultaneously. Multithreading brings concurrent operation to a single program. Different threads within the same program run simultaneously.


multithreading some more info

Large Private Sector Job Loss in the U.S.

Paul Craig Roberts writes in the Washington Times that the U.S. has lost 760,000 jobs in the private sector since January, 2001. Offsetting this has been the increase in public sector jobs which results in a small net increase. But overall, the US is still 8 million jobs short of where it should be.

The jobs lost have been the higher paying jobs in technology (Engineering and programming) and manufacturing, while the jobs created have been in lower paying services. Outsourcing and H1-B Visas are partly to blame. Roberts was educated at the Georgia Institute of Technology (B.S.), the University of Virginia (Ph.D.), the University of California at Berkeley and Oxford University.

Sunday, April 17, 2005

Control Theory and Paris Hilton

control theory diagram.
Control Theory is the branch of Electrical Engineering that deals with the mathematical theory behind things like motor speed and position control, autopilots, spacecraft attitude control, and so on. Not every controller relies on this theory, some controllers are ad hock. The best known control algorithm is the PID (proportional, integral, derivative) controller. This is a linear controller in which a fraction the output (e.g., motor speed), the time integral of the output, and the time derivative of the output are added to the command input (e.g., desired motor speed, Ref in the diagram above) to produce the control signal (e.g., the signal to the motor drive electronics, also known as the error signal, e in the diagram above). In the diagram G(s) would represent the power electronics and motor. Y(s) would be the output speed of the motor. H(s) would be the circuitry to take the time derivative and integral of the speed.

The PID is often implemented in the continuous time domain using operational amplifiers. Alternatively, PID control can be first designed in continuous time, then translated to discrete time using an approximating mathematical conversion, to be implemented digitally. Variations on the PID include the PI controller and the addition of feed forward to improve step response. Classical single input, single ouput, linear controllers dominated until the 60s.

Modern linear control theory extends classical control to multi-input multi-ouput linear systems and employs linear algebra and matrix calculus. For example, a steel rolling mill may need to use inputs like the input steel thickness and width, temperature,and roller speed and pressure to produce sheet steel of a certain output thickness and width. The many branches of control theory include discrete time control systems, non-linear control, optimal control (minimum input, or minimum time, or minimum output error, etc.), and stochastic control theory, as well as branches relating to specific applications like motor control and dynamic control. By the way, I wonder if mentioning Paris Hilton will increase my search engine hits?

Linear Control System Analysis and Design: Conventional and Modern recommended text book

Optimal Control Theory: An Introduction textbook

very basic tutorial

Saturday, April 16, 2005

600 GHz transistor

bipolar transistor
How fast is this? Physicists at University of Illinois at Urbana-Champaign have developed a transistor that runs at 600 GHz. What will we do with this when it gets into our PCs?

600 GHz transistor forum

Learning C++ and/or Java


Java and C++ are two popular object oriented computer languages which are very similar. Once you learn one, it will be fairly easy to learn the other. Java is more of a programmer's language used on the web, while C++ is more of an applications language and Electrical Engineer's language. The Java language and an associated development environment is available for free on the web from Sun Microsystems. C++ is a compiled language, and according generally runs faster than Java. On the otherhand, Java is a highly portable language because its source code is compiled into an intermediate code called a byte code. Each different type of computer (PC, Macintosh, UNIX, etc.) has a specific byte code interpreter to run the byte code. Thus the Java byte code can run on many platforms with little or no code alteration. If you are an engineer you should learn C++; if you are a web programmer you need to know Java.

Object oriented languages are very powerful, especially for large programs, because they enable you to reuse code and compartmentalize your programming. Once you learn an object oriented language you will realize that non-object oriented languages are obsolete for projects of any complexity. Actually, for applications programming (i.e., programs to be run on a PC or general purpose computer) C++ is being replaced by languages such as C# ("C sharp") which include support for networks, automatic garbage (i.e. unused memory) cleanup, etc. But learning C++ is a step to learning C# and the .net environment languages.

I went to Half Priced Books (as usual) and got books on Java, C, and C++ for about $7 each. I also took a web tutorial on Java. I find books easier to devour since you can lay on your back on the couch while reading. Also, it's easier to page back and forth in a book then to change web pages. One gets tired of sitting upright and staring at a computer screen. I found object oriented languages to be a fascinating subject.

Both C++ and Java come with huge built in libraries that include algorithms such as tree and vector storage, so you won't have to reinvent the wheel.

Friday, April 15, 2005


Discrete time fourier transform graph. Posted by Hello

On Digital Signal Processing

Digital Signal Processing (DSP) means different things according to who one talks to. I talked to a manager of jet engine testing to whom DSP simply meant attaching sensors to the engine under test and feeding the signals to computers for analysis. On the other extreme, to a professor in DSP it can mean estimation theory using advanced math such as stochastic calculus, probability theory, and matrix calculus. Some think of embedded programming as being DSP, but it need not involve any of the DSP math.

An excellent text book on DSP is Discrete-Time Signal Processing by Alan V. Oppenheim. This covers the theory of DSP including such topics as the relationship between discrete time (or space) math used in DSP to the continuous time which is often found in the real world, (Discrete and continuous math are different, but analogous in many ways.), sampling theory, digital filtering, etc.

Digital control theory often requires sampling a continuous process (such as position or motor speed) and implementing the algorithm digitally. There are techniques for converting a continuous time algorithm (e.g., PID) to the discrete time domain for microprocessor code. A comprehensive book dealing with this and both classical (World War II) and modern (multi-input, multi-output) control theory is Linear Control System Analysis and Design: Conventional and Modern. These two text books are best used as a reference, since it takes months oryears to learn them.

DSP is a vast field which probably nobody can completely master. For working engineers the best strategy is to zero in on what it is you need to know, then find how-to books or articles on that specifically. For example, if you are doing motor control look for information specifically on motor control and use the text books as reference only. You can quickly design and implement DSP algorithms using MATLAB and its Signal Processing Toolbox (see previous MATLAB post). I will be discussing DSP and Control Theory more in the future.

Thursday, April 14, 2005


Your future's so bright you have to wear sunglasses. Posted by Hello

Career Tip: Resume Software

Resume writing software is a real bargain considering what you get. Don't waste your money having somebody else write your resume, they'll just use the same software you can buy but charge much more. You can do at least as good a job yourself using your own software. I bought a copy of Resume Maker software at Half Priced Books for $10. Or you can look for it on ebay. It guides you step by step and offers many tools to assist you such as a thesaurus, a phrase selector, advice, and sample resumes. All formatting headaches are eliminated since you enter just simple text. It formats your resume perfectly, then you can change to one of 30 different resume styles at the click of a button. The resume can be outputted to MS Word for mailing or e-mail. Making different versions of your resume is a snap. You'll kick yourself for not buying resume software sooner.

Wednesday, April 13, 2005


Xilinx FPGA Posted by Hello

Programmable Logic Devices are Awesomely Powerful

If you are like me you probably are not up to date on the capabilities of today's programmable logic devices (PLDs). One type of chip is the FPLA or field programmable gate array which can quickly be programmed in your lab. They come in sizes from thousands of logic gates to millions and the number of I/O pins varies also, up to many hundreds of I/O. These I/O can be of almost any type from high speed low voltage differential, serial I/O, I/O compatible with specific bus types (DDR RAM bus, PCI bus, flash buses, etc), and on and on. These chips can be bought for $2 or less. Here is a small sample of some of the macros available as parts of FPGAs:

  • individual logic gates
  • shift registers
  • counters
  • multi-bit multipliers
  • RAM blocks
  • ROM blocks
  • microprocessors
  • clock generating and distributing logic
  • multiplexers
  • PCI bus interfaces

    With one of these chips you can build a whole system including processor or programmable DSP components and external intefaces. Also, with the available software development environments you can simulate and debug your hardware using your desk top computer. The possibilities are mind boggling.

  • Xilinx FPGAs


  • Altera FPGAs
  • Tuesday, April 12, 2005

    Free Microsoft Visual Basic

    You may already have a Visual Basic on your computer since Microsoft Office comes with it. If you want to use Visual Basic but are too cheap to pay for it, then do this. Open Excel, go to tools, go to macro, then open the Visual Basic Editor. The reason VB is included is that Office was written in Visual Basic. Including VB with Office gives the user power to write his own VB routines for custom Office applications.
    I used this VB to manipulate and compare net lists. I imported text netlists to Excel, then wrote VB routines to check the netlist. You can include Excel commands within your VB program, for example, SORT. At first this VB might be intimidating because of all the objects that are part of the Excel code. That is, you will see objects which represent Excel workpages, Excel individual cells, and ad infinitum. However, you don't have to use these: you can use this VB like a stand alone VB. Note that VB is object oriented, so if you want to manipulate an Excel spreadsheet you will have to learn a little bit about object oriented programming as you go. Or you could ignore the object oriented features of the language and write old fashioned non-object oriented Basic code.
    Actually, I recommend using a language you already know (like C) unless you want to or have a need to learn VB. After all, C has become the predominant language used in Electrical Engineering. But if you do want to learn VB and are too stingy to buy a VB program, you can use the VB that comes with MS Office.

    Career Tip: Masters Degree

    I earned my MSEE degree while working full time for a large company that paid my tuition and let me attend classes during working hours. All went well while I was taking classes, but then I hit a wall. The master's program required that I write a thesis and I found that difficult while working. I finally got my degree after over 10 years. The Dean had to make a time limit exception for me and I was told that I set the record for how long it took to get a masters.
    The moral of this story is think twice before going to work and entering a Master's degree program requiring a thesis while working. My advice is either stay in school for an additional year and get the masters degree out of the way before going to work, or be sure that the program you are entering doesn't require a thesis. If you are just finishing your undergraduate work then you are used to the academic work and can knock off the masters easily. It's harder when you are no longer used to academic work. Well, I don't expect you to listen to me, but take it for what it's worth.

    Monday, April 11, 2005

    Free SPICE for Analog Design

    An excellent free SPICE program for simulating analog circuits comes from Linear Technology. It can be quickly downloaded for free from the web. I have used it for simulating a couple of amplifier circuits I got on the net and found it to be of very high quality. The program includes a schematic editor for entering your design. After entering the design you simulate it directly from the schematic. The program comes with a library of models for things such as resistors, diodes, inductors, capacitors, transistors, op amps, and so on. It does several kinds of analysis including transient, AC, DC operating point, etc.
    The program is designed to quickly simulate the company's switching DC to DC converters, but it is excellent for all kinds of simulations. The AC analysis (frequency response) runs instantly, no waiting. The program is very fast and intuitive--there is no learning curve. And you can do almost everything by point and click. It comes with an excellent waveform viewer. Get this and get into analog design!

    Upper Limit to Digital Transmission Speed

    I have heard people debate what the maximum bit rate limit is for a digital transmission, often without realizing that a famous guy named Claude Shannon answered the question with his Shannon's Law. Claude Shannon (who died in 2001) was a genuis from MIT who founded the field of Communication Theory and discovered that boolean algebra could be used for computer design, among many other accomplishments (e.g., he was an expert juggler).
    Shannon's law states that the maximum possible bit rate of data transmission is given by

    C = W * log2(1 + S/N )

    where
    C = maximum bits/sec
    W = bandwith in hertz
    S/N = signal to noise ratio
    log2 is the log to the base 2.

    Maximizing the bit transmission rate (C) requires extensive signal processing such as error correcting codes. Even so, one cannot hope to get near this upper limit. Modern digital communication systems (such as cell phones) employ many tricks, such as dynamically adjusting the transmitter power (C) about 100 times per second, using error codes and data interleaving, and data compression (vocoders) to name a few.
    Note from the equation that one can increase the data rate if one increases the band with W. This is called broadband or spread spectrum transmission. The signal to noise S/N can be maximized with a directional antenna amoung other means. For instance, if a cell phone experiences a weak signal S or a high noise level N (e.g. reflections from a building or because the caller is moving) the cell phone system will increase the radio transmitting power.

    Sunday, April 10, 2005

    Signal Integrity Analysis with Hyperlynx: The Way to Go for Boards

    The Hyperlynx program from Mentor Graphics takes the worry out of high speed board layout and can be learned in about an hour. You don't need a dedicated Signal Integrity Engineer because this program is so easy to learn and quick to use that the board designer can do it himself in no time. For example, if you have a fast signal with one driver but multiple destinations you can have serious signal contamination and even board failure. Instead of worrying about this until the board comes back from fab you can quickly model the net to try several different topologies until you get it right. This is before or during layout. The program will even suggest a solution. After the layout is done you can load the layout into Hyperlynx to find out if there are any signal integrity problems. For awhile I was in charge of design validation for a computer company. I bought HyperLynx and learned it in an hour. Since it was so easy to use I had the board designers use it themselves to analyze their layouts, before fab. When I had a question, Kelly, the founder of HyperLynx, would pick up the phone and help me out. He was even open to my suggestions. I see that since then the program has been sold to Mentor Graphics, but from the web site it looks pretty much the same. But they have added additional capability such as GHz signals, signal interference analysis, and skin effect and dielectric loss analysis. Later I was Signal Integrity Engineer at a telecom company. There I took a week long course on Cadence's signal integrity program, SpectraQuest. Even so it still took me months to get good with the program and I'm sure it's vastly more expensive than Hyperlynx. Though I must say, SpectraQuest really correlated well with lab measurements. To use Hyperlynx you have to have a good model of the driver on the net and a crude model of the receivers. But this is a snap since the semiconductor manufacturers provide these. You just go to their web sites and download them. But most of your models are included when you buy the program. Then, for pre-layout analysis, you enter the net topologies (how long the wires are and where they go) along with the trace impedances. You get an oscilloscope type graph of how the signal will look on the actual board. You can also run the whole board in a batch and the program will flag any potential problems. It sure beats guessing then spending a month agonizing over whether your board will work.

    Career Tip: Volunteer

    I once volunteered to do some board designs in addition to my regular work. I had never done a board design before, but figured I could. In addition to getting extra credit with my boss, a couple of years later I got a new job based on this experience. So look around for skills that are in demand, then volunteer to do some extra work in this area. Where I live jobs for hardware engineers are far and few between. Also, the skill sets demanded for the few openings are very specific and demanding. This is probably due partly to the moving of electronic manufacturing and design to China. However, in my area there are numerous advertisements for embedded programmers and they aren't nearly so picky. Based on this, I would suggest you volunteer to do some embedded work on the side (embedded hardware is hot too). After all, it's programming and you already know how to do that. You'll have to learn a few additional things, like real time embedded operating systems, maybe threading, and so on. But it's a great career investment