{"id":310,"date":"2020-04-27T05:31:42","date_gmt":"2020-04-27T05:31:42","guid":{"rendered":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/?p=310"},"modified":"2020-04-27T06:15:09","modified_gmt":"2020-04-27T06:15:09","slug":"jonathans-status-update-for-saturday-april-25","status":"publish","type":"post","link":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/2020\/04\/27\/jonathans-status-update-for-saturday-april-25\/","title":{"rendered":"Jonathan&#8217;s Status Update for Saturday April 25"},"content":{"rendered":"<p>This week I mainly finished the hardware and continued refining the real-time imaging.<\/p>\n<p>The hardware was half completed at the beginning of this week, with 48 microphones assembled on their boards and tested.\u00a0 At the beginning of this week I assembled the remaining 48.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-308\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/acu_small-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/acu_small-300x225.jpg 300w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/acu_small.jpg 461w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Since the package for these microphones, LGA_CAV, are very small, with a sub-mm pitch, and no exposed pins, soldering was difficult and often required rework.\u00a0 Several iterations of the process to solder them were used, beginning with a reflow oven, eventually moving to hot air and solder past, then manual tinning followed by hot air reflow.\u00a0 The final process was slightly more time consuming than the first two, but significantly more reliable.\u00a0 In all, around 20% of the microphones had to be reworked.\u00a0 In order to aid in troubleshooting, a few tools were used.\u00a0 The first was a simple utility I wrote based on the real-time array processor, which examined each microphone for a few common failures (stuck 0, stuck 1, &#8220;following&#8221; its partner, and conflicting with its partner).<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-311\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/BorkDetector-206x300.png\" alt=\"\" width=\"206\" height=\"300\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/BorkDetector-206x300.png 206w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/BorkDetector.png 545w\" sizes=\"(max-width: 206px) 100vw, 206px\" \/><\/p>\n<p>This image shows the output of this program (the &#8220;bork detector&#8221;) for a partially working board.\u00a0 Only microphones 24-31 and 72-79 are connected (a single, 16-microphone board), but 27,75, and 31 are broken.\u00a0 This enabled quickly determining where to look for further debugging.<\/p>\n<p>The data interface of PDM microphones is designed for stereo use, so each pair takes a single clock line, and has a single digital output for both.\u00a0 Based on the state of another pin, each &#8220;partner&#8221; outputs data either on the rising or falling edge of the clock, and goes hi-z in the other clock state.\u00a0 This allows the FPGA to use just half as many pins as there are microphones (in this case, 48 pins to read 96 microphones).\u00a0 Often the errors in soldering could be figured out based on this.<\/p>\n<p>Using an oscilloscope, a few common errors could quickly be identified, and tracked to a specific microphone, by probing the clock line and data line of a pair (blue is data, yellow clock):<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-312\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/sw_small-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/sw_small-300x225.jpg 300w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/sw_small.jpg 461w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Both microphones are working<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-313\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/s3_small-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/s3_small-300x225.jpg 300w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/s3_small.jpg 461w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>The falling-edge microphone is working, but the data line of the rising-edge microphone (micn_1) is disconnected<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-314\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/s2_small-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/s2_small-300x225.jpg 300w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/s2_small.jpg 461w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>The falling-edge microphone is working, but the rising-edge microphone&#8217;s select line is disconnected.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-315\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/s1_small-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/s1_small-300x225.jpg 300w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/s1_small.jpg 461w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>The falling-edge microphone is working, but the rising-edge microphone&#8217;s select line is connected to the wrong direction (low, where it should be high).<\/p>\n<p>&nbsp;<\/p>\n<p>The other major thing that I worked on this week was refinements to the real-time processing software.\u00a0 The two main breakthroughs here that allowed for working high-resolution, real time imaging was using a process which I&#8217;ll refer to as product of images (there may be another name for this in the literature or industry, but I couldn&#8217;t find it), and frequency-domain processing.<\/p>\n<p>Before using product of images, the images generated by each frequency were separate, as in this image where two frequencies (4000 and 6000Hz) are shown in two images side by side:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-318\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/Hist_evenTones-300x168.png\" alt=\"\" width=\"300\" height=\"168\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/Hist_evenTones-300x168.png 300w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/Hist_evenTones-768x430.png 768w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/Hist_evenTones-1024x573.png 1024w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/Hist_evenTones.png 1798w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Neither image is particularly good on its own (this particular image also used only half of the array, so the Y axis has particularly low gain).\u00a0 They can be improved significantly by multiplying two or more of these images together though.\u00a0 Much like how a Kalman filter multiplies distributions to get the the best properties of all the sensors available to it, this multiplies the images from several (typically three or four) frequencies, to get the small spot size of the higher frequencies, as well as the stability and lower sidelobes of lower frequencies.\u00a0 This also allows a high degree of selectivity, a noise source that does not have all characteristics of the source we&#8217;re looking for will be reduced dramatically.<\/p>\n<p>For a simple example, suppose we have a fan that has relatively flat (&#8220;white&#8221;) noise from 100Hz &#8211; 5KHz, and 10dB lower noise above 5KHz (these numbers based roughly on the fan in my room). \u00a0 If the source we&#8217;re looking at has strong components at 2,4,6,and 8 KHz, and the two have roughly equal peak signal power, then &#8220;normal&#8221; time domain processing that adds power across the entire band would have the fan be vastly more powerful than the source we&#8217;re looking for, as the overall signal power would be greater because of the very wide bandwidth (4.9KHz bandwidth as opposed to just a few tens of Hz, depending on the exact microphone bitrate).\u00a0 Doing product of images though would have the two equal at 2 and 4KHz, but would add the 10dB difference at both 6 and 8KHz, in theory giving a 20dB SNR over the fan.\u00a0 This, for example, is an image created from about 8 feet away, where the source was so quiet my phone microphone couldn&#8217;t pick it up more than 2-3 inches away:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-320\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/weak_even_source-300x296.png\" alt=\"\" width=\"300\" height=\"296\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/weak_even_source-300x296.png 300w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/weak_even_source-768x758.png 768w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/weak_even_source-100x100.png 100w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/weak_even_source.png 997w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>In practice this worked exceptionally well, largely cancelling external noise, and even some reflections, for very quiet sources.\u00a0 Most of the real-time imaging used this technique, some pictures and videos also took the component images and mapped each to a color based on its frequency (red for low, green for medium, blue for high), and just made an image based on these.\u00a0 In this case, artifacts at specific frequencies were much more visible, but it did give more information about the frequency content of sources, and allowed identifying sources that did not have all the selected frequencies.\u00a0 In the image above, the top part is an RGB image, the lower uses product of images.<\/p>\n<p>Finally, frequency domain processing was used to allow very fast operation, to get multiple frames per second.\u00a0 Essentially each input channel is multiplied by a sine and cosine wave, and the sum of each of those waves over the entire input duration (typically 50mS) is stored as a single complex number.\u00a0 So for a microphone, if f(t) is the reading (1 or -1) at time t, and c is the frequency we&#8217;re analyzing divided by the sample rate, then this complex number is given by f(0)*cos(c*0) + f(1)*cos(c*1) &#8230; + f(n)*cos(c*n) + f(0)*sin(c*0)*j + f(1)*sin(c*1)*j + f(n)*sin(c*n)*j.\u00a0 Once all of these are computed, they&#8217;re approximately normalized (any values too small are kept small, larger values are kept relatively small, but allowed to grow logarithmically).\u00a0 To generate images, a phase table, which was precomputed when the program first started, is used to map a phase offset for each element, for each pixel.\u00a0 This phase delay is proportional to the frequency of interest, and what the time delay would have been if we were doing time domain delay-and-sum.\u00a0 Each microphone&#8217;s complex output value is multiplied by a value with this phase and magnitude 1, and then those numbers are summed, and the amplitude taken, to get a value for that pixel in the final image.\u00a0 While significantly more complicated than delay-and-sum, and much more limited as it can only look at a small number of specific frequencies, this can be done very quickly.\u00a0 The final real-time imaging program was able to achieve 2-3 frames per second, where post-processing in the time domain typically takes several seconds (or even minutes, depending on the exact processing method being used).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week I mainly finished the hardware and continued refining the real-time imaging. The hardware was half completed at the beginning of this week, with 48 microphones assembled on their boards and tested.\u00a0 At the beginning of this week I assembled the remaining 48. Since the package for these microphones, LGA_CAV, are very small, with &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/2020\/04\/27\/jonathans-status-update-for-saturday-april-25\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Jonathan&#8217;s Status Update for Saturday April 25&#8221;<\/span><\/a><\/p>\n","protected":false},"author":279,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,3],"tags":[6,7],"_links":{"self":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-json\/wp\/v2\/posts\/310"}],"collection":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-json\/wp\/v2\/users\/279"}],"replies":[{"embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-json\/wp\/v2\/comments?post=310"}],"version-history":[{"count":4,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-json\/wp\/v2\/posts\/310\/revisions"}],"predecessor-version":[{"id":321,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-json\/wp\/v2\/posts\/310\/revisions\/321"}],"wp:attachment":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-json\/wp\/v2\/media?parent=310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-json\/wp\/v2\/categories?post=310"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-json\/wp\/v2\/tags?post=310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}