{"id":895,"date":"2012-02-19T09:59:09","date_gmt":"2012-02-19T15:59:09","guid":{"rendered":"https:\/\/www.circuitdesign.info\/blog\/?p=895"},"modified":"2012-02-19T09:59:09","modified_gmt":"2012-02-19T15:59:09","slug":"creating-a-nyquist-plot-with-cadence","status":"publish","type":"post","link":"https:\/\/www.circuitdesign.info\/blog\/2012\/02\/creating-a-nyquist-plot-with-cadence\/","title":{"rendered":"Creating a Nyquist plot with Cadence"},"content":{"rendered":"<p>Cadence has a stability analysis that returns loop gain (return ratio). Typically, this is done using a log sweep of frequency. The reason is that doing a uniform linear sweep results in too large frequency steps for low frequencies and\/or too large of a step for higher frequencies.<\/p>\n<p>Unfortunately, when you do a logarithmic sweep, you can&#8217;t cover from negative to positive frequencies&#8211;which is what you want when you generate a Nyquist plot. With the code below, you can reflect the positive frequencies onto negative to get the full Nyquist plot:<\/p>\n<code><br \/>\n; load &#8220;~\/cadence\/skill\/abConcatWaveforms.il&#8221;<br \/>\nlg = -getData(&#8220;loopGain&#8221; ?result &#8220;stb&#8221;)<br \/>\n; abConcatWaveforms externally defined<br \/>\nlg2 = abConcatWaveforms(flip(conjugate(lg)) lg)<br \/>\nw = newWindow()<br \/>\nocnYvsYplot(?wavex real(lg2) ?wavey imag(lg2))<br \/>\nstb_x = xmin(abs(lg2-complex(-1.0,0.0))**2)<br \/>\nstb_margin = value(lg2, stb_x)<br \/>\naddTitle(sprintf(nil &#8220;stb_margin = %f dB&#8221; -dB20(stb_margin)))<br \/>\nxLimit( list(-1.6 0.2) )<br \/>\nyLimit( list(-0.5 0.5) )<br \/>\n<\/code>\n<p>You&#8217;ll need <a title=\"comp.cad.cadence post by Andre Beckett\" href=\"http:\/\/groups.google.com\/group\/comp.cad.cadence\/msg\/d3f7db2d9b6fe793\" target=\"_blank\">Andrew Beckett&#8217;s abConcatWaveforms function<\/a> defined and loaded.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cadence has a stability analysis that returns loop gain (return ratio). Typically, this is done using a log sweep of frequency. The reason is that doing a uniform linear sweep results in too large frequency steps for low frequencies and\/or too large of a step for higher frequencies. Unfortunately, when you do a logarithmic sweep, [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[33,165,57,79,166,167],"class_list":["post-895","post","type-post","status-publish","format-standard","hentry","category-analog-pro","tag-cadence","tag-nyquist","tag-skill","tag-stability","tag-stb","tag-sweep"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/poCEy-er","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.circuitdesign.info\/blog\/wp-json\/wp\/v2\/posts\/895","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.circuitdesign.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.circuitdesign.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.circuitdesign.info\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.circuitdesign.info\/blog\/wp-json\/wp\/v2\/comments?post=895"}],"version-history":[{"count":4,"href":"https:\/\/www.circuitdesign.info\/blog\/wp-json\/wp\/v2\/posts\/895\/revisions"}],"predecessor-version":[{"id":915,"href":"https:\/\/www.circuitdesign.info\/blog\/wp-json\/wp\/v2\/posts\/895\/revisions\/915"}],"wp:attachment":[{"href":"https:\/\/www.circuitdesign.info\/blog\/wp-json\/wp\/v2\/media?parent=895"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.circuitdesign.info\/blog\/wp-json\/wp\/v2\/categories?post=895"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.circuitdesign.info\/blog\/wp-json\/wp\/v2\/tags?post=895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}