{"id":7074,"date":"2022-06-26T21:01:04","date_gmt":"2022-06-26T19:01:04","guid":{"rendered":"https:\/\/www.tonmeister.ca\/wordpress\/?p=7074"},"modified":"2022-07-06T15:45:28","modified_gmt":"2022-07-06T13:45:28","slug":"filters-and-ringing-part-3","status":"publish","type":"post","link":"https:\/\/www.tonmeister.ca\/wordpress\/2022\/06\/26\/filters-and-ringing-part-3\/","title":{"rendered":"Filters and Ringing: Part 3"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Now we&#8217;ve seen that if we have a filter that results in either a peak or a dip in the magnitude response, we&#8217;ll also result in the signal ringing in time. We&#8217;ve also seen that the frequency of the ringing is the centre frequency of the filter. Now let&#8217;s dig a little deeper into the behaviour of that ringing; or, more specifically its decay characteristics.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;ll repeat the process from Part 2: measure the impulse response of a peaking filter where Fc = 1 kHz, gain = +12 dB, and Q = 2. However, this time I&#8217;ll look at the time response with a different scaling. Instead of plotting the linear value over time, I&#8217;ll convert each instantaneous value to dB and plot that. This looks like Figure 1.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_12dB_q2_ir_dB-1-1024x768.png\" alt=\"\" class=\"wp-image-7093\" srcset=\"https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_12dB_q2_ir_dB-1-1024x768.png 1024w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_12dB_q2_ir_dB-1-300x225.png 300w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_12dB_q2_ir_dB-1-768x576.png 768w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_12dB_q2_ir_dB-1.png 1120w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Fig 1. The same filter from Part 1, but now I&#8217;m plotting the impulse response on an instantaneous decibel scale.<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The important thing to notice here is that, when I plot the instantaneous amplitude in decibels (in other words, on a logarithmic scale), the decay is a straight line with a slope.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Let&#8217;s get two things out of the way here. This isn&#8217;t really decibels, because decibels requires some time averaging. Also, I&#8217;m actually plotting the absolute value of the impulse response in a decibel scale, because if I try to calculate the log of a negative number, things get ugly. This means that the math I&#8217;m actually using to create the bottom plot is <\/em><\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><em>20 * log10(abs(signal))<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If I draw a line across the tops of the bumps in that plot, I can look at the decay of the filter&#8217;s ringing as in Figure 2.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_12dB_q2_ir_dB_slope-1-1024x768.png\" alt=\"\" class=\"wp-image-7094\" srcset=\"https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_12dB_q2_ir_dB_slope-1-1024x768.png 1024w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_12dB_q2_ir_dB_slope-1-300x225.png 300w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_12dB_q2_ir_dB_slope-1-768x576.png 768w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_12dB_q2_ir_dB_slope-1.png 1120w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Fig 2. The blue line shows the decay rate of the filter&#8217;s ringing. In this particular case, the decay is about -1360 dB per second.<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">For this filter, the decay rate of the ringing is -1360 dB per second (which is very fast). Let&#8217;s change some parameters and see what happens.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If I increase the gain of the filter without changing the Fc or the Q, I get the following:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_20dB_q2_ir_dB_slope-1024x768.png\" alt=\"\" class=\"wp-image-7095\" srcset=\"https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_20dB_q2_ir_dB_slope-1024x768.png 1024w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_20dB_q2_ir_dB_slope-300x225.png 300w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_20dB_q2_ir_dB_slope-768x576.png 768w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_20dB_q2_ir_dB_slope.png 1120w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Fig 3. Changing the gain to +20 dB makes the ringing louder overall, but it decays at the same rate: about -1360 dB per second.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_12dB_q4_ir_dB_slope-1024x768.png\" alt=\"\" class=\"wp-image-7096\" width=\"840\" height=\"630\" srcset=\"https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_12dB_q4_ir_dB_slope-1024x768.png 1024w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_12dB_q4_ir_dB_slope-300x225.png 300w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_12dB_q4_ir_dB_slope-768x576.png 768w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/1khz_12dB_q4_ir_dB_slope.png 1120w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><figcaption>Fig 4. Fc = 1 kHz, Gain = +12 dB, Q = 4. Now the decay of the ringing is about -680 dB \/ second.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/2khz_12dB_q2_ir_dB_slope-1024x768.png\" alt=\"\" class=\"wp-image-7097\" srcset=\"https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/2khz_12dB_q2_ir_dB_slope-1024x768.png 1024w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/2khz_12dB_q2_ir_dB_slope-300x225.png 300w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/2khz_12dB_q2_ir_dB_slope-768x576.png 768w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/2khz_12dB_q2_ir_dB_slope.png 1120w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Fig 5. Fc = 2 kHz, Gain = +12 dB, Q = 2. Now the decay of the ringing is about -2720 dB \/ second.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I could plot lots more of these so that you start to see a pattern, but I&#8217;ll jump to the punch lines and you can use the plots above to check that things make sense.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If I have a filter that is using a definition of Q = Fc \/ BW (where BW is the distance between the -3 dB points down from the maximum), then:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Changing the gain does not change the rate of the decay (all least, as long as it&#8217;s a boost, according to what we&#8217;ve seen so far&#8230;)<\/li><li>Changing the Q will change the slope of the decay inversely proportionally if we&#8217;re measuring the slope in dB\/sec. For example, if I multiply the Q by 2, the ringing decays twice as slowly. If I multiply the Q by 10, the ringing will take 10 times longer to decay to the same level.<\/li><li>Changing the frequency will change the slope of the decay proportionally if we&#8217;re measuring the slope in dB\/sec. For example, if I multiply the frequency by 2, the ringing will decay twice as fast.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s talk about the last of these first, since it&#8217;s the easiest to understand conceptually. In the plots above, I&#8217;m showing the time in seconds. So, the higher the frequency, the more cycles I&#8217;m showing in the same plot. However, if I were plotting time in cycles of the cosine wave instead, the slope would be the same regardless of frequency.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In other words, the level of the ringing decays by the same amount <em>per number of cycles of the cosine wave<\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is why, if you count the number of &#8220;bumps&#8221; in the dB plots in Figure 2 and 5, you&#8217;ll see that they are the same number. It takes about 12 cycles to get down to -100 dB, but the shorter the cycles (because the frequency is higher) the faster you get there when measuring in seconds. If the X-axis were not &#8220;Time in milliseconds&#8221;, but &#8220;Time in periods of the centre frequency&#8221; instead, then the slopes would be identical in Figures 2 and 5.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now we&#8217;ve seen that if we have a filter that results in either a peak or a dip in the magnitude response, we&#8217;ll also result in the signal ringing in time. We&#8217;ve also seen that the frequency of the ringing is the centre frequency of the filter. Now let&#8217;s dig a little deeper into the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_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},"jetpack_post_was_ever_published":false},"categories":[33,63,4,59],"tags":[],"class_list":["post-7074","post","type-post","status-publish","format-standard","hentry","category-acoustics","category-analysis","category-audio","category-digital-audio"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p48hIM-1Q6","_links":{"self":[{"href":"https:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/posts\/7074","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/comments?post=7074"}],"version-history":[{"count":14,"href":"https:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/posts\/7074\/revisions"}],"predecessor-version":[{"id":7121,"href":"https:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/posts\/7074\/revisions\/7121"}],"wp:attachment":[{"href":"https:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/media?parent=7074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/categories?post=7074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/tags?post=7074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}