{"id":25077,"date":"2019-01-22T11:21:02","date_gmt":"2019-01-22T19:21:02","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=25077"},"modified":"2024-12-28T11:50:13","modified_gmt":"2024-12-28T19:50:13","slug":"pushing-the-envelope-detector-exploring-demodulation-am-and-fm-signals","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/pushing-the-envelope-detector-exploring-demodulation-am-and-fm-signals\/","title":{"rendered":"Envelope Detector Circuit: Demodulation, AM &#038; FM Signals"},"content":{"rendered":"<p>I recently compiled and posted a project on hackster.com describing how a Theremin (an electronic musical instrument) can be built using the <a href=\"https:\/\/digilent.com\/shop\/analog-discovery-2-100msps-usb-oscilloscope-logic-analyzer-and-variable-power-supply\/\">Analog Discovery 2<\/a>, the Digilent<a href=\"https:\/\/digilent.com\/shop\/analog-parts-kit-by-analog-devices-companion-parts-kit-for-the-analog-discovery\/\"> Analog Parts Kit,<\/a> and a beverage can. It was a super fun project, I learned a lot, and it can be found here:\u00a0<strong><em><u><a href=\"https:\/\/www.hackster.io\/ian-etheridge\/beverage-can-theremin-03ba2e\">https:\/\/www.hackster.io\/ian-etheridge\/beverage-can-theremin-03ba2e<\/a><\/u><\/em><\/strong><\/p>\n<p>One of the last stages I referred to as an \u201cEnvelope Detector.\u201d This stage is a very simple circuit consisting of one diode, one capacitor, and one resistor. These 3 amigos convert a &#8220;multi-frequency&#8221; input signal, called a modulated signal, into a single-frequency output signal. Here is an example schematic for an envelope detector:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-25090 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/3-envelope-detector-600x281.png\" alt=\"\" width=\"600\" height=\"281\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/3-envelope-detector-600x281.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/3-envelope-detector.png 627w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>The input signal is a sum of two periodic signals. This is part of how the Theremin and its player can create a signal with varying frequency (visit my project page for more information on this). The \u201cenvelope\u201d of a signal can be thought of as the outline if you created a new wave by connecting all the amplitude peaks. When these two summed signals differ in frequency, the resulting signal has a periodic envelope.<\/p>\n<p>Taking this one step at a time, the diode in this circuit is also called a rectifier. When an alternating signal is presented to a diode, the diode only conducts a signal when the voltage at its anode is positive and provides a potential difference to the cathode, greater than its threshold voltage. This &#8220;removes&#8221; all negative voltages like its going out of style. If we consider this circuit without the capacitor and keep some arbitrary resistor to complete the circuit, we get rectified! Below is an example of half-wave rectification using our circuit without the capacitor. The yellow signal is the modulated signal from the <a href=\"https:\/\/digilent.com\/shop\/analog-discovery-2-100msps-usb-oscilloscope-logic-analyzer-and-variable-power-supply\/\">Analog Discovery 2<\/a> Wavegen using the Modulation option. The blue(ish) signal is the rectified output from the diode. Notice how all those pesky negative voltages are gone!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-25104\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/WF-rectified.png\" alt=\"\" width=\"1600\" height=\"860\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/WF-rectified.png 1600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/WF-rectified-600x323.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/WF-rectified-768x413.png 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/WF-rectified-1024x550.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/WF-rectified-800x430.png 800w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><\/p>\n<p>Now let us bring our capacitor buddy back into the picture. The increasing voltage from the rectified signal charges the capacitor. When the voltage begins to drop, the capacitor will start to discharge through the resistor. However, the rate at which the capacitor discharges is (ideally) very much slower than the frequency of the modulated signal. Therefore, the capacitor does not fully discharge on the falling edge of the rectified signal, but will be charged relative to the rectified signal peak amplitudes. The capacitor and resistor together are also a Low Pass Filter, a match made in heaven. The Low Pass Filter smooths out the resulting signal and filters out high frequency noise that is inherently carried by the modulated input signal. Below is an example of our Envelope Detector in action! The yellow signal is the same modulated signal from the previous figure and the blue(ish) signal is now the envelope of the modulated signal (well, at least the shape, in theory the envelope should be &#8220;riding&#8221; along the peaks of the modulated signal).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25105 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/WF-envelope.png\" alt=\"\" width=\"1600\" height=\"860\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/WF-envelope.png 1600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/WF-envelope-600x323.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/WF-envelope-768x413.png 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/WF-envelope-1024x550.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/WF-envelope-800x430.png 800w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><\/p>\n<p>This process is also called \u201cdemodulation\u201d and was first widely used in AM radio frequency transmission.\u00a0 A baseband signal is modulated (or \u201cadded\u201d) to a carrier frequency for transmission. The rectification and filtering takes place at the user end inside the radio, providing the listener with the original broadcast signal. Kick out the jams mother&#8230;boards! Changing the resistor and capacitor values would change the time constant and cutoff frequency of the filter, which may be helpful in improving the envelope detection or noise reduction.<\/p>\n<p>AM stands for Amplitude Modulation, demonstrated in our scope shots as the yellow wave. The carrier signal is added to the baseband signal, resulting in a transmittable signal with a frequency of the carrier and varying amplitude that conforms to the baseband signal. Unfortunately, high frequency noise is an inherent problem with AM signals. Now, Frequency Modulation (FM) is more commonly used for higher quality audio transmission as the effects of noise are much less prominent. I found a website dedicated to transistor radio repair that has some great information about AM and FM circuits in application and a great diagram that compares AM and FM signals, respectively. A link to the website is provided below the image.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25094 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/modulation.gif\" alt=\"\" width=\"431\" height=\"284\" \/><\/p>\n<p>For reference visit:\u00a0<a href=\"https:\/\/www.vintage-radio.com\/repair-restore-information\/transistor_vhf-sets.html\">https:\/\/www.vintage-radio.com\/repair-restore-information\/transistor_vhf-sets.html<\/a><\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-25077 jlk' data-task='like' data-post_id='25077' data-nonce='3c15ebf169' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-25077 lc'>+2<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-25077 jlk' data-task='unlike' data-post_id='25077' data-nonce='3c15ebf169' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-25077 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-25077 status align-left'><\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Build a DIY Theramin Detector and explore concepts involving demodulation, AM, and FM signals with Analog Discovery 2.<\/p>\n","protected":false},"author":49,"featured_media":25105,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4325,4312,1563,1561],"tags":[1736],"ppma_author":[4459],"class_list":["post-25077","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debug-validation-test","category-usb-scopes-analyzers-generators","category-guide","category-applications","tag-analog-discovery-2"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/07\/WF-envelope.png","authors":[{"term_id":4459,"user_id":49,"is_guest":0,"slug":"ian","display_name":"Ian Etheridge","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/8a19055c49586a33bb17b9a5823ac103?s=96&d=mm&r=g","author_category":"","user_url":"","last_name":"Etheridge","last_name_2":"","first_name":"Ian","first_name_2":"","job_title":"","description":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/25077","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\/49"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=25077"}],"version-history":[{"count":1,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/25077\/revisions"}],"predecessor-version":[{"id":31177,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/25077\/revisions\/31177"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/25105"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=25077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=25077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=25077"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=25077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}