{"id":6784,"date":"2021-07-15T09:26:34","date_gmt":"2021-07-15T07:26:34","guid":{"rendered":"https:\/\/www.tonmeister.ca\/wordpress\/?p=6784"},"modified":"2021-07-15T09:26:34","modified_gmt":"2021-07-15T07:26:34","slug":"intuitive-z-plane-part-2-peaks-and-dips","status":"publish","type":"post","link":"http:\/\/www.tonmeister.ca\/wordpress\/2021\/07\/15\/intuitive-z-plane-part-2-peaks-and-dips\/","title":{"rendered":"Intuitive Z-plane: Part 2 &#8211; Peaks and Dips"},"content":{"rendered":"\n<p>Most digital filters that are applied to audio signals use a &#8220;basic&#8221; building block called a &#8220;biquadratic filter&#8221; or &#8220;biquad&#8221; which consists of 2 feed-forward delays and 2 feed-back delays, each with its own output gain and a delay time of 1 sample. I&#8217;ve already talked a little about biquads in <a href=\"https:\/\/www.tonmeister.ca\/wordpress\/2021\/06\/29\/high-res-audio-part-8b-filter-resolution\/\" data-type=\"post\" data-id=\"6658\">this posting<\/a>, where I showed a couple of different ways to implement it. One of the standard ways is shown below in Figure 1.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"487\" src=\"http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/06_direct_form_1_split-1024x487.png\" alt=\"\" class=\"wp-image-6669\" srcset=\"http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/06_direct_form_1_split-1024x487.png 1024w, http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/06_direct_form_1_split-300x143.png 300w, http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/06_direct_form_1_split-768x365.png 768w, http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/06_direct_form_1_split-1536x731.png 1536w, http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/06_direct_form_1_split.png 1669w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Figure 1: A biquad implemented using the &#8220;Direct Form 1&#8221; method.<\/figcaption><\/figure>\n\n\n\n<p>The signal flow that I drew for Figure 1 is a little more modular than the way it&#8217;s normally shown, but that&#8217;s to keep things separate for the purposes of this discussion.<\/p>\n\n\n\n<p>The two feed-forward delays add to the input signal (via gains b0, b1, and b2) and the result shows up at the red arrow. Remember from <a href=\"https:\/\/www.tonmeister.ca\/wordpress\/2021\/07\/15\/intuitive-z-plane-part-1\/\" data-type=\"post\" data-id=\"6765\">Part 1<\/a> that this portion of the biquad can only make a magnitude response that has (in an extreme case) infinitely deep, sharp <strong>dips<\/strong>, and smooth rounded <strong>peaks<\/strong>.<\/p>\n\n\n\n<p>The signal from the red arrow onwards goes into the feed-back portion of the filter with two feed-back delays adding through gains -a1 and -a2. Again, remember from <a href=\"https:\/\/www.tonmeister.ca\/wordpress\/2021\/07\/15\/intuitive-z-plane-part-1\/\">Part 1<\/a> that this portion of the biquad can make a magnitude response that has infinitely deep, sharp <strong>peaks<\/strong>, and smooth rounded <strong>dips<\/strong>.<\/p>\n\n\n\n<p>Let&#8217;s say that we wanted to make a simple filter &#8211; let&#8217;s make it a low pass filter &#8211; using this biquad. How do we do it?<\/p>\n\n\n\n<p>The simplest way is to cheat and go straight to the answer.<\/p>\n\n\n\n<p><strong>Cheating Option 1: <\/strong>You go to <a href=\"https:\/\/www.earlevel.com\/main\/2013\/10\/13\/biquad-calculator-v2\/\">this page at www.earlevel.com<\/a> and put in the parameters you&#8217;re interested in (Filter Type, sampling rate, Fc, Q, etc&#8230;) and copy-and-paste the resulting five gains (we&#8217;ll call them &#8220;<strong>coefficients<\/strong>&#8221; from now on).<\/p>\n\n\n\n<p><strong>Cheating Option 2:<\/strong> We <a href=\"https:\/\/lmgtfy.app\/?q=rbj+audio+cookbook\">search on the Interweb for the words &#8220;RBJ Audio Cookbook&#8221;<\/a> and then spend some time copying, pasting, and porting the equations that Robert Bristow-Johnson bestowed upon us many years ago* into your processor. You then say &#8220;I want a low pass filter at 1000 Hz with a Q of 0.5, please&#8221; and the equations spit out the five coefficients that you seek.<\/p>\n\n\n\n<p>However, if you cheat, you&#8217;ll never really get a grasp of how those coefficients work and what they&#8217;re really doing &#8211; and <em>that&#8217;s<\/em> where we&#8217;re headed in this little series of articles. So, you might decide to go through this series, and then cheat afterwards (that&#8217;s what I would recommend&#8230;)<\/p>\n\n\n\n<p>Now, before you go any further, I&#8217;ll warn you &#8211; the whole purpose of this series is to give you an <strong>intuitive<\/strong> understanding. This means that there are things I&#8217;m going to (intentionally) skip over, merely mention in passing, or omit completely. So, if you already know what I&#8217;m talking about, there&#8217;s no point in reading what I&#8217;m writing &#8211; and there&#8217;s certainly no need to email me to remind me that I didn&#8217;t mention some aspect of this that you think is important, but I&#8217;ve decided is not. If you feel strongly about this, write your own blog.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">P.S.<\/h2>\n\n\n\n<p>* Thanks, Robert!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most digital filters that are applied to audio signals use a &#8220;basic&#8221; building block called a &#8220;biquadratic filter&#8221; or &#8220;biquad&#8221; which consists of 2 feed-forward delays and 2 feed-back delays, each with its own output gain and a delay time of 1 sample. I&#8217;ve already talked a little about biquads in this posting, where I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,59,43,42],"tags":[],"class_list":["post-6784","post","type-post","status-publish","format-standard","hentry","category-audio","category-digital-audio","category-dsp","category-math"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p48hIM-1Lq","_links":{"self":[{"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/posts\/6784","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/comments?post=6784"}],"version-history":[{"count":3,"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/posts\/6784\/revisions"}],"predecessor-version":[{"id":6787,"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/posts\/6784\/revisions\/6787"}],"wp:attachment":[{"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/media?parent=6784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/categories?post=6784"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/tags?post=6784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}