{"id":286,"date":"2020-04-20T02:44:51","date_gmt":"2020-04-20T02:44:51","guid":{"rendered":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/?p=286"},"modified":"2020-04-20T02:44:51","modified_gmt":"2020-04-20T02:44:51","slug":"jonathans-status-report-for-saturday-apr-18","status":"publish","type":"post","link":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/2020\/04\/20\/jonathans-status-report-for-saturday-apr-18\/","title":{"rendered":"Jonathan&#8217;s status report for Saturday, Apr. 18"},"content":{"rendered":"<p>This week I mainly worked on improving the real-time visualizer, and building more of the hardware.<\/p>\n<p>The real-time visualizer previously just did time-domain delay and sum, followed by a Fourier transform of the resulting data.\u00a0 This worked but is slow, particularly as more pixels are added to the output image.\u00a0 To improve the resolution and speed, I switched to taking the FFT of every channel immediately, then, only at the frequencies of interest, adding a phase delay to each one (which is computed ahead of time), then summing.\u00a0 This reduces the amount of information in the final image (to only the exact frequencies we&#8217;re interested in), but is extremely fast.\u00a0 Roughly, the work for delay-and-sum is 50K (readings\/mic) * 96 (mics) per pixel, so ~50K*96*128 multiply-and-accumulate operations for a 128-pixel frame.\u00a0\u00a0 With overhead, this is around a billion operations per frame, and at 20 frames per second, this is far too slow.\u00a0 The phase-delay processing needs only about 3 (bins\/mic) * 8 (ops \/ complex multiply) * 96 (mics) * 128 (pixels), which is only about 300K operations, which any computer could easily run 20 times per second.\u00a0 This isn&#8217;t exact, it&#8217;s closer to a &#8220;big O&#8221; for the work number than an actual number of operations, and doesn&#8217;t account for cache or anything, but does give a basic idea of what kind of speed-up this type of processing offers.<\/p>\n<p>I did also look into a few other things related to the real-time processing.\u00a0 One was that since we know our source has a few strong components at definite frequencies, is multiplying the angle-of-arrival information of all frequencies together gives a sharper and more stable peak in the direction of the source.\u00a0 This can also account, to some degree, for aliasing and other spatial problems &#8211; it&#8217;s almost impossible for all frequencies to have sidelobes in exactly the same spots, and as long as a single frequency has a very low value in that direction, the product of all the frequencies will also have a very low value there.\u00a0 With some basic 1D testing with a 4-element array, this worked relatively well.\u00a0 The other thing I experimented with was using a 3D FFT to process all of the data with a single (albeit complex) operation.\u00a0 To play with this, I used the matlab simulator that I used earlier to design the array.\u00a0 The results were pretty comparable to the images that came out of the delay-and-sum beamforming, but ran nearly 200 times faster.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-287\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/3_srcs_pretty-300x194.png\" alt=\"\" width=\"300\" height=\"194\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/3_srcs_pretty-300x194.png 300w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/3_srcs_pretty-768x498.png 768w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/3_srcs_pretty.png 1003w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>output from delay-and-sum.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-288\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/3DFFT_3_srcs_zoomed-300x147.png\" alt=\"\" width=\"300\" height=\"147\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/3DFFT_3_srcs_zoomed-300x147.png 300w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/3DFFT_3_srcs_zoomed-768x376.png 768w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/3DFFT_3_srcs_zoomed-1024x501.png 1024w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/3DFFT_3_srcs_zoomed.png 1600w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>output from 3D FFT<\/p>\n<p>The two main disadvantages are that the 3D FFT has a fixed resolution output-the same as the physical array (8&#215;12).\u00a0 To increase the resolution slightly, I wrote a bit of code to do complex interpolation between pixels.\u00a0 This &#8220;recovers&#8221; some of the information held in the phase of the output array, which normally would not be used in an image (or at least, not in a comprehensible form), and makes new pixels using this.\u00a0 This is relatively computationally expensive though, and only slightly improves the resolution.\u00a0 Because of the relative complexity of implementing this, and the relatively small boost in performance compared with phase-delay, this will probably not be used in the final visualizer.<\/p>\n<p>Finally, the hardware has made significant progress since last week, three out of the six microphone boards have been assembled, and tested in a limited capacity.\u00a0 No images have been created yet, though I&#8217;ve taken some logs for Sarah and Ryan to start running processing on some actual data.\u00a0 I did do some heuristic processing to make sure the output from every microphone &#8220;looks&#8221; right.\u00a0 The actual soldering of these boards ended up being a very significant challenge.\u00a0 After a few attempts to get the oven to work well, I decided to do all of them by hand with the hot air station.\u00a0 Of the 48 microphones soldered so far, 3 were completely destroyed (2 by getting solder\/flux in the port, and 1 by overheating), and about 12 did not solder correctly on the first try and had to be reworked.\u00a0\u00a0 I plan to stop here for a day or two, and get everything else working, before soldering the last 3 boards.<\/p>\n<p>Finally, the FPGA firmware was modified slightly.\u00a0 Previously, timestamps for each microphone reading were included in the packets, to find &#8220;breaks&#8221; (dropped packets\/readings) between readings in the packet handling, logfiles, or processing code.\u00a0 Since all of that is working reliably at this point, and that introduced significant (32Mbps) overhead, I&#8217;ve removed the individual timestamps and replaced it with packet indexing, each packet has a single number which identifies it.\u00a0 In this way missing packets can still be identified, but with very little overhead.\u00a0 The FPGA also now reads all 96 microphone channels, simultaneously, where previously it only read a single board.\u00a0 Since this required many pins, and the exact pinout may change for wiring reasons, I made a spreadsheet to keep track of what was connected where, and used this spreadsheet to automatically generate the .ucf file for all the pins based on their assignments within the sheet.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-289\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/excel_UCF_gen-300x244.png\" alt=\"\" width=\"300\" height=\"244\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/excel_UCF_gen-300x244.png 300w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/excel_UCF_gen-768x625.png 768w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-content\/uploads\/sites\/92\/2020\/04\/excel_UCF_gen.png 846w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week I mainly worked on improving the real-time visualizer, and building more of the hardware. The real-time visualizer previously just did time-domain delay and sum, followed by a Fourier transform of the resulting data.\u00a0 This worked but is slow, particularly as more pixels are added to the output image.\u00a0 To improve the resolution and &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/2020\/04\/20\/jonathans-status-report-for-saturday-apr-18\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Jonathan&#8217;s status report for Saturday, Apr. 18&#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":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-json\/wp\/v2\/posts\/286"}],"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=286"}],"version-history":[{"count":1,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-json\/wp\/v2\/posts\/286\/revisions"}],"predecessor-version":[{"id":290,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-json\/wp\/v2\/posts\/286\/revisions\/290"}],"wp:attachment":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-json\/wp\/v2\/media?parent=286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-json\/wp\/v2\/categories?post=286"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame0\/wp-json\/wp\/v2\/tags?post=286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}