{"id":1402,"date":"2019-02-16T23:29:58","date_gmt":"2019-02-17T07:29:58","guid":{"rendered":"http:\/\/wonghoi.humgar.com\/blog\/?page_id=1402"},"modified":"2019-02-16T23:48:36","modified_gmt":"2019-02-17T07:48:36","slug":"oversimplified-signals-and-systems-5-5-computing-convolution","status":"publish","type":"page","link":"https:\/\/wonghoi.humgar.com\/blog\/oversimplified-signals-and-systems-5-5-computing-convolution\/","title":{"rendered":"Oversimplified: Signals and Systems (5.5) \u2013 Computing convolution"},"content":{"rendered":"<p>As far as computing convolution is concerned, it turns out if you are doing discrete time convolution of finite number of samples by hand, the most intuitive way: copy-scale-paste perspective is the easiest. It&#8217;s done exactly the same way as your grade school <a href=\"https:\/\/en.wikipedia.org\/wiki\/Sch%C3%B6nhage%E2%80%93Strassen_algorithm#Convolutions\">long multiplication<\/a> except you don&#8217;t do any carries.<\/p>\n<p>I recommend ignoring flip-and-drag in the traditional teaching approach in signals and systems. It is a variable renaming trick that has no context associated with it whatsoever. It is counter-intuitive because it involves switching the roles between time (<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/ql-cache\/quicklatex.com-fd9cb27edab3f0a8a249bc80cc9c6ee2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#116;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"6\" style=\"vertical-align: 0px;\"\/>) and delay (<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/ql-cache\/quicklatex.com-2d0f4e922bf6aa03f0b4a3128b5a72d5_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#116;&#97;&#117;\" title=\"Rendered by QuickLaTeX.com\" height=\"8\" width=\"10\" style=\"vertical-align: 0px;\"\/>) in your head.<\/p>\n<p>Flip-and-drag might be the only approach <strong>ONLY IF<\/strong> the signal is described in the form of functions where you have uncountable (continuous time) or infinite number of time spots to work on <strong>AND<\/strong>:<\/p>\n<ul>\n<li>you haven&#8217;t learned <a href=\"https:\/\/wonghoi.humgar.com\/blog\/oversimplified-signals-and-systems-7-what-are-transforms\/\">transforms<\/a> yet<\/li>\n<li>you don&#8217;t have a\u00a0<a href=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2019\/02\/media_037_0375e9ad-5890-443d-b7cd-29f660fb028d_phpCB4xMb.png\">convolution table<\/a>\u00a0(like the ones provided by B.P. Lathi&#8217;s textbook)\u00a0with you<\/li>\n<li>you don&#8217;t know how to break your signal into <a href=\"https:\/\/wonghoi.humgar.com\/blog\/oversimplified-signals-and-systems-6-common-signal-building-blocks\/\">commonly used building blocks<\/a> to take advantage of the above<\/li>\n<\/ul>\n<p>There is no place for flip-and-drag at all elsewhere. If you see anybody teaching flip-and-drag for a stream of numbers (typically presented by sliding a tape against another), it&#8217;s just the dogma of the earlier generations that hasn&#8217;t been challenged yet.<\/p>\n<hr \/>\n<p style=\"text-align: center;\">RANT<\/p>\n<p>People just accepted signal processing is hard and have not\u00a0even wondered if it was because the curriculum was poorly designed. I won&#8217;t be surprised if more than half of the students who did well in the class did not get all the essence: they\u00a0made it because they were able to churn out answer in the hard way faster.<\/p>\n<p>Flip and drag is basically a torture device to show you how miserable it is to compute convolution\u00a0so you&#8217;ll appreciate the <a href=\"https:\/\/wonghoi.humgar.com\/blog\/oversimplified-signals-and-systems-7-what-are-transforms\/\">transform methods<\/a> (to be taught) later.\u00a0Typically, the kind of problems that corner you to use flip-and-drag only appears on mid-terms. The same problems might appear on finals, but you are expected to use transform methods to do it. This\u00a0is how sadistical signal processing (the old approach) rolls: they beat you up first then throw you a bone.<\/p>\n<hr \/>\n<p>I never remembered the convolution table, simply because if you look closely (in hindsight after learning transforms), pretty much all of them are mash-ups of <a href=\"https:\/\/wonghoi.humgar.com\/blog\/oversimplified-signals-and-systems-6-common-signal-building-blocks\/\">commonly used building blocks<\/a> with a few transform properties. I really doubt if the table was worked it out from doing the flip-and-drag integral.<\/p>\n<p>The bottom line is that flip-and-drag has no educational or computational value whatsoever. Just study ahead and dodge it with all the tricks that shows up later in the course, or just leave them as the last problems to attack if flip-and-drag is the only option you have.<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_1402\" class=\"pvc_stats all  \" data-element-id=\"1402\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>As far as computing convolution is concerned, it turns out if you are doing discrete time convolution of finite number of samples by hand, the most intuitive way: copy-scale-paste perspective is the easiest. It&#8217;s done exactly the same way as &hellip; <a href=\"https:\/\/wonghoi.humgar.com\/blog\/oversimplified-signals-and-systems-5-5-computing-convolution\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_1402\" class=\"pvc_stats all  \" data-element-id=\"1402\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"footnotes":""},"class_list":["post-1402","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/pages\/1402","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/comments?post=1402"}],"version-history":[{"count":10,"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/pages\/1402\/revisions"}],"predecessor-version":[{"id":1419,"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/pages\/1402\/revisions\/1419"}],"wp:attachment":[{"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/media?parent=1402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}