Using Companion Models for Time-Domain Simulation of ODE’s

Companion models can be used to quickly formulate the solution of simultaneous ordinary differential equations like those associated with analog circuitry. This approach is particularly helpful when this capability must be embedded in tools like MATLAB / SIMULINK / C++. The PDF file is located by following this link.

Digital Signal Processing, Mathematics, Software and Programming Leave a comment

CNC Router & Interview Questions

I have just added two new sections, one for my CNC Router related projects and a second one for interview related questions. Both are works in progress.

Uncategorized Leave a comment

Book chapter added on Direct Digital Synthesis

Extensive chapter added about Direct Digital Synthesis.

Digital Signal Processing, Frequency Synthesis Leave a comment

Updated Filter Design Documentation

Major revision to my filter design documentation 5.74 MB

Mathematics, RF Filter Design, Software and Programming Leave a comment

New Programming Projects 26Dec2012

Two new software/programming projects added. One for the design of lumped-element lowpass Butterworth, Chebyshev, and elliptic filters. The second for the design of resistive pi- and tee-pad resistive attenuators. Look at the bottom of the Projects page.

Software and Programming Leave a comment

New Book Chapter

I just posted a free book chapter on the site for anyone who has subscribed. The chapter is about 80 pages long and goes into a wide range of topics related to direct digital frequency synthesis (DDS). Definitely worth a read or a place in your reference material as this is not the same DDS perspective of years gone by.

The chapter is posted under the “More Articles” tab as the first article under the “Frequency Synthesis” category.

Digital Signal Processing, Frequency Synthesis Leave a comment

New Article in Microwaves and RF Out

My article in Microwaves & RF finally hit. The web version has a lot of typos in it, however, so you will probably find the PDF version a lot easier read. Follow this link and you’ll see the file link. Thanks for your interest.

Phase-Locked Loops (PLL), Uncategorized Leave a comment

New Article in May Microwaves & RF

I have a feature design article that is to be published in the May issue of Microwaves & RF. After it runs, I will post a copy of the complete article in PDF format for easier reading. The article presents several nonconventional methods that can help with demanding PLL designs.

Phase-Locked Loops (PLL), RF and Microwave Design Leave a comment

Approximation for RMS

Approximation for SQRT( I2 + Q2 ) with Gaussian Noise Present

When a complex signal is represented in terms of in-phase (I) and quadrature-phase (Q) components, a commonly used approximation for the signal root-mean-square (RMS) value is

Assuming a large number of OFDM subcarriers in the intended application, I and Q appear to both be Gaussian thereby making r a Rayleigh-distributed random variable where

We are interested in the ratio

From symmetry, it suffices to consider a limited range for θ as π/4 . Letting

leads to


where γ = 0.375. It is worthwhile evaluating just how good this choice for γ really is. We seek then to minimize the mean-square error given by

To read the article in its entirety in PDF format, please follow this link.

Digital Signal Processing, Mathematics Leave a comment

Computing Data Windows Recursively

Data windows are indispensable for computing the spectral characteristics of signal waveforms that are not periodic in time. In the context of hardware-based digital signal processing, most if not all data windows are expressed in terms of fairly complex function that are not convenient for embedding in a FPGA or custom ASIC. This memo presents several simple recursive results that can be used to compute these windows without excessive memory requirements and computationally intensive functions. The techniques described here can also be extended to other windowing functions as well.

This paper is offered for sale here.

Digital Signal Processing, Mathematics, Uncategorized Leave a comment


Uncategorized Leave a comment

Dreaded Interview Questions Just for Fun- Part I

James A Crawford

Having reached a sufficient station in life that I have either heard most of the typical interview questions that might come my own direction, or have the wit and nonsense to navigate my way through something that I don’t know and talk about the weather or something completely unrelated, this on-going collection of (technical) interview questions is intended just for fun. I encourage any readers to forward me their own most favorite technical questions at Don’t get up-tight though, after all, this is just for fun.

Question #1:

What is the equivalent of jj ?

This is very straight-forward to solve if we first write the base j value as j = exp( j π/2 ) based on Euler’s formula. Given that substitution, then

Dreaded Interview Questions Equ 1

Question #1B: Corollary to #1

What is the equivalent form of

Dreaded Interview Questions Equ 2

This is the same as Question #1 except it has been re-cast in a slightly different form. The progression from this form back to Question #1 is given by

Dreaded Interview Questions Equ 3

Question #2: In honor of Al Thiele

Solve for (x,y) in the set of real pairs with xy given xy = yx

From this starting point, clearly

Dreaded Interview Questions Equ 4


Dreaded Interview Questions Equ 5

In order to have a solution with xy, the quantity z = x / ln( x ) must be multi-valued along the real line. A rough sketch of the solution space can be found by collecting a bit more information.

Specifically, the slope dz/dx must approach infinity as x+ nears unity because the log function in the denominator will blow up. Similarly, a second derivative computation shows that the slope dz/dx with large x becomes

