{"id":29842,"date":"2023-04-24T13:43:32","date_gmt":"2023-04-24T20:43:32","guid":{"rendered":"https:\/\/digilent.com\/blog\/?p=29842"},"modified":"2023-04-24T13:44:17","modified_gmt":"2023-04-24T20:44:17","slug":"rapid-prototyping-of-a-pulse-height-detector-system","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/rapid-prototyping-of-a-pulse-height-detector-system\/","title":{"rendered":"Rapid Prototyping of a Pulse Height Detector System"},"content":{"rendered":"<p><span data-contrast=\"auto\">We\u2019ve been working with Pavel Demin, a research engineer based in Belgium, on several projects related to the Eclypse.\u202f<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">For the first, to demonstrate approaches to rapid prototyping, he put together a Jupyter Notebook that uses the Eclypse Z7 to detect the heights of a series of pulses applied to a Zmod Scope input. Python implementation of a signal processing algorithm like this is an easy first step to proving that the algorithm will perform how you want before taking the more complex and time-consuming step of implementing that same algorithm in FPGA fabric. The algorithm prototyped here, which performs pulse height analysis, is useful in several different systems and experiments, like optical particle counters and spectroscopy in nuclear physics. A histogram of the heights of 10,000 captured pulses is plotted. In these applications, this comparison might show you distributions of sizes of particles or of the energies of elementary particles, respectively, which gives meaningful information about the results of an experiment.\u202f<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<figure id=\"attachment_29845\" aria-describedby=\"caption-attachment-29845\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-29845 size-full\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2023\/04\/1-1.jpg\" alt=\"\" width=\"500\" height=\"243\" data-wp-pid=\"29845\" \/><figcaption id=\"caption-attachment-29845\" class=\"wp-caption-text\">The Eclypse Z7, set up in a loopback configuration to test the algorithm.<\/figcaption><\/figure>\n<p><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span data-contrast=\"auto\">The Jupyter Notebooks environment leverages WaveForms SDK to control the Eclypse. It uses the Micromamba plugin to allow Jupyter Notebooks to be run entirely within VS Code, across various host operating systems. Two scripts are included. The first generates a sine wave and reads it back as a quick confirmation that the notebook works as intended. The second script implements the pulse height measurement algorithm described above. Using the AWG, it generates a chain of pulses which are used to stimulate a circuit under test. The generated pulses are captured by the Scope and are passed through a prototype peak detection algorithm, which could later be implemented in FPGA fabric. Results of running 10k pulses through this system are plotted in histogram form, leveraging Python\u2019s matplotlib library to visualize this data and generate several other diagrams easily. Using Python in this way lets you easily test out a concept in a matter of minutes, well before implementing the same algorithm in hardware.\u202f<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\"> <img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-29846 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2023\/04\/2-600x402.png\" alt=\"\" width=\"600\" height=\"402\" data-wp-pid=\"29846\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2023\/04\/2-600x402.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2023\/04\/2-1024x685.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2023\/04\/2.png 1273w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/span><\/p>\n<p><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-29850 size-medium\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2023\/04\/3-cropped-600x402.png\" alt=\"\" width=\"600\" height=\"402\" data-wp-pid=\"29850\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2023\/04\/3-cropped-600x402.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2023\/04\/3-cropped-1024x686.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2023\/04\/3-cropped.png 1259w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><br \/>\n<\/span><\/p>\n<p><span data-contrast=\"auto\">But if you can do the measurements easily using Python, why would you want to implement it in an FPGA? There\u2019s always the case where you\u2019re designing your own product and don\u2019t want to include an entire dev kit in the final shipped design. Outside of that, by leveraging FPGA fabric differently than WaveForms for Eclypse does, you can greatly speed up your system: to naively show this, a test run measuring 10,000 pulses using the scripts described here takes 20+ seconds, while the actual frequency at which pulses are generated is 10,000 pulses per second; a dedicated FPGA-based pulse height measurement system would easily be able to measure and record all of these pulses in real-time. If you wanted to measure many more pulses more quickly, you could use this pulse height analysis algorithm to greatly decrease the amount of data that you might need to save \u2013 processing data early, in the FPGA, on the edge, saves vast amounts of data transfer capacity further up the chain. Of course, to do so, you need to be sure precisely what processing you want to apply to the data, and that\u2019s where prototyping comes in.\u202f<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span data-contrast=\"auto\">That said, if the performance of the Eclypse Z7 with WaveForms SDK is sufficient for your needs on its own, it could just be the complete solution you\u2019re looking for.\u202f<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><span data-contrast=\"auto\">Check out the code here: <a href=\"https:\/\/github.com\/pavel-demin\/waveforms-notebooks\">https:\/\/github.com\/pavel-demin\/waveforms-notebooks\u202f<\/a><\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">As the next step, Pavel implemented the FPGA-based pulse height measurement system using the USB104 A7 and Zmod Digitizer. Its description can be found here:\u202f<a href=\"https:\/\/pavel-demin.github.io\/usb104-a7-notes\/mcpha\">https:\/\/pavel-demin.github.io\/usb104-a7-notes\/mcpha\u202f<\/a><\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-29842 jlk' data-task='like' data-post_id='29842' data-nonce='5286a1c13f' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-29842 lc'>+1<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-29842 jlk' data-task='unlike' data-post_id='29842' data-nonce='5286a1c13f' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-29842 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-29842 status align-left'><\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>We\u2019ve been working with Pavel Demin, a research engineer based in Belgium, on several projects related to the Eclypse.\u202f\u00a0 For the first, to demonstrate approaches to rapid prototyping, he put &hellip; <\/p>\n","protected":false},"author":52,"featured_media":29856,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4323,35],"tags":[4351,4400,4417,4419,4418,4420,4421,452,4422,4347],"ppma_author":[4462],"class_list":["post-29842","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","category-fpga","tag-eclypse","tag-eclypse-7z","tag-jupyter","tag-jupyter-notebook","tag-notebook","tag-prototyping","tag-rapid-prototyping","tag-waveforms","tag-waveforms-sdk","tag-zmod"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2023\/04\/fratures.png","jetpack_sharing_enabled":true,"authors":[{"term_id":4462,"user_id":52,"is_guest":0,"slug":"abrown","display_name":"Arthur Brown","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/60e7f8e1b3a55e2e20ee541df1f393c2acbcee9fd05fd3e38d07e25a2e6fd237?s=96&d=mm&r=g","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/29842","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=29842"}],"version-history":[{"count":5,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/29842\/revisions"}],"predecessor-version":[{"id":29857,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/29842\/revisions\/29857"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/29856"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=29842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=29842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=29842"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=29842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}