Using MathCad to simulate a square wave
Kenneth Wyatt- September 20, 2012There are a number of engineering tools that work well for simulating EMC scenarios. One of these is MathCad, a tool that's been around for a number of years. The neat thing about MathCad is that you can define a set of equations in free-form layout and plot out the analysis in several engineering-type graphs, including logarithmic and polar. These plots are easily copied and may be pasted into documents or technical papers.
As an example, I've calculated the harmonic content of a square wave given user-defined fundamental frequency, rise times, pulse widths and duty cycles. It's very instructive to run through several scenarios prior to building hardware. By changing any of the user-defined parameters, you can quickly judge the outcome.
For example, changing the duty cycle from the default 50% to something else will start to show even-order harmonics. Slowing the rise time will reduce upper bound of the resulting the harmonics.
Figure 1. Frequency domain of a square wave with frequency, duty cycle and rise time as user defined variables.
If the above equations are too small to read, I've provided a larger downloadable document (and Mathcad worksheet) on my EMC web site.
MathCad is available in either a student version ($99) or non-student version ($1,500) or a free 30-day trial version. All these may be downloaded from their web site: http://www.ptc.com/product/mathcad/
In future postings, I'll show additional analytical tools for other useful EMC problems.