Dreaded Interview Questions Equ 6

It is also easy to show from this last equation that dz/dx= 0 for x= e.

Moving on to a complete solution to the problem, we can write

Dreaded Interview Questions Equ 7

where c is an auxiliary variable. Solving this equation leads to

Dreaded Interview Questions Equ 8

and substitution of this result back into y/x= c leads to

Dreaded Interview Questions Equ 9

From this result, it is easy to further conclude that

Dreaded Interview Questions Equ 10

The lesson here is to use simple graphical techniques to identify the behavior of a solution when possible. A picture is worth a thousand words.

Dreaded Interview Questions Fig 1 Dreaded Interview Questions Fig 2

The first part of these dreaded interview questions contains a total of 31 thought-provoking questions. To read further, just follow this link…

Frequency Synthesis, Mathematics, Phase-Locked Loops (PLL), RF Filter Design, RF System Design Leave a comment

Digital Re-Design of Analog Phase-Locked Loops


The need frequently arises to design a discrete-time digital signal processing (DSP) algorithm that closely mimics a conventional continuous-time phase-locked loop (CTPLL). Similarly, it is often desirable to talk about the DSP implementation in terms of traditional quantities like damping factor and equivalent noise bandwidth. This memorandum examines this interplay between discrete and continuous time systems in the context of the classical continuous time type-2 PLL. It also provides a plethora of detailed design formulas for implementing CTPLL designs with finite-difference equations for digital implementation.

For readers who prefer to skip the exhaustive material and jump right to the preferred re-design method, go to Section 7 which envelops the bilinear transform method for redesign directly.


2 April 2005


J.A. Crawford

Ref. No.


Introduction to Digital Re-Design of Analog Phase-Locked Loops

Discrete-time and continuous-time phase-locked loop (DTPLL and CTPLL) implementations are fundamentally different. The behavioral differences between these different systems becomes almost indistinguishable however, as the over-sampling rate (OSR) in the digital signal processing (DSP) is increased. The ratio of sampling rate to the PLL closed-loop unity-gain frequency will be defined in this memorandum as [1]

Analog Redesign of PLLs- Equ 1

in which Fs is the sampling rate in Hz, and ωn is the PLL’s natural frequency in radians/s. Although this definition was not formally presented in [1], it is a very convenient definition because closed-loop unity gain frequency is precisely given by the denominator in (1) for the type-2 CTPLL, and this relationship is independent of the damping factor ζ. For a second-order, type-2 CTPLL, the damping factor and phase margin are closely related
by the approximation1

Digital Redesign of Analog PLLs- Equ 2

It is of course no surprise that system stability margin and the time-domain behavior are interconnected, but this is a useful approximation for the discussions that are presented later. We would otherwise lack a simple means to relate a discrete-time system’s characteristics back to the CTPLL damping factor equivalent.

The main purposes of this memorandum are:

  • To provide a mathematical basis and means to convert the classical second-order type-2 CTPLL into a discrete-time system
  • To investigate different metrics of equivalence between CTPLL and DTPLL designs
  • To provide the mathematical framework to assist in analyzing other arbitrary designs that may be of interest.

The PLL satisfies a cornucopia of different engineering needs in today’s world, and as such it is necessary to at least attempt to capture some of these different perspectives in the discussions that follow. To that end, we will consider the extracted DTPLL designs from several different perspectives including: (i) timedomain response, (ii) frequency-domain closed-loop gain, (iii) equivalent noise bandwidth.

There are many graphical plots contained in this memorandum. This was purposely done in order to enhance readability but it does make this a very lengthy monologue. Conclusions are provided at the end of each major section where appropriate in boxed regions in order that key points are not overlooked or lost.

Continuous-Time and Discrete-Time System Important Relationships

Two equations from [1] ( equations 1 and 8 ) form much of the foundational basis for the technical discussions that follow. The first of these two equations makes use of the Poisson Sum formula to permit the discrete-time and continuous-time transform descriptions of a system to be translated as

Digital Redesign of Analog PLLs- Equ 3

In (3), the left-hand side is mathematically the z-transform (scaled by Ts) of the time-series given by hk = h( k Ts ) whereas H( f ) is the continuous-time Fourier transform of h( t ). The sampling rate is Fs with Fs= Ts-1. The second equation of interest makes it possible to use the continuous-time Fourier transform of the open-loop gain function to compute the closed-loop frequency-domain description of the sampled control system and is given by

Digital Redesign of Analog PLLs- Equ 4

These equations receive substantial consideration in [2] should the interested reader wish to follow the underlying details more rigorously. One of the most attractive features of (4) is that it permits the exact inclusion of sampling in an otherwise continuous-time system without the need of first computing the z-transforms involved. Although we will not exploit this perspective in this memorandum, but it is nonetheless worthy of special note.

