{"id":7126,"date":"2022-07-06T17:28:09","date_gmt":"2022-07-06T15:28:09","guid":{"rendered":"https:\/\/www.tonmeister.ca\/wordpress\/?p=7126"},"modified":"2022-07-06T17:48:15","modified_gmt":"2022-07-06T15:48:15","slug":"filters-and-ringing-part-4","status":"publish","type":"post","link":"https:\/\/www.tonmeister.ca\/wordpress\/2022\/07\/06\/filters-and-ringing-part-4\/","title":{"rendered":"Filters and Ringing: Part 4"},"content":{"rendered":"\n<p>Let&#8217;s put together a couple of things that were said in the last postings, which should help to support each other:<\/p>\n\n\n\n<p>A peak or a dip filter is created by adding a bandpass filter to a throughput, as shown in Figure 1.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"232\" src=\"https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/peak_dip_blocks.png\" alt=\"\" class=\"wp-image-7127\" srcset=\"https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/peak_dip_blocks.png 640w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/peak_dip_blocks-300x109.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><figcaption>Fig 1. The individual building blocks of a peak\/dip filter<\/figcaption><\/figure>\n<\/div>\n\n\n<p> To change from peak to dip, you switch the polarity of the bandpass portion by making the &#8220;gain&#8221; negative instead of positive. (In other words, you subtract the bandpass from the throughput instead of adding it). To change the gain of the peak\/dip filter, you change the gain of the bandpass portion. To change the Q of the peak\/dip, you change the Q of the bandpass.<\/p>\n\n\n\n<p>We also saw at the end of Part 3 that changing the gain does not change the rate of the decay.<\/p>\n\n\n\n<p>This should all come together nicely to make sense for the first of the three points. For example, since the bandpass portion is the part that&#8217;s ringing, and since changing the gain of the peak (or dip) is just a matter of changing the gain applied to the bandpass portion, then there is no reason why the decay rate of the ringing should change. It will start at a higher or lower level, but its decay slope will be the same.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Q vs Time<\/h2>\n\n\n\n<p>We also saw at the end of Part 3 that changing the Q will change the slope of the decay inversely proportionally, but that changing the frequency will change the slope of the decay proportionally.<\/p>\n\n\n\n<p>There is a nice little rule-of-thumb that&#8217;s used by electrical engineers for measuring the Q of a filter. Let&#8217;s say that you can&#8217;t (or couldn&#8217;t be bothered to take the time to) measure the frequency or magnitude response, and you want to figure out the Q based on the time response only, you can calculate this by looking at its impulse response.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/time_response.png\" alt=\"\" class=\"wp-image-7130\" width=\"759\" height=\"615\" srcset=\"https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/time_response.png 1012w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/time_response-300x243.png 300w, https:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/time_response-768x622.png 768w\" sizes=\"auto, (max-width: 759px) 100vw, 759px\" \/><figcaption>Fig 2. The time response of an unknown peaking filter. (You can tell it&#8217;s peaking because the ringing cosine wave starts above the 0 line, just like the initial impulse.)<\/figcaption><\/figure>\n<\/div>\n\n\n<p>For example, Figure 2 shows the initial part of the impulse response of an unknown filter. I&#8217;ve highlighted two points that are reasonably close to the tops of two of the cosine wave cycles. I picked the first one (on the left) and then noted its Y value (Y = 0.027). Then I found a top of another wave that was as close to half that value as I could find. You can see there that it&#8217;s 2 cycles later, where Y = 0.0149.<\/p>\n\n\n\n<p>So, you multiply the number of cycles it takes to drop by 50% (in this example, 2 cycles) and <strong>multiply that by 4.53<\/strong>, which results in a value of about 9. This is a good estimate of the Q of the filter (which is actually 10, if I measure it using the -3 dB points in the magnitude response).<\/p>\n\n\n\n<p>If you&#8217;d like to read the long version of this, check out <a href=\"https:\/\/www.giangrandi.ch\/electronics\/ringdownq\/ringdownq.shtml\">this page<\/a>.<\/p>\n\n\n\n<p>Note that it doesn&#8217;t matter which cycle I chose to get the first value, since the rate of decay is the same through the entire time response of the filter. In other words, if I chose the 3rd cycle to do the first measurement, I would have found that the 5th cycle is about 50% lower because it&#8217;s also 2 cycles later.<\/p>\n\n\n\n<p>It also doesn&#8217;t matter whether we&#8217;re talking about peaks or dips, since, as we already know, from a perspective of the individual building blocks of the filter, these are the same thing.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">So what?<\/h2>\n\n\n\n<p>Of course, most normal people aren&#8217;t measuring the time response of filters to calculate the Q. However, this piece of information is good from the opposite perspective: if you know the Q of the filter, you can figure out how fast it&#8217;s decaying. For example, a filter with a Q of 2 will take 2 \/ 4.53 = 0.44 cycles to decay by 50% (or 6 dB). If you know the frequency, then you can then translate that into a decay rate per seconds, because the period in seconds (the total time of one cycle of the wave) =  1 \/ Fc.<\/p>\n\n\n\n<p>So, if that filter with a Q of 2 has an Fc of 100 Hz, then the period is 1\/100 = 0.01 sec, and therefore it will decay by 6 dB (50%) in 0.44 cycles * 0.01 sec\/cycle = 0.0044 sec or 4.4 ms.<\/p>\n\n\n\n<p>If the Fc of the filter is 5 kHz, then the the period is 1\/5000 = 0.0002 sec, and therefore it will decay by 5 dB in 0.0002 * 0.44 = 0.000088 sec = 88 \u00b5sec. (This is roughly equivalent to 2 samples at 48 kHz.)<\/p>\n\n\n\n<p>Another good thing to remember is that Q = Fc \/ BW where BW is the bandwidth of the response measured between the two -3 dB points. This means, for example, that if Q = 1, then Fc = BW, therefore the bandwidth is about 1 octave. If Q = 2, then the bandwidth is about 1\/2 of an octave, if Q = 12 then the bandwidth is about 1 semitone (1\/12th of an octave), and so on.<\/p>\n\n\n\n<p> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s put together a couple of things that were said in the last postings, which should help to support each other: A peak or a dip filter is created by adding a bandpass filter to a throughput, as shown in Figure 1. To change from peak to dip, you switch the polarity of the bandpass [&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":[33,63,4,59,65],"tags":[],"class_list":["post-7126","post","type-post","status-publish","format-standard","hentry","category-acoustics","category-analysis","category-audio","category-digital-audio","category-measurements"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p48hIM-1QW","_links":{"self":[{"href":"https:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/posts\/7126","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=7126"}],"version-history":[{"count":6,"href":"https:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/posts\/7126\/revisions"}],"predecessor-version":[{"id":7136,"href":"https:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/posts\/7126\/revisions\/7136"}],"wp:attachment":[{"href":"https:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/media?parent=7126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/categories?post=7126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/tags?post=7126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}