<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Circuit Design &#187; Analog Professional</title>
	<atom:link href="http://www.circuitdesign.info/blog/category/analog-pro/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.circuitdesign.info/blog</link>
	<description>Tutorials and Insights in Electronics and Circuit Design</description>
	<lastBuildDate>Mon, 26 Jul 2010 04:56:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<atom:link rel='hub' href='http://www.circuitdesign.info/blog/?pushpress=hub'/>
		<item>
		<title>Updates to Cadence/Subversion (CDSVN) scripts</title>
		<link>http://www.circuitdesign.info/blog/2010/07/updates-to-cadencesubversion-cdsvn-scripts/</link>
		<comments>http://www.circuitdesign.info/blog/2010/07/updates-to-cadencesubversion-cdsvn-scripts/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 04:09:41 +0000</pubDate>
		<dc:creator>Poojan Wagh</dc:creator>
				<category><![CDATA[Analog Professional]]></category>
		<category><![CDATA[cadence]]></category>
		<category><![CDATA[CDS]]></category>
		<category><![CDATA[revision control]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://www.circuitdesign.info/blog/2010/07/updates-to-cadencesubversion-cdsvn-scripts/</guid>
		<description><![CDATA[Our Brazilian Friends PCS and NGJr have offered the following changes to the CDSVN package: Into the file &#8220;cdsLibMgr.lib&#8221; was created the menu item &#8220;SVN Unlock Cell&#8221; Into the file &#8220;svnLockCell.il&#8221; were created the procedures &#8220;svnUnlockCell&#8221; and &#8220;svnUnlockCellFormCB&#8221; Inside the procedures &#8220;svnUnlockCellFormCB&#8221; and &#8220;svnUnlockCVFormCB&#8221; were made the following changes: where you have: if( !(rexMatchp(&#8220;.*.svn$&#8221;, file~>readPath) [...]]]></description>
			<content:encoded><![CDATA[<p>Our Brazilian Friends PCS and NGJr have offered the following changes to the CDSVN package:</p>
<blockquote>
<ul>
<li>Into the file &#8220;cdsLibMgr.lib&#8221; was created the menu item &#8220;SVN Unlock Cell&#8221;</li>
<li>Into the file &#8220;svnLockCell.il&#8221; were created the procedures &#8220;svnUnlockCell&#8221; and &#8220;svnUnlockCellFormCB&#8221;</li>
<li>Inside the procedures &#8220;svnUnlockCellFormCB&#8221; and &#8220;svnUnlockCVFormCB&#8221; were made the following changes:</li>
</ul>
<ul>
<li>where you have: if( !(rexMatchp(&#8220;.*.svn$&#8221;, file~>readPath) || rexMatchp(&#8220;.*%&#8221;, file~>readPath))</li>
<li>was changed to: if( !(rexMatchp(&#8220;.*.svn$&#8221;, file~>readPath) || rexMatchp(&#8221; &#8220;, file~>readPath))</li>
</ul>
<p>Behaviors observed:</p>
<ul>
<li>We don´t want the files *.cd% under version control, but if for some reason they are under version control that exist the possibility to lock them or unlock them.</li>
<li>Copying a &#8220;cell&#8221; or a &#8220;view&#8221; by &#8220;Library Manager&#8221; doesn´t copy files *.cd% which is not a problem because we don´t want these files under version control.</li>
<li>The command &#8220;[user@host CDSVN]$ svn lock *&#8221; or &#8220;[user@host CDSVN/bin]$ lock directory/&#8221; locks the files *.cd%, however, the &#8220;CDSVN Unlock Cell&#8221; or &#8220;CDSVN Unlock View&#8221; does not unlock.</li>
<li>The &#8220;CDSVN Lock Cell&#8221; or &#8220;CDSVN Lock View&#8221; does not unlock the files *.cd%, however, the commands &#8220;[user@host CDSVN]$ svn unlock *&#8221; or &#8220;[user@host CDSVN/bin]$ unlock directory/&#8221; are able to unlock.</li>
<li>Copying by the command &#8220;[user@host CDSVN]$ svn copy&#8221; copies the files *.cd% only if they are already under version control. The same behavior occurs for &#8220;CDSVN Copy Cell&#8221; or &#8220;CDSVN Copy View&#8221;. This is not a problem.</li>
<li>The command &#8220;[user@host CDSVN]$ svn add&#8221;, &#8220;CDSVN Add Cell&#8221; or &#8220;CDSVN Add View&#8221; does not add files *.cd% even because this type of file is in the list of ignored files as showed below:<br />
[user@host /home/user/.subversion] vi config<br />
global-ignores = *.cd% *.cd- *.cdslck *.Cat% *.abstract.status *.abstract.messages *.inca* *inca* .cdsvmod expand.cfg% transcript_ms</p>
<p>[user@host CDSVN/]vi cadence_ignores.txt<br />
*.cd%<br />
*.cd-<br />
*.cdslck<br />
*.Cat%<br />
*.abstract.status<br />
*.abstract.messages<br />
*.inca*<br />
*inca*<br />
&#8230;.<br />
cdsvmod<br />
expand.cfg%<br />
transcript_ms</li>
</ul>
</blockquote>
<p>Their updated files are attached. Special thanks to PCS for coordinating this. Remember, the CDSVN scripts are licensed under GPL.</p>
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2010/07/cdsLibMgr.il_.txt">cdsLibMgr.il</a><br />
<a href="http://www.circuitdesign.info/blog/wp-content/uploads/2010/07/svnLockCell.il_.txt">svnLockCell.il</a><br />
<a href="../wp-content/uploads/2010/07/cdsLibMgr.il_.txt">cdsLibMgr.il</a></p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.circuitdesign.info/blog/2010/07/updates-to-cadencesubversion-cdsvn-scripts/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.circuitdesign.info/blog/2010/07/updates-to-cadencesubversion-cdsvn-scripts/&amp;title=Updates+to+Cadence%2FSubversion+%28CDSVN%29+scripts" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.circuitdesign.info/blog/2010/07/updates-to-cadencesubversion-cdsvn-scripts/&amp;title=Updates+to+Cadence%2FSubversion+%28CDSVN%29+scripts" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.circuitdesign.info/blog/2010/07/updates-to-cadencesubversion-cdsvn-scripts/&amp;title=Updates+to+Cadence%2FSubversion+%28CDSVN%29+scripts&amp;desc=Our%20Brazilian%20Friends%20PCS%20and%20NGJr%20have%20offered%20the%20following%20changes%20to%20the%20CDSVN%20package%3A%0D%0A%0D%0A%0D%0A%09Into%20the%20file%20%22cdsLibMgr.lib%22%20was%20created%20the%20menu%20item%20%22SVN%20Unlock%20Cell%22%0D%0A%09Into%20the%20file%20%22svnLockCell.il%22%20were%20created%20the%20procedures%20%22svnUnlockCell%22%20and%20%22svnUnlockCellFormCB%22%0D%0A%09Inside%20the%20procedures%20%22" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.circuitdesign.info/blog/2010/07/updates-to-cadencesubversion-cdsvn-scripts/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.circuitdesign.info/blog/2010/07/updates-to-cadencesubversion-cdsvn-scripts/&amp;bm_description=Updates+to+Cadence%2FSubversion+%28CDSVN%29+scripts&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.circuitdesign.info/blog/2010/07/updates-to-cadencesubversion-cdsvn-scripts/&amp;title=Updates+to+Cadence%2FSubversion+%28CDSVN%29+scripts" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.circuitdesign.info/blog/2010/07/updates-to-cadencesubversion-cdsvn-scripts/&amp;title=Updates+to+Cadence%2FSubversion+%28CDSVN%29+scripts" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.circuitdesign.info/blog/2010/07/updates-to-cadencesubversion-cdsvn-scripts/&amp;title=Updates+to+Cadence%2FSubversion+%28CDSVN%29+scripts" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.circuitdesign.info/blog/2010/07/updates-to-cadencesubversion-cdsvn-scripts/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Updates+to+Cadence%2FSubversion+%28CDSVN%29+scripts+-+http://a.3o1.us/5r&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.circuitdesign.info/blog/2010/07/updates-to-cadencesubversion-cdsvn-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tunable Non-Foster Match Using Switched Capacitor</title>
		<link>http://www.circuitdesign.info/blog/2010/02/tunable-non-foster-match-using-switched-capacitor/</link>
		<comments>http://www.circuitdesign.info/blog/2010/02/tunable-non-foster-match-using-switched-capacitor/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 04:40:12 +0000</pubDate>
		<dc:creator>Poojan Wagh</dc:creator>
				<category><![CDATA[Analog Professional]]></category>
		<category><![CDATA[antenna]]></category>
		<category><![CDATA[research idea]]></category>
		<category><![CDATA[software definable radio]]></category>
		<category><![CDATA[tunable]]></category>

		<guid isPermaLink="false">http://www.circuitdesign.info/blog/?p=827</guid>
		<description><![CDATA[What's even cooler about this reactance is that the Non-Foster region is determined by the switching frequency--so, one could move it around just by changing the switching frequency. You'd effectively have a digitally-tunable antenna.]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Foster_reactance_theorem">Foster&#8217;s reactance theorem</a> states that any reactance <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/02129bb861061d1a052c592e2dc6b383.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/02129bb861061d1a052c592e2dc6b383.png'>Cannot render equation. Use Firefox instead.</object></object> increases as a function of frequency <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/8fa14cdd754f91cc6554c9e71929cce7.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/8fa14cdd754f91cc6554c9e71929cce7.png'>Cannot render equation. Use Firefox instead.</object></object>. This is true of the impedance looking into an antenna, where the reactance may be a large part of the overall impedance. The task in matching the antenna (for maximum power transfer and therefore maximum SNR) is to cancel the reactance (or susceptance) and match the resistance.</p>
<p>Unfortunately, this can&#8217;t be done over a large range, because as Foster&#8217;s reactance theorem states, as soon as you deviate a little from your center frequency, both the inductive reactance of your antenna and the reactance of whatever you&#8217;re using to cancel it (most likely a capacitive element) both increase (go toward <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/f0ede16940cb1e58e03d0a967ec542dc.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/f0ede16940cb1e58e03d0a967ec542dc.png'>Cannot render equation. Use Firefox instead.</object></object>). So, for every change <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/26191e9a28dad0d949423ca601857793.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/26191e9a28dad0d949423ca601857793.png'>Cannot render equation. Use Firefox instead.</object></object> in frequency from the center frequency, your antenna reactance goes <strong>up</strong> by some amount <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/df4cc0b6633e8d2ec448043134bcd111.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/df4cc0b6633e8d2ec448043134bcd111.png'>Cannot render equation. Use Firefox instead.</object></object>, but your matching element&#8217;s reactance <strong>also</strong> goes up by some amount <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/e6b34cd3f00375a0b5c56ef6db056303.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/e6b34cd3f00375a0b5c56ef6db056303.png'>Cannot render equation. Use Firefox instead.</object></object>.</p>
<p>If you had a Non-Foster element, the reactance of your tuning element would go <strong>down</strong> by some amount <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/acbf906293dc130d7dac518e4290476a.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/acbf906293dc130d7dac518e4290476a.png'>Cannot render equation. Use Firefox instead.</object></object>, compensating for the increased reactance of the antenna. You would then have  a broadband (or broader) match.</p>
<p>Most attempts to do this have required the use of active elements (such as gyrators) so synthesis a negative impedance. However, I&#8217;m wondering if  a switched-capacitor circuit can be used to synthesize this Non-Foster reactance. Most analyses of switched-capacitor circuits show that they are synthetic resistors at frequencies far below the switching frequency. However, what does the impedance look like <em>near</em> the switching frequency?<span id="more-827"></span></p>
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2010/02/scan01601.jpg"><img class="aligncenter size-medium wp-image-838" src="http://www.circuitdesign.info/blog/wp-content/uploads/2010/02/scan01601-291x300.jpg" alt="capacitor with alternating switches on each side" width="291" height="300" /></a></p>
<p>Well, since you&#8217;re pumping current into the circuit at exactly the rate of switching, you should see a large voltage. As a result, it should look like a high-impedance near the switching frequency. I would tend to believe that the switching function takes the usual <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/7b0fe30dec63f020738aea3765e1e9a5.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/7b0fe30dec63f020738aea3765e1e9a5.png'>Cannot render equation. Use Firefox instead.</object></object> function and modulates it up to the switching frequency. (I haven&#8217;t proved this and probably won&#8217;t ever prove it.) However, if one thinks about the following picture, the current coming into the capacitor can be seen as the independent variable. Then, the voltage is the regular voltage, except mixed by the switching function. Thus, the <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/a750fecb6c87fef3d54f990bd0c48b6c.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/a750fecb6c87fef3d54f990bd0c48b6c.png'>Cannot render equation. Use Firefox instead.</object></object> product should be some modulated version of the fundamental capacitor&#8217;s impedance.</p>
<p>The upshot of all this mixing is that just below the switching frequency, one would have a reactance that&#8217;s decreasing. (I&#8217;m doing a considerable amount of hand-waiving here, excluding such things as aliases of the switching harmonics.) What&#8217;s even cooler about this reactance is that the Non-Foster region is determined by the switching frequency&#8211;so, one could move it around just by changing the switching frequency. You&#8217;d effectively have a digitally-tunable antenna.</p>
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2010/02/scan0161.jpg"><img class="aligncenter size-medium wp-image-839" src="http://www.circuitdesign.info/blog/wp-content/uploads/2010/02/scan0161-300x243.jpg" alt="Capacitor impedance translated to higher frequency" width="300" height="243" /></a>There are a number of problems with this scheme, most notably the radiation of switching noise and any switched-capacitor noise effects. However, I think it&#8217;s worth looking at and building upon.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.circuitdesign.info/blog/2010/02/tunable-non-foster-match-using-switched-capacitor/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.circuitdesign.info/blog/2010/02/tunable-non-foster-match-using-switched-capacitor/&amp;title=Tunable+Non-Foster+Match+Using+Switched+Capacitor" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.circuitdesign.info/blog/2010/02/tunable-non-foster-match-using-switched-capacitor/&amp;title=Tunable+Non-Foster+Match+Using+Switched+Capacitor" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.circuitdesign.info/blog/2010/02/tunable-non-foster-match-using-switched-capacitor/&amp;title=Tunable+Non-Foster+Match+Using+Switched+Capacitor&amp;desc=What%27s%20even%20cooler%20about%20this%20reactance%20is%20that%20the%20Non-Foster%20region%20is%20determined%20by%20the%20switching%20frequency--so%2C%20one%20could%20move%20it%20around%20just%20by%20changing%20the%20switching%20frequency.%20You%27d%20effectively%20have%20a%20digitally-tunable%20antenna." rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.circuitdesign.info/blog/2010/02/tunable-non-foster-match-using-switched-capacitor/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.circuitdesign.info/blog/2010/02/tunable-non-foster-match-using-switched-capacitor/&amp;bm_description=Tunable+Non-Foster+Match+Using+Switched+Capacitor&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.circuitdesign.info/blog/2010/02/tunable-non-foster-match-using-switched-capacitor/&amp;title=Tunable+Non-Foster+Match+Using+Switched+Capacitor" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.circuitdesign.info/blog/2010/02/tunable-non-foster-match-using-switched-capacitor/&amp;title=Tunable+Non-Foster+Match+Using+Switched+Capacitor" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.circuitdesign.info/blog/2010/02/tunable-non-foster-match-using-switched-capacitor/&amp;title=Tunable+Non-Foster+Match+Using+Switched+Capacitor" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.circuitdesign.info/blog/2010/02/tunable-non-foster-match-using-switched-capacitor/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Tunable+Non-Foster+Match+Using+Switched+Capacitor+-+http://www.circuitdesign.info/2q&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.circuitdesign.info/blog/2010/02/tunable-non-foster-match-using-switched-capacitor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Median vs Mean</title>
		<link>http://www.circuitdesign.info/blog/2009/12/median-vs-mean/</link>
		<comments>http://www.circuitdesign.info/blog/2009/12/median-vs-mean/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 05:35:59 +0000</pubDate>
		<dc:creator>Poojan Wagh</dc:creator>
				<category><![CDATA[Analog Professional]]></category>
		<category><![CDATA[Digital Professional]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[five nines]]></category>
		<category><![CDATA[six sigma]]></category>

		<guid isPermaLink="false">http://www.circuitdesign.info/blog/2009/12/median-vs-mean/</guid>
		<description><![CDATA[I’ve been doing some statistical measurements lately (more to follow). It occurs to me that while most people measure the mean of a set of measurements, the median is more useful. If the distribution is Gaussian, the mean and median are equal. (Mean is defined as Cannot render equation. Use Firefox instead. where Cannot render [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been doing some statistical measurements lately (more to follow). It occurs to me that while most people measure the mean of a set of measurements, the median is more useful.</p>
<p><span id="more-807"></span>If the distribution is Gaussian, the mean and median are equal.</p>
<p style="text-align: center;"><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/12/scan0151a.jpg"><img class="aligncenter" style="float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/12/scan0151a_thumb.jpg" border="0" alt="scan0151a" width="244" height="128" /></a></p>
<p>(Mean is defined as <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/3c7e0a17650a17a3bb7f292252641d82.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/3c7e0a17650a17a3bb7f292252641d82.png'>Cannot render equation. Use Firefox instead.</object></object> where <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/078376930c9985774961ee63c5615a07.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/078376930c9985774961ee63c5615a07.png'>Cannot render equation. Use Firefox instead.</object></object> is the probability distribution function (PDF) of <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/02129bb861061d1a052c592e2dc6b383.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/02129bb861061d1a052c592e2dc6b383.png'>Cannot render equation. Use Firefox instead.</object></object>—that is, it’s a average of X, weighted with the probability density of <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/02129bb861061d1a052c592e2dc6b383.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/02129bb861061d1a052c592e2dc6b383.png'>Cannot render equation. Use Firefox instead.</object></object>. The median defined as <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/e3fdb80b7fdc0fde4ae04a51c1f26c07.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/e3fdb80b7fdc0fde4ae04a51c1f26c07.png'>Cannot render equation. Use Firefox instead.</object></object>—that is, the point where <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/02129bb861061d1a052c592e2dc6b383.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/02129bb861061d1a052c592e2dc6b383.png'>Cannot render equation. Use Firefox instead.</object></object> is equally likely to be lower than or greater than (50% probability).)</p>
<p>Many times in engineering and process control, we keep track of the mean and standard deviation. One of the reasons is that if the thing we’re trying to control is Gaussian, the mean/median and standard deviation give us good design criteria to minimize failure: if we allow our system to tolerate <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/b9b583bf45b3ed4f9bc001eba7a8f126.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/b9b583bf45b3ed4f9bc001eba7a8f126.png'>Cannot render equation. Use Firefox instead.</object></object> 3 standard deviations (<object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/05a7cb6dcd495968d896fa1ef2ab6ae0.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/05a7cb6dcd495968d896fa1ef2ab6ae0.png'>Cannot render equation. Use Firefox instead.</object></object>) around the mean/median, then it has a 99.7% chance of success (0.3% chance of failure).</p>
<p>However, we can generalize this: if we wanted to be more lax, we could only design (or require) the system to tolerate <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/b9b583bf45b3ed4f9bc001eba7a8f126.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/b9b583bf45b3ed4f9bc001eba7a8f126.png'>Cannot render equation. Use Firefox instead.</object></object> 2 standard deviations (4.5% failure). In some cases, systems are designed to tolerate <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/b9b583bf45b3ed4f9bc001eba7a8f126.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/b9b583bf45b3ed4f9bc001eba7a8f126.png'>Cannot render equation. Use Firefox instead.</object></object> 4 standard deviations (0.006% failure). So, one can design the system to tolerate <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/99033ff13e14ca2dbdcdcffe6dfbc31c.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/99033ff13e14ca2dbdcdcffe6dfbc31c.png'>Cannot render equation. Use Firefox instead.</object></object>, where <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/8ce4b16b22b58894aa86c421e8759df3.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/8ce4b16b22b58894aa86c421e8759df3.png'>Cannot render equation. Use Firefox instead.</object></object> is some factor (3, 2, 4 for example) that determines the probability of failure.</p>
<p>However, what if the distribution is bimodal? Take for example, two modes of operation (each more or less Gaussian):</p>
<p style="text-align: center;"><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/12/scan0151b.jpg"><img class="aligncenter" style="float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/12/scan0151b_thumb.jpg" border="0" alt="scan0151b" width="244" height="134" /></a></p>
<p>Due to the asymmetric distribution, the mean and median are now not the same. In this case, we could posit that some secondary mode (or external factor) causes that second hump. Let’s call the main hump the primary mode and the smaller hump the secondary mode. If things are behaving “normally” we get the first hump, but some failure or aberration causes the second hump.</p>
<p>However, what if the system was more sensitive to this failure (secondary mode). Then, we’d see something like:</p>
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/12/scan0151c.jpg"><img class="aligncenter" style="float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/12/scan0151c_thumb.jpg" border="0" alt="scan0151c" width="244" height="127" /></a>Notice what happened? The median stayed exactly the same. However the mean mislabeled “average”) moved proportionally to that secondary hump. Incidentally, the standard deviation (<object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/e773536932c61c7ee11944cefde49e30.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/e773536932c61c7ee11944cefde49e30.png'>Cannot render equation. Use Firefox instead.</object></object>) also moved proportionally to the distance between the two humps—but let’s focus on the fact that the mean just changed.</p>
<p>The question you’re probably asking is “what’s so bad about that”? Well, if you’re computing six-sigma-like design criteria, you’re taking <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/d313ed41f8c285fd35c299d68427065d.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/d313ed41f8c285fd35c299d68427065d.png'>Cannot render equation. Use Firefox instead.</object></object>. Recall, however, that we could pick any factor <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/8ce4b16b22b58894aa86c421e8759df3.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/8ce4b16b22b58894aa86c421e8759df3.png'>Cannot render equation. Use Firefox instead.</object></object> depending on the probability of failure we want (I should say want to avoid). So, when both the average and the standard deviation change, how can we be sure we’re getting the right value for <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/34664d934b3f58901d9bd9605d4c5148.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/34664d934b3f58901d9bd9605d4c5148.png'>Cannot render equation. Use Firefox instead.</object></object>?</p>
<p>The nice thing about picking the median as the average is that it doesn’t depend on the magnitude of the secondary mode—only on the probability of the secondary mode. The magnitude of failure impacts the standard deviation. I like to view these (median and standard deviation) sas two independent metrics that tell different stories.</p>
<p>Another thing to note is that one could view the 2nd illustration above as an input to a nonlinear amplifier (for example) and the 3rd illustration as the output. That’s another nice thing about the median: it commutes with a monotonic nonlinearity. That is, if <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/8fa14cdd754f91cc6554c9e71929cce7.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/8fa14cdd754f91cc6554c9e71929cce7.png'>Cannot render equation. Use Firefox instead.</object></object> is monotonic, and <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/45c6a14fb8855c9641193ef1125d70f8.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/45c6a14fb8855c9641193ef1125d70f8.png'>Cannot render equation. Use Firefox instead.</object></object>, then <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/019084ec241802157ba9a929941e07c4.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/019084ec241802157ba9a929941e07c4.png'>Cannot render equation. Use Firefox instead.</object></object>. So, we don’t have to worry so much that we’re measuring the correct independent variable. Our median will give us the same information (albeit in a different, nonlinear domain).</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.circuitdesign.info/blog/2009/12/median-vs-mean/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.circuitdesign.info/blog/2009/12/median-vs-mean/&amp;title=Median+vs+Mean" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.circuitdesign.info/blog/2009/12/median-vs-mean/&amp;title=Median+vs+Mean" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.circuitdesign.info/blog/2009/12/median-vs-mean/&amp;title=Median+vs+Mean&amp;desc=I%E2%80%99ve%20been%20doing%20some%20statistical%20measurements%20lately%20%28more%20to%20follow%29.%20It%20occurs%20to%20me%20that%20while%20most%20people%20measure%20the%20mean%20of%20a%20set%20of%20measurements%2C%20the%20median%20is%20more%20useful.%0D%0A%0D%0AIf%20the%20distribution%20is%20Gaussian%2C%20the%20mean%20and%20median%20are%20equal.%0D%0A%0D%0A%28Mean%20is%20defined%20as%20%60mu_X%20%3D%20int%20X%20p%28X%29%20dX%60%20where" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.circuitdesign.info/blog/2009/12/median-vs-mean/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.circuitdesign.info/blog/2009/12/median-vs-mean/&amp;bm_description=Median+vs+Mean&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.circuitdesign.info/blog/2009/12/median-vs-mean/&amp;title=Median+vs+Mean" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.circuitdesign.info/blog/2009/12/median-vs-mean/&amp;title=Median+vs+Mean" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.circuitdesign.info/blog/2009/12/median-vs-mean/&amp;title=Median+vs+Mean" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.circuitdesign.info/blog/2009/12/median-vs-mean/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Median+vs+Mean+-+http://www.circuitdesign.info/v&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.circuitdesign.info/blog/2009/12/median-vs-mean/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Differential Circuits Follow-Up</title>
		<link>http://www.circuitdesign.info/blog/2009/07/differential-circuits-follow-up/</link>
		<comments>http://www.circuitdesign.info/blog/2009/07/differential-circuits-follow-up/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 02:26:09 +0000</pubDate>
		<dc:creator>Matt Miller</dc:creator>
				<category><![CDATA[Analog Professional]]></category>
		<category><![CDATA[differential]]></category>
		<category><![CDATA[gain]]></category>
		<category><![CDATA[impedance]]></category>

		<guid isPermaLink="false">http://www.circuitdesign.info/blog/2009/07/differential-circuits-follow-up/</guid>
		<description><![CDATA[Introduction You&#8217;ll notice that this post has Matt Miller listed as the author. Poojan requested Matt&#8217;s comments on his differential circuit post. Poojan was impressed with my comments enough that he decided to make it a follow-up post. So, this post is co-written by both Poojan and Matt. Gain Some of you asked whether the [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>You&#8217;ll notice that this post has Matt Miller listed as the author. Poojan requested Matt&#8217;s comments on <a href="http://www.circuitdesign.info/blog/2009/06/the-benefits-of-differential-circuits/" target="_blank">his differential circuit post</a>. Poojan was impressed with my comments enough that he decided to make it a follow-up post. So, this post is co-written by both Poojan and Matt.</p>
<p> <span id="more-768"></span><br />
<h2>Gain</h2>
<p> Some of you asked whether the differential circuit being biased at half the current therefore has half the transconductance, and therefore lower gain. The answer is that it depends.   <br />The single-ended circuit has an output current $$i_o = g_m \times v_i$$. In many cases, the only thing this circuit can drive is a single-ended load $$Z_L$$.   <br />The differential circuit has an output current $$i_{o+} = g_m \times v_i/2$$; $$i_{o-} = -g_m \times v_i/2$$.   <br />So, the question comes down to whether we can subtract the two currents $$i_{o+}$$ and $$i_{o-}$$ to produce a differential current. Although one can think of it that way, it&#8217;s really more accurately to define the current flowing out of one side and into the other. The current, therefore, doesn&#8217;t change. However, all other things being equal, the load on the differential circuit will be $$2Z_L$$. Therefore, the gain is the same.<br />
<h2>Free Lunch</h2>
<p> Some of you questioned the 4x boost in dynamic range that the differential circuit gives over its single-ended counterpart. While I made some mistakes with the equations (they&#8217;re fixed now), the result <i>was</i> correct: the differential circuit does have 6 dB higher dynamic range. Where did this come from? Well, it&#8217;s the basic advantage of the differential circuit: while a single-ended circuit can only swing +/- Vx, a differential circuit (where the output is defined as the difference of two single-ended circuits) has a swing of twice that: +/- 2Vx. Having twice the voltage is equivalent to 4x the power (and in both cases, that&#8217;s 6 dB improvement).<br />
<h2>There&#8217;s No Such Thing</h2>
<p> If some of you feel that this can&#8217;t be possible, please keep in mind the long disclaimer at the beginning of the last post: there are no universally better circuits. There are only certain circuits that are better suited for certain applications. In this case, the differential circuit gets its benefit from improved output range. However, the gain doesn&#8217;t change. Therefore, there&#8217;s an intrinsic assumption here: the circuit will tolerate a higher output, but there&#8217;s no gain to make the output higher. We didn&#8217;t intrinsically get double the gain, so we can&#8217;t take advantage of the dynamic range without sticking some gain ahead of the circuit.   <br />That&#8217;s requirement is perfectly fine in a lot of cases. In many cases, you already have a ton of gain and automatic gain-control (AGC) ahead of the circuit. In that case, the AGC range can be reduced (possibly improving overall performance). This is true (for example) in the baseband filter at the end of an RF line-up. For that application, the figure of merit really <i>is</i> dynamic range. Similarly, in an ADC, the extra dynamic range might mean more effective bits of resolution.<br />
<h2>Cheap Lunch</h2>
<p> We&#8217;ve given the impression that the dynamic range can&#8217;t be leveraged in (for example) an RF LNA. Turns out that it can—for relatively cheap (although&#160; not for free). If one were to stick a 1:4 (impedance ratio) balun ahead of the circuit, one would get this voltage gain for relatively cheap (meaning, the cost of the balun). In many cases, some form of impedance transformer (matching network) is required anyway, so putting a balun in isn&#8217;t a great cost.   <br />The balun doubles the voltage but quadruples the output impedance. This is actually a good thing: the differential circuit has 4x the input impedance of the single-ended circuit. Let&#8217;s call the single-ended circuit&#8217;s input impedance $$Z_i$$. The differential circuit has $$2Z_i$$ input impedance on each side (we&#8217;ve cut the single-ended circuit in half). However, these input impedances get stacked to form the fully differential input impedance, so we get $$4Z_i$$ as the input impedance of the differential circuit:
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/07/scan0146a.jpg"><font color="#000000"></font><img style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="242" alt="Single Ended Zin" src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/07/scan0146a_thumb.jpg" width="244" border="0" /></a> versus</p>
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/07/scan0146b.jpg"><img style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="312" alt="Differential Zin (4x Single Ended)" src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/07/scan0146b_thumb.jpg" width="484" border="0" /></a></p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.circuitdesign.info/blog/2009/07/differential-circuits-follow-up/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.circuitdesign.info/blog/2009/07/differential-circuits-follow-up/&amp;title=Differential+Circuits+Follow-Up" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.circuitdesign.info/blog/2009/07/differential-circuits-follow-up/&amp;title=Differential+Circuits+Follow-Up" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.circuitdesign.info/blog/2009/07/differential-circuits-follow-up/&amp;title=Differential+Circuits+Follow-Up&amp;desc=Introduction%20%20You%27ll%20notice%20that%20this%20post%20has%20Matt%20Miller%20listed%20as%20the%20author.%20Poojan%20requested%20Matt%27s%20comments%20on%20his%20differential%20circuit%20post.%20Poojan%20was%20impressed%20with%20my%20comments%20enough%20that%20he%20decided%20to%20make%20it%20a%20follow-up%20post.%20So%2C%20this%20post%20is%20co-written%20by%20both%20Poojan%20and%20Matt.%20%20%20Gain%20So" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.circuitdesign.info/blog/2009/07/differential-circuits-follow-up/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.circuitdesign.info/blog/2009/07/differential-circuits-follow-up/&amp;bm_description=Differential+Circuits+Follow-Up&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.circuitdesign.info/blog/2009/07/differential-circuits-follow-up/&amp;title=Differential+Circuits+Follow-Up" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.circuitdesign.info/blog/2009/07/differential-circuits-follow-up/&amp;title=Differential+Circuits+Follow-Up" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.circuitdesign.info/blog/2009/07/differential-circuits-follow-up/&amp;title=Differential+Circuits+Follow-Up" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.circuitdesign.info/blog/2009/07/differential-circuits-follow-up/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Differential+Circuits+Follow-Up+-+http://www.circuitdesign.info/y&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.circuitdesign.info/blog/2009/07/differential-circuits-follow-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The benefits of differential circuits</title>
		<link>http://www.circuitdesign.info/blog/2009/06/the-benefits-of-differential-circuits/</link>
		<comments>http://www.circuitdesign.info/blog/2009/06/the-benefits-of-differential-circuits/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 01:40:57 +0000</pubDate>
		<dc:creator>Poojan Wagh</dc:creator>
				<category><![CDATA[Analog Professional]]></category>
		<category><![CDATA[differential]]></category>
		<category><![CDATA[dynamic range]]></category>
		<category><![CDATA[Noise]]></category>
		<category><![CDATA[power]]></category>
		<category><![CDATA[single ended]]></category>
		<category><![CDATA[SNR]]></category>

		<guid isPermaLink="false">http://www.circuitdesign.info/blog/?p=753</guid>
		<description><![CDATA[Introduction From my personal blog: I’ve been lucky enough to find myself in a team that’s intent on finding the best circuit design for a given application. This doesn’t happen often to many people, but I feel that I’ve had more than my share of this opportunity. The conclusion is usually that we come up [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>From <a title="blog post on the tendency to generalize accomplishments (without retaining assumptions)" href="http://poojanblog.com/blog/2009/06/assumptions-vs-accomplishments/" target="_blank">my personal blog</a>:</p>
<blockquote><p>I’ve been lucky enough to find myself in a team that’s intent on finding the <em>best</em> circuit design for a given application. This doesn’t happen often to many people, but I feel that I’ve had more than my share of this opportunity.</p>
<p>The conclusion is usually that we come up with some topology (let’s call it circuit <em>X</em>) that optimizes all the performance criteria. I walk away wanting to generalize the experience with the lesson that circuit <em>X</em> is the best circuit ever, and I want to use it everywhere.</p>
<p>Inevitably, I find that some other topology <em>Y</em> is better suited for some other application. There were some specific constraints or conditions on circuit <em>X</em> that don’t apply to circuit <em>Y</em>, and as a result, circuit <em>Y</em> is more optimal for application <em>Y</em>.</p>
</blockquote>
<p>It is for this reason that I won’t say that differential circuits are always better than their single ended counter-part. I will say that in my experience, I’ve come across the case where the differential circuit—or, really, the differential <em>approach</em>—is more effective than its single-ended counterpart. However, that’s not why I’ve decided to write this post.</p>
<p>Unfortunately, I’ve come across several engineers that make the generalization error in the opposite direction: they state that single-ended circuits save current. I will present a counter-example that is sufficient to disprove this generalization. Keep in mind that it doesn’t prove the opposite generalization (that differential circuits are <em>always </em>better).</p>
<p> <span id="more-753"></span><br />
<h2>Voltage-Mode Output</h2>
<p>The two cases below assume that the dynamic range is limited by output voltage: that is, the circuit will clip its output and that determines the high-end of the dynamic range.</p>
<h3>Single-Ended Dynamic Range</h3>
<p>Consider the single-ended CMOS amplifier shown below:</p>
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/06/scan0144a.jpg"><img style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="213" alt="scan0144a" src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/06/scan0144a-thumb.jpg" width="244" border="0" /></a></p>
<p>The output noise voltage is given by:</p>
<p> $$v_{n,o}^2 = \frac{8kTg_m \times |Z_L|^2}{3} = \frac{8kT \times I_{DD} \times |Z_L|^2}{3*V_{DSAT,N}}$$
<p>The maximum output voltage swing (zero-to-peak) is given by:</p>
<p> $$V_{o,max} = \frac{V_{DD} &#8211; V_{DSAT,P} &#8211; V_{DSAT,N}}{2}$$
<p>The dynamic range is:</p>
<p> $$DR = \frac{|V_{o,max}|^2}{v_{n,o}^2} = \frac{(V_{DD} &#8211; V_{DSAT,P} &#8211; V_{DSAT,N})^2 \times 3V_{DSAT,N}}{4 \times 8kT \times I_{DD} \times |Z_L|^2}$$<br />
<h3>Differential Dynamic Range</h3>
<p>Consider the differential CMOS amplifier:</p>
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/06/scan0144b.jpg"><img style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="244" alt="scan0144b" src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/06/scan0144b-thumb.jpg" width="242" border="0" /></a></p>
<p>The output noise voltage is given by (I<sub>D</sub> is the current in each side of the differential pair; it is half of I<sub>DD</sub>, the total current):</p>
<p> $$v_{n,o}^2 = \frac{8kTg_m \times |Z_L|^2}{3} = \frac{8kT \times 2 \times I_{D} \times |Z_L|^2}{3*V_{DSAT,N}} = \frac{8kT \times I_{DD} \times |Z_L|^2}{3*V_{DSAT,N}}$$
<p>The maximum output voltage swing (zero-to-peak) is given by:</p>
<p> $$V_{o,max} = V_{DD} &#8211; V_{DSAT,P} &#8211; V_{DSAT,N} &#8211; V_{DSAT,N2}$$
<p>The dynamic range is:</p>
<p> $$DR = \frac{|V_{o,max}|^2}{v_{n,o}^2} = \frac{4(V_{DD} &#8211; V_{DSAT,P} &#8211; V_{DSAT,N} &#8211; V_{DSAT,N2})^2 \times 3V_{DSAT,N}}{4 \times 8kT \times I_{DD} \times |Z_L|^2}$$<br />
<h3>Comparison</h3>
<p>We see that the dynamic range is equivalent in both cases. The difference is the terms 4(V<sub>DD</sub> – V<sub>DSAT,P</sub> – V<sub>DSAT,N</sub> – V<sub>DSAT,N2</sub>) in the differential case versus (V<sub>DD</sub> – V<sub>DSAT,P</sub> – V<sub>DSAT,N</sub>) in the single-ended case. In many cases, the differential dynamic range is larger. In fact, as long as </p>
<p align="center">V<sub>DSAT,N2</sub> < 3/4(V<sub>DD</sub> – V<sub>DSAT,P</sub> – V<sub>DSAT,N</sub>)</p>
<p align="left">However, in the case where you can’t meet this requirement, <em>you can get rid of MN2</em> (albeit at the cost of common-mode rejection).</p>
<h3>Conclusion</h3>
<p>We’ve seen a case where the differential circuit shows more dynamic range than the single-ended counterpart. My guess is that most people who say that differential means more current don’t realize that you don’t have to have the same current in each branch of the differential circuit (you can split the current in half).</p>
<p>One limitation of the above analysis is that I assume that the input voltage is available in a differential form, and that the output is consumable in its differential form. Obviously, if this isn’t the case, the above analysis may or may not work. The case becomes more specific and the generalization fails.</p>
<p>That said, I’ve seen plenty of line-ups where a transformer/balun is placed off-chip to convert the chip’s inputs/outputs to differential. Requiring differential I/O at the chip level doesn’t mean requiring differential I/O at the board level.</p>
<h2>Current-Mode Output</h2>
<p>I’ve detailed the use of <a title="The case for the trans-conducting LNA" href="http://www.circuitdesign.info/blog/2008/11/the-case-for-the-trans-conducting-lna/" target="_blank">current-mode circuits</a> before. It’s possible to treat this as a special case of the voltage-mode output analysis, with Z<sub>L</sub> being small. The only problem with that extrapolation is that if Z<sub>L</sub> <em>is</em> small, the maximum swing probably won’t be dictated by voltage: the circuit will slew way before it clips. As a result, instead of V<sub>o,max</sub> being given by the previous equation, we have:</p>
<p>Single-ended:</p>
<p> $$V_{o,max} = \frac{\alpha \times I_{DD} \times |Z_L|}{2}$$
<p>Differential:</p>
<p> $$V_{o,max} = \alpha \times I_{DD} \times |Z_L|$$
<p>where α is a factor that indicates what fraction of quiescent current can be used as signal current.</p>
<p>The advantage is even more apparent: you’re getting 4× the dynamic range.</p>
<h2>Additional Benefits</h2>
<p>In addition to the improved dynamic range (power-drain efficiency), differential circuits offer:</p>
<ul>
<li>Reduced susceptibility to supply noise: a good chunk of supply noise appears as common-mode, so a fully-differential circuit will reject (ignore) it </li>
<li>Improved IM2: IM2 generally appears as common-mode and to a large amount gets rejected </li>
<li>Reduce supply bounce (more beneficial for switch-mode circuits): since there’s a complementary action at the nodes in the differential circuit, much less noise is induced on the supply during dynamic operation </li>
</ul>
<h2>Disadvantages</h2>
<p>I can only point out a few disadvantages to the approaches presented here—and they really have nothing to do with single-ended (versus differential) circuits:</p>
<ul>
<li>Common-mode feedback: you’re generally going to need a common-mode feedback (and common-mode sensing). However, even the single-ended topology (shown above) requires some bias adjustment to set its output bias voltage. This is more of a property of CMOS design (high-impedance loads) than a trade-off of single-ended/differential circuits. </li>
<li>Lower swing: once again, this is a property of the differential pair. But, a lot of the differential benefit (common-mode rejection ratio) comes from using the differential pair. </li>
</ul>
<p>True disadvantages:</p>
<ul>
<li>If you’re using minimum-size devices, you end up spending twice the current with the differential circuit than with the single-ended version. However, when (in analog design), have you used minimum-sized devices? </li>
<li>The benefits of differential circuits occur when you get to analyze the noise and signal swing differentially. However, if the circuit you’re driving doesn’t respond to a differential input, the benefits aren’t as great. </li>
</ul>
<h2>Conclusion</h2>
<p>It seems to me that most of the people that globally avoid differential circuits subscribe to the thought that since there are two current branches, there must be double the current. However, like I said above, this is only true if your branches are using minimum-sized devices. Otherwise, you can always split the device in half and distribute the same current across a differential pair.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.circuitdesign.info/blog/2009/06/the-benefits-of-differential-circuits/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.circuitdesign.info/blog/2009/06/the-benefits-of-differential-circuits/&amp;title=The+benefits+of+differential+circuits" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.circuitdesign.info/blog/2009/06/the-benefits-of-differential-circuits/&amp;title=The+benefits+of+differential+circuits" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.circuitdesign.info/blog/2009/06/the-benefits-of-differential-circuits/&amp;title=The+benefits+of+differential+circuits&amp;desc=Introduction%20%20From%20my%20personal%20blog%3A%20%20%20%20%20I%E2%80%99ve%20been%20lucky%20enough%20to%20find%20myself%20in%20a%20team%20that%E2%80%99s%20intent%20on%20finding%20the%20best%20circuit%20design%20for%20a%20given%20application.%20This%20doesn%E2%80%99t%20happen%20often%20to%20many%20people%2C%20but%20I%20feel%20that%20I%E2%80%99ve%20had%20more%20than%20my%20share%20of%20this%20opportunity.%20%20%20%20The%20conclusion%20is%20u" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.circuitdesign.info/blog/2009/06/the-benefits-of-differential-circuits/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.circuitdesign.info/blog/2009/06/the-benefits-of-differential-circuits/&amp;bm_description=The+benefits+of+differential+circuits&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.circuitdesign.info/blog/2009/06/the-benefits-of-differential-circuits/&amp;title=The+benefits+of+differential+circuits" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.circuitdesign.info/blog/2009/06/the-benefits-of-differential-circuits/&amp;title=The+benefits+of+differential+circuits" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.circuitdesign.info/blog/2009/06/the-benefits-of-differential-circuits/&amp;title=The+benefits+of+differential+circuits" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.circuitdesign.info/blog/2009/06/the-benefits-of-differential-circuits/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=The+benefits+of+differential+circuits+-+http://www.circuitdesign.info/r&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.circuitdesign.info/blog/2009/06/the-benefits-of-differential-circuits/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PCB &amp; IC Layout Designer</title>
		<link>http://www.circuitdesign.info/blog/2009/06/pcb-ic-layout-designer/</link>
		<comments>http://www.circuitdesign.info/blog/2009/06/pcb-ic-layout-designer/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 12:29:03 +0000</pubDate>
		<dc:creator>Poojan Wagh</dc:creator>
				<category><![CDATA[Analog Professional]]></category>
		<category><![CDATA[common centroid]]></category>
		<category><![CDATA[contractor]]></category>
		<category><![CDATA[layout]]></category>

		<guid isPermaLink="false">http://www.circuitdesign.info/blog/2009/06/pcb-ic-layout-designer/</guid>
		<description><![CDATA[I generally don’t accept solicitations to post resumes, but I am making an exception for a very talented friend of mine. I know a very good IC designer and PCB designer. My experience with him is as an IC layout designer. However, most of his PCB customers cite him as the best PCB layout designer [...]]]></description>
			<content:encoded><![CDATA[<p><font color="#808080">I generally don’t accept solicitations to post resumes, but I am making an exception for a very talented friend of mine.</font></p>
<p>I know a <em>very</em> good IC designer and PCB designer. My experience with him is as an IC layout designer. However, most of his PCB customers cite him as the best PCB layout designer they’ve come across. I’ll focus on his IC skills, since I can attest to that.</p>
<p>He’s most often hired as a consultant embedded in a design team. However, he’s capable of and set up for turn-key work (taking schematics and sending back GDS II). He’s skilled in Cadence (Virtuoso XL, Assura) and Mentor (IC Layout, Calibre) design tools.</p>
<p>If you’re interested, fill out the <a title="Contact Poojan about hiring this IC/PCB layout designer" href="http://www.circuitdesign.info/blog/feedback-contact-us/" target="_blank">Feedback (Contact Us)</a> form. I will forward requests to him.</p>
<p>He’s worked on the following products (since I’ve met him) and much more:</p>
<ul>
<li>CMOS 90 nm transceiver IC including ADC/DAC, RF: massive integration effort, requiring careful shielding and differential matching of many RF/analog lines </li>
<li>IBM 8WL BiCMOS IC including high-linearity mixer with feedback: extremely compact layout, minimizing RF parasitics </li>
<li>CMOS 90 nm continuous-time sigma-delta ADC: detailed matching (common centroiding) of CMOS devices and matching of routing parasitics </li>
<li>TSMC 0.18 um CMOS class-D audio amplifier IC: integration and isolation of several analog blocks with large digital circuit </li>
<li>CMOS 0.18 um all-digital RF transmitter (resulted in <a title="An all-digital universal RF transmitter [CMOS RF modulator and PA]" href="detailed matching (common centroiding) of CMOS devices and matching of routing parasitics" target="_blank">this</a> publication) </li>
</ul>
<p>Each of the above has been a first-pass success. He contracted for over a decade at Motorola Labs (Motorola’s corporate research center at their headquarters near Chicago), Atmel, Freescale Semiconductor, and several Motorola product groups. He ran a circuit board development group at Tellabs. He’s extremely pleasant to work with and does very well in a team environment (both as a lead developer and as a team member).</p>
<p>He is a US citizen.</p>
<p>He is available for hourly contracting.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.circuitdesign.info/blog/2009/06/pcb-ic-layout-designer/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.circuitdesign.info/blog/2009/06/pcb-ic-layout-designer/&amp;title=PCB+%26amp%3B+IC+Layout+Designer" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.circuitdesign.info/blog/2009/06/pcb-ic-layout-designer/&amp;title=PCB+%26amp%3B+IC+Layout+Designer" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.circuitdesign.info/blog/2009/06/pcb-ic-layout-designer/&amp;title=PCB+%26amp%3B+IC+Layout+Designer&amp;desc=I%20generally%20don%E2%80%99t%20accept%20solicitations%20to%20post%20resumes%2C%20but%20I%20am%20making%20an%20exception%20for%20a%20very%20talented%20friend%20of%20mine.%20%20I%20know%20a%20very%20good%20IC%20designer%20and%20PCB%20designer.%20My%20experience%20with%20him%20is%20as%20an%20IC%20layout%20designer.%20However%2C%20most%20of%20his%20PCB%20customers%20cite%20him%20as%20the%20best%20PCB%20layout%20designer" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.circuitdesign.info/blog/2009/06/pcb-ic-layout-designer/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.circuitdesign.info/blog/2009/06/pcb-ic-layout-designer/&amp;bm_description=PCB+%26amp%3B+IC+Layout+Designer&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.circuitdesign.info/blog/2009/06/pcb-ic-layout-designer/&amp;title=PCB+%26amp%3B+IC+Layout+Designer" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.circuitdesign.info/blog/2009/06/pcb-ic-layout-designer/&amp;title=PCB+%26amp%3B+IC+Layout+Designer" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.circuitdesign.info/blog/2009/06/pcb-ic-layout-designer/&amp;title=PCB+%26amp%3B+IC+Layout+Designer" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.circuitdesign.info/blog/2009/06/pcb-ic-layout-designer/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=PCB+%26amp%3B+IC+Layout+Designer+-+http://www.circuitdesign.info/28&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.circuitdesign.info/blog/2009/06/pcb-ic-layout-designer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Polar vs Cartesian RF Modulator Efficiency</title>
		<link>http://www.circuitdesign.info/blog/2009/03/polar-vs-cartesian-rf-modulator-efficiency/</link>
		<comments>http://www.circuitdesign.info/blog/2009/03/polar-vs-cartesian-rf-modulator-efficiency/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 04:26:19 +0000</pubDate>
		<dc:creator>Poojan Wagh</dc:creator>
				<category><![CDATA[Analog Professional]]></category>
		<category><![CDATA[cartesian]]></category>
		<category><![CDATA[mixer]]></category>
		<category><![CDATA[modulator]]></category>
		<category><![CDATA[polar]]></category>
		<category><![CDATA[RF]]></category>
		<category><![CDATA[switching]]></category>

		<guid isPermaLink="false">http://www.circuitdesign.info/blog/2009/03/polar-vs-cartesian-rf-modulator-efficiency/</guid>
		<description><![CDATA[I’ve been fielding quite a few questions lately about polar modulation. Indeed, polar modulators are theoretically more efficient. However, this does not need to be the case. I will highlight (technically, self-promote) a Cartesian scheme that can produce an RF signal as efficiently as a polar modulator—with fewer implementation issues. Introduction In general, we are [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been fielding quite a few questions lately about polar modulation. Indeed, polar modulators are theoretically more efficient. However, this does not need to be the case. I will highlight (technically, <a title="(WO/2007/117761) RF TRANSMITTER WITH INTERLEAVED IQ MODULATION" href="http://www.wipo.int/pctdb/en/wo.jsp?WO=2007117761" target="_blank">self-promote</a>) a Cartesian scheme that can produce an RF signal as efficiently as a polar modulator—with fewer implementation issues.<br />
<span id="more-719"></span></p>
<h2>Introduction</h2>
<p>In general, we are trying to produce the signal</p>
<p><object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/785fefa7066309ead100759d582fc471.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/785fefa7066309ead100759d582fc471.png'>Cannot render equation. Use Firefox instead.</object></object></p>
<p>where <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/665dd30fd32270d75e7871a23e9ae2b3.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/665dd30fd32270d75e7871a23e9ae2b3.png'>Cannot render equation. Use Firefox instead.</object></object> is the in-phase (I) component and <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/2b52cb73a7924da60a7789a5a48b5f38.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/2b52cb73a7924da60a7789a5a48b5f38.png'>Cannot render equation. Use Firefox instead.</object></object> is the quadrature (Q) of our complex baseband signal. In general, RF transmitters have a <em>modulator</em> circuit which carries out this math. These are called Cartesian modulators and are generally drawn as:</p>
<p><strong><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/03/scan0140a.jpg"><img style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/03/scan0140a-thumb.jpg" border="0" alt="scan0140a" width="244" height="144" /></a> </strong></p>
<p>This diagram is meant to be interpreted as a high-level circuit schematic. Namely, the output <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/8b8865815e7d75e1875e483544a9eeb4.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/8b8865815e7d75e1875e483544a9eeb4.png'>Cannot render equation. Use Firefox instead.</object></object> is a <em>wire-sum</em> of the the individual mixer outputs.</p>
<p><object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/8b8865815e7d75e1875e483544a9eeb4.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/8b8865815e7d75e1875e483544a9eeb4.png'>Cannot render equation. Use Firefox instead.</object></object> can also be written as</p>
<p><object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/51c2535875686e899468eb795a9165f0.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/51c2535875686e899468eb795a9165f0.png'>Cannot render equation. Use Firefox instead.</object></object></p>
<p>where <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/ade638eac5b5b368c9f53a5549898240.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/ade638eac5b5b368c9f53a5549898240.png'>Cannot render equation. Use Firefox instead.</object></object> and <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/6737180b4bc4245cc050401b4c615179.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/6737180b4bc4245cc050401b4c615179.png'>Cannot render equation. Use Firefox instead.</object></object>. Then, we lose the need to sum the signals and we can simply implement:</p>
<p><strong><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/03/scan0140b.jpg"><img style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/03/scan0140b-thumb.jpg" border="0" alt="scan0140b" width="244" height="87" /></a></strong></p>
<h2>Cartesian Inefficiency</h2>
<p>The inefficiency of the Cartesian modulator is not in the individual mixers themselves (they are equivalent between Cartesian and polar). The inefficiency lies in the summing of the two mixer outputs: some current flows from the I-mixer into the Q-mixer and is dissipated by the Q-mixer’s output resistance. Indeed, we could get a high efficiency RF modulator if we could stop this current flowing. Indeed, if the component mixers were high output impedance (i.e. current sources), this summing could be done efficiently.</p>
<h2>Switched-Mode Modulators</h2>
<p>It should be noted that while we desire <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/ede33ed43ced3940515426b28fa059d1.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/ede33ed43ced3940515426b28fa059d1.png'>Cannot render equation. Use Firefox instead.</object></object>, what usually gets implemented is <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/b526a21fb0094d576c1d19da8535cf74.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/b526a21fb0094d576c1d19da8535cf74.png'>Cannot render equation. Use Firefox instead.</object></object> where <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/0c39998f20890f453c04daac4baf8722.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/0c39998f20890f453c04daac4baf8722.png'>Cannot render equation. Use Firefox instead.</object></object> is a square wave at the carrier frequency. This works because <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/0c39998f20890f453c04daac4baf8722.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/0c39998f20890f453c04daac4baf8722.png'>Cannot render equation. Use Firefox instead.</object></object> has a component of <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/af146fd4cd1cc8fe62f69c0572788d0b.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/af146fd4cd1cc8fe62f69c0572788d0b.png'>Cannot render equation. Use Firefox instead.</object></object>—albeit with some higher order terms. However, these terms can usually be filtered out.</p>
<h2>Interleaving</h2>
<p>What if, instead of summing the two signals, we interleaved them. That is, we spit out a sequence (at 4x the carrier frequency) of [+ x<sub>I</sub>, –x<sub>Q</sub>, –x<sub>I</sub>, +x<sub>Q</sub>]? It turns out that this is equivalent to multiplying <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/665dd30fd32270d75e7871a23e9ae2b3.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/665dd30fd32270d75e7871a23e9ae2b3.png'>Cannot render equation. Use Firefox instead.</object></object> by a [+1,0,-1,0] sequence (which also has a term of <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/af146fd4cd1cc8fe62f69c0572788d0b.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/af146fd4cd1cc8fe62f69c0572788d0b.png'>Cannot render equation. Use Firefox instead.</object></object>) and multiplying <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/2b52cb73a7924da60a7789a5a48b5f38.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/2b52cb73a7924da60a7789a5a48b5f38.png'>Cannot render equation. Use Firefox instead.</object></object> by a [0, –1, 0, +1] sequence (which has a term of <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/6277cc68010ff6901814559a2f553c9a.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/6277cc68010ff6901814559a2f553c9a.png'>Cannot render equation. Use Firefox instead.</object></object>).</p>
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/03/scan0140c.jpg"><img style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/03/scan0140c-thumb.jpg" border="0" alt="scan0140c" width="240" height="244" /></a></p>
<p>It turns out that the cases where the I- and Q- LO’s overlap is very inefficient, and it contributes nothing to the output signal power. (The <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/8f2ade95e392f97a4998520cfd3cdd18.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/8f2ade95e392f97a4998520cfd3cdd18.png'>Cannot render equation. Use Firefox instead.</object></object> term in [+1, 0, –1, 0] is smaller than the term in [+1, +1, –1, –1]. However, we are concerned about <em>efficiency</em>—the ratio of power produced to power dissipated—not absolute output power.)</p>
<p>This can be implemented efficiently by the following switching circuit:</p>
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/03/scan0141.jpg"><img style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/03/scan0141-thumb.jpg" border="0" alt="scan0141" width="244" height="205" /></a></p>
<p>For clarity, I&#8217;ve shown the circuit as a single-balanced (single-ended) output, but it can be (and should be) implemented as a fully differential output.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.circuitdesign.info/blog/2009/03/polar-vs-cartesian-rf-modulator-efficiency/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.circuitdesign.info/blog/2009/03/polar-vs-cartesian-rf-modulator-efficiency/&amp;title=Polar+vs+Cartesian+RF+Modulator+Efficiency" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.circuitdesign.info/blog/2009/03/polar-vs-cartesian-rf-modulator-efficiency/&amp;title=Polar+vs+Cartesian+RF+Modulator+Efficiency" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.circuitdesign.info/blog/2009/03/polar-vs-cartesian-rf-modulator-efficiency/&amp;title=Polar+vs+Cartesian+RF+Modulator+Efficiency&amp;desc=I%E2%80%99ve%20been%20fielding%20quite%20a%20few%20questions%20lately%20about%20polar%20modulation.%20Indeed%2C%20polar%20modulators%20are%20theoretically%20more%20efficient.%20However%2C%20this%20does%20not%20need%20to%20be%20the%20case.%20I%20will%20highlight%20%28technically%2C%20self-promote%29%20a%20Cartesian%20scheme%20that%20can%20produce%20an%20RF%20signal%20as%20efficiently%20as%20a%20polar%20mod" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.circuitdesign.info/blog/2009/03/polar-vs-cartesian-rf-modulator-efficiency/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.circuitdesign.info/blog/2009/03/polar-vs-cartesian-rf-modulator-efficiency/&amp;bm_description=Polar+vs+Cartesian+RF+Modulator+Efficiency&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.circuitdesign.info/blog/2009/03/polar-vs-cartesian-rf-modulator-efficiency/&amp;title=Polar+vs+Cartesian+RF+Modulator+Efficiency" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.circuitdesign.info/blog/2009/03/polar-vs-cartesian-rf-modulator-efficiency/&amp;title=Polar+vs+Cartesian+RF+Modulator+Efficiency" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.circuitdesign.info/blog/2009/03/polar-vs-cartesian-rf-modulator-efficiency/&amp;title=Polar+vs+Cartesian+RF+Modulator+Efficiency" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.circuitdesign.info/blog/2009/03/polar-vs-cartesian-rf-modulator-efficiency/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Polar+vs+Cartesian+RF+Modulator+Efficiency+-+http://www.circuitdesign.info/15&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.circuitdesign.info/blog/2009/03/polar-vs-cartesian-rf-modulator-efficiency/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dual DAC CTSD &#124; Wider Bandwidth and Higher SNR &#8212; Part 2</title>
		<link>http://www.circuitdesign.info/blog/2009/03/dual-dac-ctsd-wider-bandwidth-and-higher-snr-part-2/</link>
		<comments>http://www.circuitdesign.info/blog/2009/03/dual-dac-ctsd-wider-bandwidth-and-higher-snr-part-2/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 21:13:45 +0000</pubDate>
		<dc:creator>Poojan Wagh</dc:creator>
				<category><![CDATA[Analog Professional]]></category>
		<category><![CDATA[ADC]]></category>
		<category><![CDATA[continuous time]]></category>
		<category><![CDATA[DAC]]></category>
		<category><![CDATA[feedback]]></category>
		<category><![CDATA[metastability]]></category>
		<category><![CDATA[partial fraction expansion]]></category>
		<category><![CDATA[sigma delta]]></category>

		<guid isPermaLink="false">http://www.circuitdesign.info/blog/?p=696</guid>
		<description><![CDATA[Introduction So, we want to break down our continuous-time sigma-delta feedback into two paths: A low-precision tight loop that delivers the first sample to the quantizer A higher-precision loop that goes through a clock delay to minimize &#8220;metastability&#8221; (indecision) DAC Feedback As a small aside, recall that the DAC feedback looks similar to the following: [...]]]></description>
			<content:encoded><![CDATA[<h2><a name="_introduction"></a>Introduction</h2>
<p>So, we want to <a href="http://www.circuitdesign.info/blog/2009/02/dual-dac-ctsd-wider-bandwidth-and-higher-snr-part-1/">break down our continuous-time sigma-delta feedback into two paths</a>:</p>
<ol type="1">
<li> A low-precision tight loop that delivers the first sample to the quantizer</li>
<li> A higher-precision loop that goes through a clock delay to minimize &#8220;metastability&#8221; (indecision)</li>
</ol>
<p><span id="more-696"></span></p>
<h2><a name="_dac_feedback"></a>DAC Feedback</h2>
<p>As a small aside, recall that the DAC feedback looks similar to the following:</p>
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/03/dacoutput.png"> <img src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/03/dacoutput.png" alt="" width="320" /> </a></p>
<p>The input to the quantizer is the convolution of this signal with the impulse response <em>h</em>(<em>t</em>) of the noise-shaping filter <em>H</em>(<em>s</em>). As we did with the impulse-invariant transform, we break down the noise-shaping filter into partial-fraction expansion:</p>
<p><object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/6a77e69df02a808e23ea90cf3569047c.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/6a77e69df02a808e23ea90cf3569047c.png'>Cannot render equation. Use Firefox instead.</object></object></p>
<p>Each of these <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/7c30a07c6f8c3d2ba69de4aa83f90ac8.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/7c30a07c6f8c3d2ba69de4aa83f90ac8.png'>Cannot render equation. Use Firefox instead.</object></object> is a single-pole filter, with an impulse response that looks something like:</p>
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/03/dualimpulseresponse.png"> <img src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/03/dualimpulseresponse.png" alt="" width="320" /> </a></p>
<hr />
<h2><a name="_dual_filter_analysis"></a>Dual-Filter Analysis</h2>
<p>The first sample at the quantizer is the convolution of a DAC symbol with the impulse response. This amounts to the integral over one sample period:</p>
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/03/dualimpulseresponsesample1.png"> <img src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/03/dualimpulseresponsesample1.png" alt="" width="320" /> </a></p>
<p>The rest of the samples can be passed through a filter that looks like this:</p>
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/03/dualimpulseresponserest.png"> <img src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/03/dualimpulseresponserest.png" alt="" width="320" /> </a></p>
<p>The main difference between this remaining filter and the original is that it is scaled by <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/a0e690c849ea144c5947ea3755025da2.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/a0e690c849ea144c5947ea3755025da2.png'>Cannot render equation. Use Firefox instead.</object></object>. Note that the delay in the filter is already included in the system due to the extra clock delay by the second DAC.</p>
<hr />
<h2><a name="_summary"></a>Summary</h2>
<p>So, in the end, we have replaced <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/f68021749ff69bf0b89869d4358ea300.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/f68021749ff69bf0b89869d4358ea300.png'>Cannot render equation. Use Firefox instead.</object></object> with:</p>
<p><object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/92d16a8fa8b73522400b51db1a5be846.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/92d16a8fa8b73522400b51db1a5be846.png'>Cannot render equation. Use Firefox instead.</object></object></p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.circuitdesign.info/blog/2009/03/dual-dac-ctsd-wider-bandwidth-and-higher-snr-part-2/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.circuitdesign.info/blog/2009/03/dual-dac-ctsd-wider-bandwidth-and-higher-snr-part-2/&amp;title=Dual+DAC+CTSD+%7C+Wider+Bandwidth+and+Higher+SNR+--+Part+2" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.circuitdesign.info/blog/2009/03/dual-dac-ctsd-wider-bandwidth-and-higher-snr-part-2/&amp;title=Dual+DAC+CTSD+%7C+Wider+Bandwidth+and+Higher+SNR+--+Part+2" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.circuitdesign.info/blog/2009/03/dual-dac-ctsd-wider-bandwidth-and-higher-snr-part-2/&amp;title=Dual+DAC+CTSD+%7C+Wider+Bandwidth+and+Higher+SNR+--+Part+2&amp;desc=Introduction%0D%0ASo%2C%20we%20want%20to%20break%20down%20our%20continuous-time%20sigma-delta%20feedback%20into%20two%20paths%3A%0D%0A%0D%0A%09%20A%20low-precision%20tight%20loop%20that%20delivers%20the%20first%20sample%20to%20the%20quantizer%0D%0A%09%20A%20higher-precision%20loop%20that%20goes%20through%20a%20clock%20delay%20to%20minimize%20%22metastability%22%20%28indecision%29%0D%0A%0D%0A%0D%0ADAC%20Feedback%0D%0AAs%20a" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.circuitdesign.info/blog/2009/03/dual-dac-ctsd-wider-bandwidth-and-higher-snr-part-2/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.circuitdesign.info/blog/2009/03/dual-dac-ctsd-wider-bandwidth-and-higher-snr-part-2/&amp;bm_description=Dual+DAC+CTSD+%7C+Wider+Bandwidth+and+Higher+SNR+--+Part+2&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.circuitdesign.info/blog/2009/03/dual-dac-ctsd-wider-bandwidth-and-higher-snr-part-2/&amp;title=Dual+DAC+CTSD+%7C+Wider+Bandwidth+and+Higher+SNR+--+Part+2" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.circuitdesign.info/blog/2009/03/dual-dac-ctsd-wider-bandwidth-and-higher-snr-part-2/&amp;title=Dual+DAC+CTSD+%7C+Wider+Bandwidth+and+Higher+SNR+--+Part+2" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.circuitdesign.info/blog/2009/03/dual-dac-ctsd-wider-bandwidth-and-higher-snr-part-2/&amp;title=Dual+DAC+CTSD+%7C+Wider+Bandwidth+and+Higher+SNR+--+Part+2" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.circuitdesign.info/blog/2009/03/dual-dac-ctsd-wider-bandwidth-and-higher-snr-part-2/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Dual+DAC+CTSD+%7C+Wider+Bandwidth+and+Higher+SNR+--+Part+2+-+http://www.circuitdesign.info/12&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.circuitdesign.info/blog/2009/03/dual-dac-ctsd-wider-bandwidth-and-higher-snr-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Impulse Invariant Transform</title>
		<link>http://www.circuitdesign.info/blog/2009/02/impulse-invariant-transform/</link>
		<comments>http://www.circuitdesign.info/blog/2009/02/impulse-invariant-transform/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 14:28:57 +0000</pubDate>
		<dc:creator>Poojan Wagh</dc:creator>
				<category><![CDATA[Analog Professional]]></category>
		<category><![CDATA[continuous time]]></category>
		<category><![CDATA[laplace]]></category>
		<category><![CDATA[sigma delta]]></category>
		<category><![CDATA[z transform]]></category>

		<guid isPermaLink="false">http://www.circuitdesign.info/blog/?p=661</guid>
		<description><![CDATA[Introduction The impulse invariant transform (IIT) is a method of taking a continuous-time system H(s) and converting it to a discrete-time system. There are multiple ways of doing this, but the IIT does so with the constraint that the impulse response of the discrete-time system is a sampled version of the impulse response of the [...]]]></description>
			<content:encoded><![CDATA[<hr />
<h2><a name="_introduction"></a>Introduction</h2>
<p>The impulse invariant transform (IIT) is a method of taking a continuous-time system H(s) and converting it to a discrete-time system. There are multiple ways of doing this, but the IIT does so with the constraint that the impulse response of the discrete-time system is a sampled version of the impulse response of the continuous-time system.</p>
<p>Here’s an illustration:</p>
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/02/analogsystemdot.png"> <img src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/02/analogsystemdot.png" alt="" width="320" /> </a></p>
<p>…gets converted to…</p>
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/02/digitalsystemdot.png"> <img src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/02/digitalsystemdot.png" alt="" width="320" /></a><br />
<span id="more-661"></span><br />
…with the characteristic that the discrete-time impulse response is a sampled version of the continuous-time:</p>
<p><a href="http://www.circuitdesign.info/blog/wp-content/uploads/2009/02/sampledimpulseresponse.png"> <img src="http://www.circuitdesign.info/blog/wp-content/uploads/2009/02/sampledimpulseresponse.png" alt="" width="320" /> </a></p>
<hr />
<h2><a name="_rational_systems"></a>Rational Systems</h2>
<p>This doesn’t seem like a big deal—nor very accurate. The illustration above implies that we’re taking an IIR response from the continuous-time system and sampling as a discrete-time FIR.</p>
<p>However, the IIT actually does something better: if H(s) is rational (composed of a numerator and denominator):</p>
<p><object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/faaa2023d1f37e683b5458de2d416156.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/faaa2023d1f37e683b5458de2d416156.png'>Cannot render equation. Use Firefox instead.</object></object></p>
<p>…then the IIT lets us re-write this system as a discrete-time rational system:</p>
<p><object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/d2c5ca709a1c2333088c6430ef5a23d9.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/d2c5ca709a1c2333088c6430ef5a23d9.png'>Cannot render equation. Use Firefox instead.</object></object></p>
<p>…of course, with the property that <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/0300248fb9cbd99f8e2e1ae5ec4ca374.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/0300248fb9cbd99f8e2e1ae5ec4ca374.png'>Cannot render equation. Use Firefox instead.</object></object>. <object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/425801eab1cf896cb55b2f975e11330d.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/425801eab1cf896cb55b2f975e11330d.png'>Cannot render equation. Use Firefox instead.</object></object> is the sampling period (typically, during transformation from continous-time to discrete-time, the continuous-time impulse response is scaled by the sample period).</p>
<hr />
<h2><a name="_example"></a>Example</h2>
<p>Here’s an example:</p>
<p><object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/7ee703ebac48e38ecdc75037e312a6ea.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/7ee703ebac48e38ecdc75037e312a6ea.png'>Cannot render equation. Use Firefox instead.</object></object></p>
<p>First, we break it down into its partial fraction expansion:</p>
<p><object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/d70a8969b64b46b07acf229e9b6591dd.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/d70a8969b64b46b07acf229e9b6591dd.png'>Cannot render equation. Use Firefox instead.</object></object></p>
<p>Solving (taking limits of s to +j and -j):</p>
<p><object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/5a274856b475e92a1dcdfafaba8b47c3.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/5a274856b475e92a1dcdfafaba8b47c3.png'>Cannot render equation. Use Firefox instead.</object></object><br />
<object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/3f671aebf28292e8837a4292a876e9e1.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/3f671aebf28292e8837a4292a876e9e1.png'>Cannot render equation. Use Firefox instead.</object></object></p>
<p>Now, the IIT prescribes how to take single-pole transfer functions and convert them to the z-domain.</p>
<p><object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/dc1c130c4f47550e504c172ce5936917.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/dc1c130c4f47550e504c172ce5936917.png'>Cannot render equation. Use Firefox instead.</object></object><br />
<object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/0e20d44e49826fc064e79b9d938e9202.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/0e20d44e49826fc064e79b9d938e9202.png'>Cannot render equation. Use Firefox instead.</object></object></p>
<p>…which means that:</p>
<p><object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/1e2237ca969f3ebbc186343b05260d82.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/1e2237ca969f3ebbc186343b05260d82.png'>Cannot render equation. Use Firefox instead.</object></object><br />
<object type='image/svg+xml' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/421b3141459a86ad96861b95ee5c25c4.svg'><object type='image/png' class='mathml_backup' data='http://www.circuitdesign.info/blog/wp-content/uploads/asciimathml/421b3141459a86ad96861b95ee5c25c4.png'>Cannot render equation. Use Firefox instead.</object></object></p>
<hr />
<h2><a name="_application"></a>Application</h2>
<p>The impulse invariant transform is useful in <em>modelling</em> continuous-time sigma-delta, allowing one to analyze the mixed-mode continuous-time sigma-delta as a purely discrete-time system.</p>
<p>Most notably, in considering the stability of continuous-time sigma-delta ADC&#8217;s, the transformation is useful in allowing one to replace the continuous-time noise-shaping filter with a discrete-time equivalent. One could then perform a closed-loop analytic analysis on the system. This is the procedure advocated in <a href="http://www.amazon.com/gp/product/0780310454?ie=UTF8&#038;tag=obsecompthind-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0780310454">Delta-Sigma Data Converters: Theory, Design, and  Simulation</a><img src="http://www.assoc-amazon.com/e/ir?t=obsecompthind-20&#038;l=as2&#038;o=1&#038;a=0780310454" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />. However, the book only prescribes a rule-of-thumb, and in general, one must simulate the sigma-delta rigorously to gain confidence of stability.</p>
<p>Arguably, this transformation was more useful in the past, when high-level mixed-mode simulators (Simulink) were not available. In that case, the only way to simulate the continous-time sigma-delta was to model at a discrete-time. Nowadays (in my experience) Simulink is fast enough that it&#8217;s easier to keep the mixed-mode nature of the system intact (i.e. not model it as a purely discrete-time system). However, I can imagine a case of either very long simulations or a regression analysis system where the cycle-accurate discrete-time model may become useful again.</p>
<hr />
Want to stay updated? Consider a subscription to this site via RSS or email.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.circuitdesign.info/blog/2009/02/impulse-invariant-transform/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.circuitdesign.info/blog/2009/02/impulse-invariant-transform/&amp;title=Impulse+Invariant+Transform" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.circuitdesign.info/blog/2009/02/impulse-invariant-transform/&amp;title=Impulse+Invariant+Transform" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.circuitdesign.info/blog/2009/02/impulse-invariant-transform/&amp;title=Impulse+Invariant+Transform&amp;desc=%0D%0AIntroduction%0D%0AThe%20impulse%20invariant%20transform%20%28IIT%29%20is%20a%20method%20of%20taking%20a%20continuous-time%20system%20H%28s%29%20and%20converting%20it%20to%20a%20discrete-time%20system.%20There%20are%20multiple%20ways%20of%20doing%20this%2C%20but%20the%20IIT%20does%20so%20with%20the%20constraint%20that%20the%20impulse%20response%20of%20the%20discrete-time%20system%20is%20a%20sampled%20ver" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.circuitdesign.info/blog/2009/02/impulse-invariant-transform/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.circuitdesign.info/blog/2009/02/impulse-invariant-transform/&amp;bm_description=Impulse+Invariant+Transform&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.circuitdesign.info/blog/2009/02/impulse-invariant-transform/&amp;title=Impulse+Invariant+Transform" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.circuitdesign.info/blog/2009/02/impulse-invariant-transform/&amp;title=Impulse+Invariant+Transform" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.circuitdesign.info/blog/2009/02/impulse-invariant-transform/&amp;title=Impulse+Invariant+Transform" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.circuitdesign.info/blog/2009/02/impulse-invariant-transform/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Impulse+Invariant+Transform+-+http://www.circuitdesign.info/1f&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.circuitdesign.info/blog/2009/02/impulse-invariant-transform/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Non-Radix-2 FFT in Cadence/Ocean/Skill/Spectre &#124; Using Cadence IPC to talk to Matlab (or anything else)</title>
		<link>http://www.circuitdesign.info/blog/2009/01/non-radix-2-fft-in-cadenceoceanskillspectre-using-cadenc-ipc-to-talk-to-matlab-or-anything-else/</link>
		<comments>http://www.circuitdesign.info/blog/2009/01/non-radix-2-fft-in-cadenceoceanskillspectre-using-cadenc-ipc-to-talk-to-matlab-or-anything-else/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 14:43:53 +0000</pubDate>
		<dc:creator>Poojan Wagh</dc:creator>
				<category><![CDATA[Analog Professional]]></category>
		<category><![CDATA[Digital Professional]]></category>
		<category><![CDATA[cadence]]></category>
		<category><![CDATA[FFT]]></category>
		<category><![CDATA[IPC]]></category>
		<category><![CDATA[matlab]]></category>
		<category><![CDATA[Ocean]]></category>
		<category><![CDATA[Skill]]></category>

		<guid isPermaLink="false">http://www.circuitdesign.info/blog/2009/01/non-radix-2-fft-in-cadenceoceanskillspectre-using-cadenc-ipc-to-talk-to-matlab-or-anything-else/</guid>
		<description><![CDATA[Introduction I had been working on a pulse-width-modulation (PWM) design. It was a pseudo-digital implementation, in that the output was clocked by a high-speed clock. The actual switching rate was much lower than this clock. I wanted to simulate this design in Cadence/Spectre by running a transient and then taking an FFT. However, I ran [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>I had been working on a pulse-width-modulation (PWM) design. It was a pseudo-digital implementation, in that the output was clocked by a high-speed clock. The actual switching rate was much lower than this clock. I wanted to simulate this design in Cadence/Spectre by running a transient and then taking an FFT.</p>
<p>However, I ran into a bit of a snag: the quantization clock and my input clock rates were defined by the design, and they weren&#8217;t up to me. Moreover, these weren&#8217;t related by a power of 2. Unfortunately, Cadence Ocean (Skill) commands only allow for a radix-2 (power of 2 length) FFT. So, I was stuck. I needed a way to do a non-radix-2 FFT in Cadence. Here&#8217;s how I solved it using Matlab and getting Cadence and Matlab to talk (in a limited fashion).</p>
<p><span id="more-648"></span>What I ended up doing was writing some Skill IPC (inter-process communication) code that:</p>
<ol>
<li>Dumped the time-domain data to a text file on disk (in Cadence/Skill)</li>
<li>Read the time-domain data using Matlab</li>
<li>Perform the FFT (in Matlab)</li>
<li>Write the frequency-domain data to a text file (in Matlab)</li>
<li>Read the frequency-domain data (in Cadence/Skill)</li>
<li>Plot FFT and compute SNR/SNDR (in Cadence/Skill)</li>
</ol>
<h2>The scripts</h2>
<p>These files are copyright Poojan Wagh, 2009. They are released under the GPL. See http://www.gnu.org/licenses/gpl.txt.</p>
<p>These files come with absolutely no warranty, expressed or implied. Use at your own risk. If these scripts destroy your entire design database, that&#8217;s your fault for using them.</p>
<h3>The Ocean Script</h3>
<p>Here&#8217;s the ocean script I used. It&#8217;s called text.txt, because it is actually contained as a cell-view (text file type). Here&#8217;s a run-through of the code:</p>
<pre>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; copy this into CIW:
; runscript( "pwm3_sim" "reg0650_tran_paw" "ocean_ultrasim_getsndr_baseline" )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</pre>
<p>I&#8217;ve defined runscript() as a function which loads and executes a text-file cell-view.</p>
<pre>; Copyright (c) 2009 Poojan Wagh
; Released under GPL (http://www.gnu.org/licenses/gpl.txt)
; $Revision: 1511 $
library = "pwm3_sim"
cell = "reg0650_tran_paw"
view = "config_baseline"
proc= "typ"
cap = "typ"
res = "typ"</pre>
<p>library, cell, view, proc (typ/wcs/bcs), etc. are all defined as skill variables for easier changing &#038; for future corner simulation</p>
<pre>lsfqueue =  nil
jobname = "reg0650_tran_paw_baseline"</pre>
<p>In case we want to use LSF for load-balancing</p>
<pre>wad = getShellEnvVar("WORKAREA_DIR")
dumpfile = strcat(wad "/matfft/reg0650_tran_paw_baseline.pwm")</pre>
<p>WORKAREA_DIR is the area where cadence is started. The PWM dump-out file will be in a <code>mattfft</code> subdirectory of it.</p>
<pre>runit = t;
plotpsd = t;</pre>
<p>runit determines whether we run the simulation or just plot the FFT/SNR/SNDR. plotpsd determines if we plot the power spectral density (PSD) or not (mostly for debugging).</p>
<pre>;;;;;;;;;  Max Amplitude
inputmag =1.8;
vidc = 0.0;
fR = 460k;
ncs = 36;
fQ = ncs*fR;</pre>
<p>inputmag is how high of an input signal we are sending to the PWM modulator. fR is the switching rate. fQ is the sampling rate. Note that fR=36*fQ, so this we don&#8217;t want a radix-2 FFT. Doing a radix-2 FFT would result in spectral leakage (and corrupt our SNR measurement).</p>
<pre>;Changes 1024 pts **************************************
ncyc = 1024;
kcyc = 512;
simtime = (ncyc+kcyc)/fR
fbin = fR/ncyc;
fin = 13*fbin;
bw = round(20E3/fbin)*fbin;</pre>
<p>I run the simulation for a total of $$\over{ncyc+kcyc}{fR}$$ cycles of fR. However, I throw away the first kcyc cycles to allow for startup transients.</p>
<pre>; procedures used in this script:
; write a command to matlab
procedure( writemat(mipc cmd )
  ipcWaitForProcess(mipc)
  ipcWriteProcess(mipc sprintf(nil "disp 'Executing %s'\n" cmd));
  ipcWaitForProcess(mipc)
  ipcWriteProcess(mipc sprintf(nil "%s\n" cmd));
  )</pre>
<p>This (above) is a little wrapper skill function that sends a command to Matlab. I made it so that it also displays the command being executed in Cadence (for debugging).</p>
<p>The following function computes the PSD by sending commands to Matlab</p>
<pre>; compute psd from matlab
procedure( matpsd( dumpfile fR ncs ncyc)
  let( (fin psdfile fswfile freqvec psdvec persist matlog)
    printf("Starting matlab to compute PSD\n")
    sprintf(matlog "%s.log" dumpfile)
    printf("Matlab log file: %s\n" matlog)
    workareadir = getShellEnvVar("WORKAREA_DIR")
    mipc = ipcBeginProcess(strcat("cd " workareadir "/matfft &#038;& matlab -nodisplay -logfile " matlog))
    writemat(mipc "clear all");
    writemat(mipc "global ncs dt fsw")
    writemat(mipc sprintf(nil "fsw = %g" fR));
    writemat(mipc sprintf(nil "ncs = %u" ncs));
    writemat(mipc sprintf(nil "ncyc = %u" ncyc));
    writemat(mipc "dt = 1/(fsw*ncs)");
    writemat(mipc sprintf(nil "[yout, xin] = readpwm('%s');" dumpfile))
    writemat(mipc "[Py, freq] = getpsd(sign(yout), ncs*fsw, ncs*ncyc);");
    sprintf(psdfile "%s.psd" dumpfile);
    writemat(mipc sprintf(nil "fout = fopen('%s', 'w')" psdfile))
    writemat(mipc "fprintf(fout, '%.12g %.12g\\n', [freq(:) Py(:)]')")
    writemat(mipc "fclose(fout)")
    writemat(mipc "exit");
    printf("Waiting for Matlab to finish");
    ; wait for matlab to finish:
    while( ipcIsAliveProcess(mipc)
      printf(".")
      ipcSleep(1)
    )
    fin = infile(psdfile);
    freqvec = nil;
    psdvec = nil
    printf("Reading results from Matlab\n");
    while( fscanf(fin "%f %f" frq psd)
      if(!freqvec then
        freqvec = drCreateVec('double list(frq))
      else
        drAddElem(freqvec frq);
      )
      if(!psdvec then
        psdvec = drCreateVec('double list(psd))
      else
        drAddElem(psdvec psd)
      )
    )
    close(fin);
    psdpwm = drCreateWaveform(freqvec psdvec)
  ) ; let
  psdpwm        ; return psdpwm
) ; procedure</pre>
<p>You&#8217;ll notice that the skill variables <em>are actually sent to matlab</em>, not hard-coded anywhere. So, changing the variable assignments in the skill/ocean file will be reflected in Matlab. Several Matlab helper functions are used:</p>
<ul>
<li>readpwm reads the text file</li>
<li>getpsd computes the psd
<ul>
<li>bh4 defines a minimum 4-term blackman-harris window; when I wrote this script, it was not available in Matlab</li>
<li></li>
</ul>
</li>
</ul>
<p>Each of these Matlab <code>.m</code> files are included in the attached tarball. In addition, I define a few Ocean/Skill helper functions:</p>
<p>sumpsd sums up spectral power over a frequency range (fstart to fend):</p>
<pre>procedure( sumpsd( psd fstart fend)
  if(fstart &lt; fend then
    integ( clip(psd fstart fend) )
  else
    0.0
  )
)</pre>
<p>getpow gets the spectral power of a tone centered at fc and takes into account spectral growth around fc by speclobew bins of the FFT:</p>
<pre>; get power of signal centered at fc
procedure( getpow( psd fc fbin )
  let( list( (speclobew 5) )
    sumpsd(psd fc-speclobew*fbin fc+speclobew*fbin)
  )
)</pre>
<p>Define simulator, output directory, etc:</p>
<pre>simulator( 'UltraSim )
resultsDir( strcat( wad "/simulation/" library "/" cell "/" view "/" simulator() ) )</pre>
<p>In case we want to use LSF for load-sharing:</p>
<pre>if(lsfqueue then
  hostMode( 'distributed )
else
  hostMode( 'local )
  )</pre>
<p>Define the test bench cell to be simulated (in read-only mode):</p>
<pre>design(	library cell view "r" )</pre>
<p>Define model files. Note that the <em>proc</em>,<em>cap</em>, etc. Skill variables are used:</p>
<pre>printf("$Revision: 1511 $ Using rev1e model files\n")
modelFile(
    list("/pdk_dir/amsmodels/spectre/rev1e.scs" "base")
    list("/pdk_dir/amsmodels/spectre/rev1e.scs" strcat(proc "_fet"))
    list("/pdk_dir/amsmodels/spectre/rev1e.scs" strcat(proc "_bjt"))
    list("/pdk_dir/amsmodels/spectre/rev1e.scs" strcat(cap  "_capacitor"))
    list("/pdk_dir/amsmodels/spectre/rev1e.scs" strcat(res  "_resistor"))
    list("/pdk_dir/amsmodels/spectre/rev1e.scs" strcat(proc "_diode"))
)</pre>
<p>Define the simulation time and analysis options:</p>
<pre>sprintf(sstop, "%.12g", simtime);
analysis('tran ?stop sstop  ?saveOP t  ?write "spectre.ic"
		?writefinal "spectre.fc"  ?method "gear2"  ?strobeperiod "1.0/fQ"  ?maxstepU "1.0/(16*fQ)"  )</pre>
<p>Define design variables. Note that these are assigned from the Skill variables, so changing just the skill variables at the top of the file propage down through the design netlist and into matlab</p>
<pre>desVar(	  "fR" fR	)
desVar(	  "vdd" 2.5	)
desVar(	  "vidc" vidc	)
desVar(	  "inputmag" inputmag	)
desVar(	  "fin" fin	)
desVar(	  "fQ" "36*fR"	)</pre>
<p>UltraSim simulation options:</p>
<pre>option(	'tol  "0.001"
	'dc  "spectre DC (3)"
	'scale  ""
	'wf_format  "PSF"
	'pn_method  "keep"
	'analog  "off"
	'speed  "Extreme Accuracy (1)"
	'sim_mode  "Analog (A)"
)

saveOption('UsimOptionDepth "20")
saveOption('UsimOptionAllAnalogNV t)
saveOption('UsimOptionProbeAnalog t)
temp( 27 )</pre>
<p>Actually run the simulation:</p>
<pre>; either this:
if(runit then
  startrun = getCurrentTime()
  if(lsfqueue then
    run( ?queue lsfqueue ?block t ?jobName jobname)
  else
    run()
  )
  endrun = getCurrentTime()
  runtime = compareTime(endrun, startrun);
  printf("Run took %d hours %d minutes %d seconds\n" floor(runtime/60/60) mod(floor(runtime/60), 60) mod(runtime, 60));
else
  openResults(resultsDir());
)
selectResults( 'tran )</pre>
<p>Dump out the time-domain file:</p>
<pre>if(dumpfile then
  printf("dumping to file %s\n" dumpfile)
  ocnPrint(v("/PWM_P")-v("/PWM_M") ?output dumpfile ?precision 12 ?numberNotation `none)
)</pre>
<p>Compute the PSD through Matlab</p>
<pre>if(plotpsd then
  psdpwm = matpsd( dumpfile fR ncs ncyc )
  ; PSig = sumpsd(psdpwm fin-5*fbin fin+5*fbin)     ; Signal Power
  PSig = getpow(psdpwm fin fbin)                                        ; Signal Power
  PND = sumpsd(psdpwm 0 min(bw fin-6*fbin)) + sumpsd(psdpwm fin+6*fbin bw) ; Noise Power
  PN = PND;
  exbw = 0;
  ; for SNR measurement, exclude odd-mode distortion
  ; from 3*fin to bw
  for( k 1 floor(bw/2/fin)
    fex1 = (2*k+1)*fin-5*fbin
    fex2 = min(bw (2*k+1)*fin+5*fbin)
    psdex = sumpsd(psdpwm fex1 fex2);
    ; printf("k = %u Excluding distortion from %f kHz to %f kHz (%g - %g)\n" 2*k+1 fex1 fex2 PN psdex)
    PN = PN - psdex;
    exbw = exbw + (fex2-fex1);
    ; printf("Excluding distortion from %f kHz to %f kHz (%f kHz)\n" fex1/1.0k fex2/1.0k (fex2-fex1)/1.0k);
  )
  PN = PN / (1 - exbw/bw)           ;compensate for frequencies we have excluded
                                    ;(assuming white noise)
  SNDR = PSig/PND;
  SNR = PSig/PN;
  SNDRdB = db10(SNDR);
  SNRdB = db10(SNR);
  printf("SNDR [%s/%s/%s]= %.2f dB\n" library cell view SNDRdB);
  printf("SNR [%s/%s/%s]= %.2f dB\n" library cell view SNRdB);
  sprintf(wintitle "PSD of Digitized PWM [%s/%s/%s] SNDR = %.0f dB NSR = %.0f dB" library cell view SNDRdB SNRdB)
  plot(db10(clip(psdpwm, fin-5*fbin, fin+5*fbin)) db10(psdpwm) ?expr list("Desired Signal" wintitle))
  xLimit(list(0 bw))
)</pre>
<p>I use <a title="VI Improved: my text editor of choice (but definitely not for everyone)" href="http://www.vim.org/" target="_blank">vim</a> <img src='http://www.circuitdesign.info/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre>; vim: ft=ocean</pre>
<h3>ReadPWM</h3>
<p>This little matlab function reads the text file and assigns variables in Matlab:</p>
<pre>function [yout, xin] = readpwm(filename)
  [time, pwm, xin] = textread(filename, '%f %f %f', -1, 'headerlines', 5);
  yout = pwm;</pre>
<h3>GetPSD</h3>
<p>This matlab function gets the PSD from the time-domain data:</p>
<pre>% function [ypsd, freq] = getpsd(x, fs, [psdlen])
%   return psd ypsd and frequency scaling of signal x
%   with sample rate fs and psd length psdlen.
%   copied from getpsd.m
function [ypsd, freq] = getpsd(x, fs, psdlen)
  x = x(:)';
  if(nargin > 2)
    if(psdlen &lt; length(x))
      y = x(1:psdlen).*bh4(psdlen);
    else
      y = x .* bh4(length(x));
    end
  end
  ypsd = abs(psd(y, psdlen)).^2;
  freq = (0:psdlen-1)*fs/psdlen;</pre>
<p>Note that it also does the limiting function (using only the last <em>psdlen</em> values in the time-domain data).</p>
<h3>BH4</h3>
<p>Minimum 4-term blackman-harris window:</p>
<pre>function [bh] = bh4(N)
% w = bh4(N)
%
%    Generates Blackman-Harris window of length N
%
a0=0.35875;
a1=0.48829;
a2=0.14128;
a3=0.01168;
theta = (0:N-1)*2*pi/N;
bh=a0-a1*cos(theta)+a2*cos(2*theta)-a3*cos(3*theta);</pre>
<h3>The Tarball</h3>
<p>All the above scripts are contained <a rel="attachment wp-att-649" href="http://www.circuitdesign.info/blog/2009/01/non-radix-2-fft-in-cadenceoceanskillspectre-using-cadenc-ipc-to-talk-to-matlab-or-anything-else/matfft/">matfft</a>.</p>
<h2>IPC</h2>
<p>All of the above was done using Cadence IPC. This is basically a set of functions that let you remote-control another command. The standard input/output (stdin/stdout) of the child process is connected to the Cadence instance. Using ipcReadProcess in Cadence reads the child&#8217;s stdout. Using ipcWriteProcess writes to the child&#8217;s stdout. In theory, one could run any Matlab program from Cadence using this method.</p>
<p>However, one could read/write to <em>any</em> text-mode program using this method. For a while, I thought about using <a title="Open-source C FFT libraries" href="http://www.fftw.org/" target="_blank">FFTW</a> and coding a small C program to compute the above FFT&#8217;s. The same C program could be controlled using IPC. However, I wasn&#8217;t getting paid to program (<a title="I'm programming now, since I'm moving into software" href="http://poojanblog.com/blog/2008/11/im-leaving-motorola/" target="_blank">at the time</a>), and I already had most of the functions already in Matlab.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.circuitdesign.info/blog/2009/01/non-radix-2-fft-in-cadenceoceanskillspectre-using-cadenc-ipc-to-talk-to-matlab-or-anything-else/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.circuitdesign.info/blog/2009/01/non-radix-2-fft-in-cadenceoceanskillspectre-using-cadenc-ipc-to-talk-to-matlab-or-anything-else/&amp;title=Non-Radix-2+FFT+in+Cadence%2FOcean%2FSkill%2FSpectre+%7C+Using+Cadence+IPC+to+talk+to+Matlab+%28or+anything+else%29" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.circuitdesign.info/blog/2009/01/non-radix-2-fft-in-cadenceoceanskillspectre-using-cadenc-ipc-to-talk-to-matlab-or-anything-else/&amp;title=Non-Radix-2+FFT+in+Cadence%2FOcean%2FSkill%2FSpectre+%7C+Using+Cadence+IPC+to+talk+to+Matlab+%28or+anything+else%29" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.circuitdesign.info/blog/2009/01/non-radix-2-fft-in-cadenceoceanskillspectre-using-cadenc-ipc-to-talk-to-matlab-or-anything-else/&amp;title=Non-Radix-2+FFT+in+Cadence%2FOcean%2FSkill%2FSpectre+%7C+Using+Cadence+IPC+to+talk+to+Matlab+%28or+anything+else%29&amp;desc=Introduction%0D%0AI%20had%20been%20working%20on%20a%20pulse-width-modulation%20%28PWM%29%20design.%20It%20was%20a%20pseudo-digital%20implementation%2C%20in%20that%20the%20output%20was%20clocked%20by%20a%20high-speed%20clock.%20The%20actual%20switching%20rate%20was%20much%20lower%20than%20this%20clock.%20I%20wanted%20to%20simulate%20this%20design%20in%20Cadence%2FSpectre%20by%20running%20a%20transien" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.circuitdesign.info/blog/2009/01/non-radix-2-fft-in-cadenceoceanskillspectre-using-cadenc-ipc-to-talk-to-matlab-or-anything-else/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.circuitdesign.info/blog/2009/01/non-radix-2-fft-in-cadenceoceanskillspectre-using-cadenc-ipc-to-talk-to-matlab-or-anything-else/&amp;bm_description=Non-Radix-2+FFT+in+Cadence%2FOcean%2FSkill%2FSpectre+%7C+Using+Cadence+IPC+to+talk+to+Matlab+%28or+anything+else%29&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.circuitdesign.info/blog/2009/01/non-radix-2-fft-in-cadenceoceanskillspectre-using-cadenc-ipc-to-talk-to-matlab-or-anything-else/&amp;title=Non-Radix-2+FFT+in+Cadence%2FOcean%2FSkill%2FSpectre+%7C+Using+Cadence+IPC+to+talk+to+Matlab+%28or+anything+else%29" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.circuitdesign.info/blog/2009/01/non-radix-2-fft-in-cadenceoceanskillspectre-using-cadenc-ipc-to-talk-to-matlab-or-anything-else/&amp;title=Non-Radix-2+FFT+in+Cadence%2FOcean%2FSkill%2FSpectre+%7C+Using+Cadence+IPC+to+talk+to+Matlab+%28or+anything+else%29" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.circuitdesign.info/blog/2009/01/non-radix-2-fft-in-cadenceoceanskillspectre-using-cadenc-ipc-to-talk-to-matlab-or-anything-else/&amp;title=Non-Radix-2+FFT+in+Cadence%2FOcean%2FSkill%2FSpectre+%7C+Using+Cadence+IPC+to+talk+to+Matlab+%28or+anything+else%29" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.circuitdesign.info/blog/2009/01/non-radix-2-fft-in-cadenceoceanskillspectre-using-cadenc-ipc-to-talk-to-matlab-or-anything-else/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Non-Radix-2+FFT+in+Cadence%2FOcean%2FSkill%2FSpectre+%7C+Using+Cadence+IPC+to+talk+to+Ma%5B..%5D+-+http://www.circuitdesign.info/z&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.circuitdesign.info/blog/2009/01/non-radix-2-fft-in-cadenceoceanskillspectre-using-cadenc-ipc-to-talk-to-matlab-or-anything-else/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