Since the CTPLL and DTPLL are not precisely the same particularly for small OSR values, the notion of an “equivalent” DSP redesign of a CTPLL must receive additional definition. The question, “Equivalent how?” must be asked. Different systems will naturally require a different definition of equivalence such as equivalence in:

  • Equivalent Noise Bandwidth
  • Bandwidth at -3 dB
  • Natural Frequency and Damping Factor
  • Stability Margin (Gain Peaking)
  • Impulse Response

Ultimately, we must decide how the Laplace transform operator s and the z-transform operator z are to be related in our redesign methodology. Equivalently, we must decide how differentiation and integration in the time domain will be handled between the continuous-time and discrete-time systems. A glimpse of this issue is offered in Figure 1 where the forward and backward Euler integration methods are compared for the continuous time domain systems which has an impulse response given as

Comparison Between Forward and Backward Euler Integration Methods

Digital Redesign of Analog PLLs- Equ 5

for t 0. The resulting responses are substantially different even for appreciable OSR values as evidenced here. More information is provided in the next section concerning such integration methods.

Finally, a word about system stability is in order. As is true with any numerical simulation work, stability is crucial for achieving any meaningful results. In the context of the material presented in this memorandum, two different forms of stability must be considered. First of all, the underlying numerical integration formulas that are adopted must be in a parameter range where they are themselves stable as discussed in Section 2. Secondly, the design of the DTPLL must itself be stable. The first stability type is easily achieved by using an adequate OSR parameter whereas the second depends upon proper pole-zero placement for the DTPLL design itself. Stability issues need to be considered in context since there are different types of stability that must be considered.

Key Points

  • “Equivalence” between CTPLL and DTPLL is a subjective term that must be precisely quantified.
  • Overall stability requires both (i) stability of the underlying numerical integration model and (ii) the system barring any imperfections in the numerical integration.

s- and z-Operators in Terms of Integration Formulas

It is very convenient to think about the Laplace transform s as a mathematical operator that is to be replaced by a discrete time operator in terms of z which is the unit-time element of z-transform theory. It is desirable that the adopted discrete time operator be both simple and accurate. The accuracy issue is particularly important if the OSR parameter is small.

In this section, we will introduce 4 different discrete-time methods for approximating the continuous-time Laplace transform operator s. These methods will subsequently be used to redesign the CTPLL into a discrete-time system implementation. A fifth technique is developed at the beginning of Section 3 which is based on an impulse-invariant perspective.

All of the integration formulas that we will consider in this memorandum are documented in numerical method textbooks. Two references that provide extensive treatment of this subject are [2] and [3].

In order to read the article in its entirety through page 36, please follow this link…

Mathematics, Phase-Locked Loops (PLL) Leave a comment

Pendulum & Elliptic Integrals

Figure 1: Pendulum Swing

Many years ago before the advent of the “PC on every desktop” age, I became fascinated with the design of LC elliptic filters. As part of that endeavor, I also became intimately acquainted with elliptic integrals. Having an equal intrigue for numerical precision, I found that computing the elliptic integrals with high accuracy was very difficult if simple integration methods like Simpson’s Rule or Gaussian quadrature were resorted to. Thus began my search for a precision method of computations.

Some readers will no doubt be familiar with the solution path involved, but to those who are not, I invite you to read on.

Where Hence Elliptic Integrals?

Elliptic integrals show up in many places, electronic elliptic filters for one. One of the situations where people encounter them first is in connection with simple pendulum motion.

A classical pendulum is shown in Figure 1 where

m mass of pendulum
R length of pendulum
g acceleration of gravity (e.g., 9.81 m/s2)
α starting angle

If we assume that the pendulum arm itself is both rigid and of zero mass, it is convenient to think about the motion of the pendulum bob in terms of motion along the fixed radius R where the angle α is a function of time. The tangential force perpendicular to R that the weight of the bob creates is given by

From Newton’s Laws of motion, this tangential force must be associated with a tangential acceleration which can be written as

Proper attention to signs for the forces involved results in the describing differential equation in terms of φ given as

This paper is offered for sale here.

Mathematics, RF Filter Design Leave a comment

New Papers Added

I have added several archived papers on OFDM, antennas for OFDM at 5 GHz, and 5 GHz WLAN network performance to the Protected Papers section. You will have to register to see these papers, but here are the internal links:

Antenna Related

Antenna Array Development Work

Antenna Guidelines for Use with Magis Air5 Jan 2003

Antenna Array Guidelines for Use with Magis Air5TM May 2003

OFDM Related

OFDM Basics at 5 GHz, 2001

WLAN Performance Related

Magis In-Home Field Testing Results, 2003

Magis In-Home Field Testing Results (2), 2003

Coming in May

I am in the process of writing a 2-part article that will first appear in the May, 2011 issue of a hard-print trade journal. The working title is “Unconventional Phase-Locked Loops Simplify Difficult Designs.” That article, my book writing, and my day job are keeping me busy, but I am still hoping to post some useful intermediate materials between now and then.

Antennas, RF System Design Leave a comment