{"id":451,"date":"2020-06-03T17:58:37","date_gmt":"2020-06-03T17:58:37","guid":{"rendered":"https:\/\/www.allendowney.com\/blog\/?p=451"},"modified":"2020-06-03T17:58:37","modified_gmt":"2020-06-03T17:58:37","slug":"think-dsp-v1-1","status":"publish","type":"post","link":"https:\/\/www.allendowney.com\/blog\/2020\/06\/03\/think-dsp-v1-1\/","title":{"rendered":"Think DSP v1.1"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">For the last week or so I have been working on an update to <em>Think DSP<\/em>.  The <a href=\"https:\/\/greenteapress.com\/wp\/think-dsp\/\">latest version is available now from Green Tea Press<\/a>.  Here are some of the changes I made:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Running on Colab<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">All notebooks now run on Colab.  Judging by my inbox, many readers find it challenging to download and run the code.  Running on Colab is a lot easier.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to try an example, <a href=\"https:\/\/colab.research.google.com\/github\/AllenDowney\/ThinkDSP\/blob\/master\/code\/chap01preview.ipynb\">here&#8217;s a preview of Chapter 1<\/a>.  And if you want to see where we&#8217;re headed, <a href=\"https:\/\/colab.research.google.com\/github\/AllenDowney\/ThinkDSP\/blob\/master\/code\/chap10preview.ipynb\">here\u2019s a preview of Chapter 10<\/a>.  You can <a href=\"http:\/\/allendowney.github.io\/ThinkDSP\/\">get to the rest of the notebooks from here<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">No more thinkplot<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">For the first edition, I used a module called <code>thinkplot<\/code> that provides functions that make it easier to use Matplotlib.  It also overrides some of the default options.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But since I wrote the first edition, Matplotlib has improved substantially.  I found I was able to eliminate <code>thinkplot<\/code> with minimal changes.  As a result, the code is simpler and the figures look better.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Still using thinkdsp<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">I provide a module called <code>thinkdsp<\/code> that contains classes and functions used throughout the book.  I think this module is good for learners.  It lets me hide details that would otherwise be distracting.  It lets me present some topics &#8220;top-down&#8221;, meaning that we learn how to use some features before we know how they work.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And when you learn the API provided by <code>thinkdsp<\/code>, you are also learning about DSP.  For example, <code>thinkdsp<\/code> provides classes called Signal, Wave, and Spectrum.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A Signal represents a continuous function; a Wave represents a sequence of discrete samples.  So Signal provides make_wave, but Wave does not provide make_signal.  When you use this API, you understand implicitly that this is a one-way operation: you can sample a Signal to get a Wave, but you cannot recover a Signal from a Wave.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On the other hand, you can convert from Wave to Spectrum and from Spectrum to Wave, which implies (correctly) that they are equivalent representations of the same information.  Given one, you can compute the other.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I realize that not everyone loves it when a book uses a custom library like <code>thinkdsp<\/code>.  When <a href=\"https:\/\/www.amazon.com\/gp\/customer-reviews\/RAV2OUFIMDK0M\/ref=cm_cr_arp_d_rvw_ttl?ie=UTF8&amp;ASIN=1491938455\">people don&#8217;t like<\/a> <em>Think DSP<\/em>, this is the most common reason.   But looking at <code>thinkdsp<\/code> with fresh eyes, I am doubling down; I still think it&#8217;s a good way to learn.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Less object-oriented<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Nevertheless, I found a few opportunities to simplify the code, and in particular to make it less object-oriented.  I generally like OOP, but I acknowledge that there are drawbacks.  One of the biggest is that it can be hard to keep an inheritance hierarchy in your head and easy to lose track of what classes provide which methods.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I still think the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Template_method_pattern\">template pattern<\/a> is a good way to present a framework: the parent class provides the framework and child classes fill in the details.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, based on feedback from readers, I have come to realize that object-oriented programming is not as universally known and loved as I assumed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In several places I found that I could eliminate object-oriented features and simplify the code without losing explanatory power.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Pretty, pretty good<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Coming back to this book after some time, I think it&#8217;s pretty good.  If you are interested in digital signal processing, I think the computation-first approach is a good way to get started.  And if you are not interested in digital signal processing, maybe I can change your mind!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here are the links again:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Here&#8217;s <a href=\"https:\/\/greenteapress.com\/wp\/think-dsp\/\">the latest version from Green Tea Press<\/a>. <\/li><li><a href=\"https:\/\/colab.research.google.com\/github\/AllenDowney\/ThinkDSP\/blob\/master\/code\/chap01preview.ipynb\">Here&#8217;s a preview of Chapter 1<\/a>.  that you can run in a browser.<\/li><li>And <a href=\"https:\/\/colab.research.google.com\/github\/AllenDowney\/ThinkDSP\/blob\/master\/code\/chap10preview.ipynb\">here\u2019s a preview of Chapter 10<\/a>.  <\/li><li>You can <a href=\"http:\/\/allendowney.github.io\/ThinkDSP\/\">get to the rest of the notebooks from here<\/a>.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For the last week or so I have been working on an update to Think DSP. The latest version is available now from Green Tea Press. Here are some of the changes I made: Running on Colab All notebooks now run on Colab. Judging by my inbox, many readers find it challenging to download and run the code. Running on Colab is a lot easier. If you want to try an example, here&#8217;s a preview of Chapter 1. And if&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.allendowney.com\/blog\/2020\/06\/03\/think-dsp-v1-1\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","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_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_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":[1],"tags":[72,73,16,74],"class_list":["post-451","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-digital-signal-processing","tag-dsp","tag-python","tag-think-dsp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Think DSP v1.1 - Probably Overthinking It<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.allendowney.com\/blog\/2020\/06\/03\/think-dsp-v1-1\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Think DSP v1.1 - Probably Overthinking It\" \/>\n<meta property=\"og:description\" content=\"For the last week or so I have been working on an update to Think DSP. The latest version is available now from Green Tea Press. Here are some of the changes I made: Running on Colab All notebooks now run on Colab. Judging by my inbox, many readers find it challenging to download and run the code. Running on Colab is a lot easier. If you want to try an example, here&#8217;s a preview of Chapter 1. And if... Read More Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.allendowney.com\/blog\/2020\/06\/03\/think-dsp-v1-1\/\" \/>\n<meta property=\"og:site_name\" content=\"Probably Overthinking It\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-03T17:58:37+00:00\" \/>\n<meta name=\"author\" content=\"Allen B. Downey\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@AllenDowney\" \/>\n<meta name=\"twitter:site\" content=\"@AllenDowney\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Allen B. Downey\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2020\\\/06\\\/03\\\/think-dsp-v1-1\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2020\\\/06\\\/03\\\/think-dsp-v1-1\\\/\"},\"author\":{\"name\":\"Allen B. Downey\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#\\\/schema\\\/person\\\/4e5bfb2e9af6c3446cb0031a7bf83207\"},\"headline\":\"Think DSP v1.1\",\"datePublished\":\"2020-06-03T17:58:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2020\\\/06\\\/03\\\/think-dsp-v1-1\\\/\"},\"wordCount\":620,\"publisher\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#\\\/schema\\\/person\\\/4e5bfb2e9af6c3446cb0031a7bf83207\"},\"keywords\":[\"digital signal processing\",\"DSP\",\"python\",\"Think DSP\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2020\\\/06\\\/03\\\/think-dsp-v1-1\\\/\",\"url\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2020\\\/06\\\/03\\\/think-dsp-v1-1\\\/\",\"name\":\"Think DSP v1.1 - Probably Overthinking It\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#website\"},\"datePublished\":\"2020-06-03T17:58:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2020\\\/06\\\/03\\\/think-dsp-v1-1\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2020\\\/06\\\/03\\\/think-dsp-v1-1\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2020\\\/06\\\/03\\\/think-dsp-v1-1\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Think DSP v1.1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/\",\"name\":\"Probably Overthinking It\",\"description\":\"Data science, Bayesian Statistics, and other ideas\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#\\\/schema\\\/person\\\/4e5bfb2e9af6c3446cb0031a7bf83207\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#\\\/schema\\\/person\\\/4e5bfb2e9af6c3446cb0031a7bf83207\",\"name\":\"Allen B. Downey\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/probably_logo.png\",\"url\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/probably_logo.png\",\"contentUrl\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/probably_logo.png\",\"width\":714,\"height\":784,\"caption\":\"Allen B. Downey\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/probably_logo.png\"},\"sameAs\":[\"https:\\\/\\\/www.allendowney.com\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/allendowney\\\/\",\"https:\\\/\\\/x.com\\\/AllenDowney\",\"https:\\\/\\\/github.com\\\/AllenDowney\",\"https:\\\/\\\/bsky.app\\\/profile\\\/allendowney.bsky.social\",\"https:\\\/\\\/allendowney.github.io\\\/Portfolio\\\/\",\"https:\\\/\\\/greenteapress.com\\\/wp\\\/\"],\"url\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/author\\\/allen-downey\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Think DSP v1.1 - Probably Overthinking It","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.allendowney.com\/blog\/2020\/06\/03\/think-dsp-v1-1\/","og_locale":"en_US","og_type":"article","og_title":"Think DSP v1.1 - Probably Overthinking It","og_description":"For the last week or so I have been working on an update to Think DSP. The latest version is available now from Green Tea Press. Here are some of the changes I made: Running on Colab All notebooks now run on Colab. Judging by my inbox, many readers find it challenging to download and run the code. Running on Colab is a lot easier. If you want to try an example, here&#8217;s a preview of Chapter 1. And if... Read More Read More","og_url":"https:\/\/www.allendowney.com\/blog\/2020\/06\/03\/think-dsp-v1-1\/","og_site_name":"Probably Overthinking It","article_published_time":"2020-06-03T17:58:37+00:00","author":"Allen B. Downey","twitter_card":"summary_large_image","twitter_creator":"@AllenDowney","twitter_site":"@AllenDowney","twitter_misc":{"Written by":"Allen B. Downey","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.allendowney.com\/blog\/2020\/06\/03\/think-dsp-v1-1\/#article","isPartOf":{"@id":"https:\/\/www.allendowney.com\/blog\/2020\/06\/03\/think-dsp-v1-1\/"},"author":{"name":"Allen B. Downey","@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207"},"headline":"Think DSP v1.1","datePublished":"2020-06-03T17:58:37+00:00","mainEntityOfPage":{"@id":"https:\/\/www.allendowney.com\/blog\/2020\/06\/03\/think-dsp-v1-1\/"},"wordCount":620,"publisher":{"@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207"},"keywords":["digital signal processing","DSP","python","Think DSP"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.allendowney.com\/blog\/2020\/06\/03\/think-dsp-v1-1\/","url":"https:\/\/www.allendowney.com\/blog\/2020\/06\/03\/think-dsp-v1-1\/","name":"Think DSP v1.1 - Probably Overthinking It","isPartOf":{"@id":"https:\/\/www.allendowney.com\/blog\/#website"},"datePublished":"2020-06-03T17:58:37+00:00","breadcrumb":{"@id":"https:\/\/www.allendowney.com\/blog\/2020\/06\/03\/think-dsp-v1-1\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.allendowney.com\/blog\/2020\/06\/03\/think-dsp-v1-1\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.allendowney.com\/blog\/2020\/06\/03\/think-dsp-v1-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.allendowney.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Think DSP v1.1"}]},{"@type":"WebSite","@id":"https:\/\/www.allendowney.com\/blog\/#website","url":"https:\/\/www.allendowney.com\/blog\/","name":"Probably Overthinking It","description":"Data science, Bayesian Statistics, and other ideas","publisher":{"@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.allendowney.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207","name":"Allen B. Downey","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png","url":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png","contentUrl":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png","width":714,"height":784,"caption":"Allen B. Downey"},"logo":{"@id":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png"},"sameAs":["https:\/\/www.allendowney.com\/","https:\/\/www.linkedin.com\/in\/allendowney\/","https:\/\/x.com\/AllenDowney","https:\/\/github.com\/AllenDowney","https:\/\/bsky.app\/profile\/allendowney.bsky.social","https:\/\/allendowney.github.io\/Portfolio\/","https:\/\/greenteapress.com\/wp\/"],"url":"https:\/\/www.allendowney.com\/blog\/author\/allen-downey\/"}]}},"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/451","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/comments?post=451"}],"version-history":[{"count":3,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/451\/revisions"}],"predecessor-version":[{"id":457,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/451\/revisions\/457"}],"wp:attachment":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/media?parent=451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/categories?post=451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/tags?post=451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}