{"id":356967,"date":"2024-05-20T23:40:45","date_gmt":"2024-05-20T23:40:45","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=356967"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-20T23:40:45","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=356967","title":{"rendered":"<span>GEOMETRY OF SOUND<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>Surprisingly, there are strict mathematical methods that literally allow to hear visual geometric forms and, conversely, to see the beauty of musical harmonies&#8230;<\/p>\n<p>Research in this area was inspired by mathematical videos from the channel <a href=\"https:\/\/www.youtube.com\/3Blue1Brown\" rel=\"noopener noreferrer nofollow\">\u00ab3Blue1Brown\u00bb<\/a>:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=r6sGWTCMz2k&amp;t=964s&amp;ab_channel=3Blue1Brown\" rel=\"noopener noreferrer nofollow\">But what is a Fourier series? From heat flow to drawing with circles<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=-qgreAUpPwM&amp;t=32s&amp;ab_channel=3Blue1Brown\" rel=\"noopener noreferrer nofollow\">Pure Fourier series animation montage<\/a><\/p>\n<\/li>\n<\/ul>\n<p>Turns out, it is possible with Fourier transform to encode vector-based visual images of high complexity, via decomposing them into harmonic components based on complex vector-numbers, which is clearly demonstrated into the above-mentioned videos and the encoding algorithm is described in more details into lections from channels <a href=\"https:\/\/www.youtube.com\/@Mathologer\" rel=\"noopener noreferrer nofollow\">\u00abMathologer\u00bb<\/a> and <a href=\"https:\/\/www.youtube.com\/@TheCodingTrain\" rel=\"noopener noreferrer nofollow\">\u00abThe Coding Train\u00bb<\/a>:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/youtu.be\/qS4H6PEcCCA?si=JUfDwT1TUkufEWR9\" rel=\"noopener noreferrer nofollow\">Epicycles, complex Fourier series and Homer Simpson&#8217;s orbit<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/qS4H6PEcCCA?si=JUfDwT1TUkufEWR9\" rel=\"noopener noreferrer nofollow\">Coding Challenge #130.1: Drawing with Fourier Transform and Epicycles<\/a><\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/7e1\/8df\/6c3\/7e18df6c3bbcfc28af5600e2a6f24d44.jpeg\" alt=\"Picture 1: images-portraits of Joseph Fourier had been made with one stroke of the pen, which is encoded in varying detail using 10, 50 and 250 complex harmonic numbers, accordingly\" title=\"Picture 1: images-portraits of Joseph Fourier had been made with one stroke of the pen, which is encoded in varying detail using 10, 50 and 250 complex harmonic numbers, accordingly\" width=\"1280\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7e1\/8df\/6c3\/7e18df6c3bbcfc28af5600e2a6f24d44.jpeg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption><em>Picture 1: images-portraits of <\/em><a href=\"https:\/\/en.wikipedia.org\/wiki\/Joseph_Fourier\" rel=\"noopener noreferrer nofollow\"><em>Joseph Fourier<\/em><\/a><em> had been made with one stroke of the pen, which is encoded in varying detail using 10, 50 and 250 complex harmonic numbers, accordingly<\/em><\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/cd2\/4a8\/1d5\/cd24a81d574e7f33a8eebe4d961bb92f.jpeg\" alt=\"Picture 2: a screenshot from a short video of drawing process\" title=\"Picture 2: a screenshot from a short video of drawing process\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cd2\/4a8\/1d5\/cd24a81d574e7f33a8eebe4d961bb92f.jpeg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption><em>Picture 2: a screenshot from <\/em><a href=\"https:\/\/3b1b-posts.us-east-1.linodeobjects.com\/\/content\/lessons\/2019\/fourier-series\/intricacy_1.mp4#t=0.001\" rel=\"noopener noreferrer nofollow\"><em>a short video<\/em><\/a><em> of drawing process<\/em><\/figcaption><\/div>\n<\/figure>\n<p>There are more examples with other images by request <a href=\"https:\/\/www.youtube.com\/results?search_query=epicycle+drawing+Fourier+transform\" rel=\"noopener noreferrer nofollow\">\u00abepicycle drawing Fourier transform\u00bb<\/a>.<\/p>\n<hr\/>\n<p>But also with Fourier transform it is simple to extract harmonic components from signals of various nature, for example, acoustic&#8230; Immediately intriguing questions arise: what if we apply the presented approach for research of signals?<\/p>\n<ul>\n<li>\n<p>How would be look sounding of a guitar string, another musical instruments, voice, different sounds?<\/p>\n<\/li>\n<\/ul>\n<p>And vice versa<\/p>\n<ul>\n<li>\n<p>How would be sound different visual forms of complex numbers geometry?<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<p>In order to reveal and explore in details these mysterious questions, it has been decided to implement appropriate visualization modules on base of <strong>SOLFEGGIO<\/strong> app for musical spectral analysis&#8230;<\/p>\n<p>At the current moment two branches of the app are available: desktop for <strong>Windows<\/strong> [<a href=\"https:\/\/www.microsoft.com\/store\/apps\/9P4DDJ3Q9Q73\" rel=\"noopener noreferrer nofollow\">Microsoft Store<\/a>, <a href=\"https:\/\/1drv.ms\/u\/s!AvvcPQX44tbIhf41FD0wp2C8MnvnXw?e=C3tdFk\" rel=\"noopener noreferrer nofollow\">One Drive<\/a>] and mobile for <strong>Android<\/strong> [<a href=\"https:\/\/play.google.com\/store\/apps\/details?id=edu.solfeggio\" rel=\"noopener noreferrer nofollow\">Google Play<\/a>]. The versions are very similar in functionality, but usually the desktop version is a little faster and more convenient for experiments, and also contains an additional powerful visualization module \u00abTape 3D\u00bb, which is missing in the mobile version.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/230\/114\/39c\/23011439cf49198109cfc056d724d517.webp\" alt=\"Picture 3: visualization of ideal harmonic signal into the mobile version (flower)\" title=\"Picture 3: visualization of ideal harmonic signal into the mobile version (flower)\" width=\"526\" height=\"296\"\/><\/p>\n<div><figcaption><em>Picture 3: visualization of ideal harmonic signal into the mobile version (flower)<\/em><\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/721\/ba1\/0e1\/721ba10e16b4b6e5fb2a97ba5c234069.webp\" alt=\"Picture 4: visualization of acoustic signal from a microphone into the mobile version (flower + spiral)\" title=\"Picture 4: visualization of acoustic signal from a microphone into the mobile version (flower + spiral)\" width=\"526\" height=\"296\"\/><\/p>\n<div><figcaption><em>Picture 4: visualization of acoustic signal from a microphone into the mobile version (flower + spiral)<\/em><\/figcaption><\/div>\n<\/figure>\n<p>To see sounds seriously, create three-dimensional geometric shapes with your voice and even fly into them, it is recommended to download the application, master basic skills and work directly with it. <strong>The program is free for educational and non-commercial use<\/strong>. In a case of commercial targets <a href=\"https:\/\/www.paypal.com\/donate\/?hosted_button_id=S8LGP5BQ5WA8Q\" rel=\"noopener noreferrer nofollow\">a donation of any size<\/a>(in good faith) must be performed.<\/p>\n<p>Also worth mentioning, that <strong>the app, source codes, results of researches and other related materials suggested for peaceful use<\/strong> (see for details the <a href=\"https:\/\/gitlab.com\/Makeloft-Studio\/Rainbow\/-\/wikis\/AGREEMENT\" rel=\"noopener noreferrer nofollow\"><strong>agreement<\/strong><\/a>).<\/p>\n<hr\/>\n<p>HOW TO USE THE PROGRAM?<\/p>\n<p>So, now let&#8217;s start our research. To intuitively understand how the various visualization methods work, firstly consider a single sine wave-based signal. For this:<\/p>\n<ol>\n<li>\n<p>go to \u00abSignal\u00bb section and choose \u00abGenerator\u00bb profile<\/p>\n<\/li>\n<li>\n<p>open \u00abGenerator\u00bb section and choose \u00abCamertone\u00bb profile<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/324\/6f0\/f84\/3246f0f840c8e69e438349d035a38cb8.png\" alt=\"sin\" title=\"Picture 5: sin tone\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/324\/6f0\/f84\/3246f0f840c8e69e438349d035a38cb8.png\"\/><\/p>\n<div><figcaption><em>Picture 5: sin tone<\/em><\/figcaption><\/div>\n<\/figure>\n<p>After completing these steps, you should hear a pure sine tone at the specified frequency (440 Hz by default) from your speakers. A circle will appear on the flower visualization, and an Archimedean spiral will appear on the spiral visualization. If you play with the frequency of the tone, the number of turns of the spiral will change, the value of the tone magnitude will affect on its radius.<\/p>\n<p>Now, if you fly slightly to the side in a 3D visualization, you can find a ribbon-spring, the vertical projection of which onto the horizontal plane forms the source sinusoid.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/75b\/89f\/a32\/75b89fa32e1303080d9ee1ce0ac69b6b.png\" alt=\"sin_3d\" title=\"Picture 6: sin tone 3D\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/75b\/89f\/a32\/75b89fa32e1303080d9ee1ce0ac69b6b.png\"\/><\/p>\n<div><figcaption><em>Picture 6: sin tone 3D<\/em><\/figcaption><\/div>\n<\/figure>\n<p>Here need to mark a record on a channel <a href=\"https:\/\/www.youtube.com\/@EugeneKhutoryansky\" rel=\"noopener noreferrer nofollow\">\u00abPhysics Videos by Eugene Khutoryansky\u00bb<\/a>, in which the same method of three-dimensional visualization is considered:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=r18Gi8lSkfM&amp;pp=ygURZm91cmllciB0cmFuc2Zvcm0%3D\" rel=\"noopener noreferrer nofollow\">Fourier Transform, Fourier Series, and frequency spectrum<\/a><\/p>\n<\/li>\n<\/ul>\n<p>If you start adding additional sinusoids of different frequencies and magnitudes to a single sinusoidal tone, then the patterns in the flower and spiral visualizations will begin to change significantly. It is important to note: although the spring ribbon will begin to twist into fancy lace curls (depending on the ratios of frequencies and magnitudes), in three-dimensional representation its projection onto the horizontal plane will still correspond to the original time frame.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/594\/9f3\/5ef\/5949f35ef9ee425b6ea89ea34c199589.png\" alt=\"Picture 7: harmony 3D\" title=\"Picture 7: harmony 3D\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/594\/9f3\/5ef\/5949f35ef9ee425b6ea89ea34c199589.png\"\/><\/p>\n<div><figcaption><em>Picture 7: harmony 3D<\/em><\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/97c\/2de\/0de\/97c2de0debee0f384d0155ebbe18650b.png\" alt=\"lace_3d\" title=\"Picture 8: lace 3D\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/97c\/2de\/0de\/97c2de0debee0f384d0155ebbe18650b.png\"\/><\/p>\n<div><figcaption><em>Picture 8: lace 3D<\/em><\/figcaption><\/div>\n<\/figure>\n<p>If you look at the springs exactly from the end, then the orthonormal projection will represent a circular floral geometry (this is the method used for drawing in the video channel <a href=\"https:\/\/www.youtube.com\/3Blue1Brown\" rel=\"noopener noreferrer nofollow\">\u00ab3Blue1Brown\u00bb<\/a>), while how the perspective projection will form spiral shapes.<\/p>\n<p>The variety of forms is extremely large (flowers, mandalas, lambs and many others), but significant that pure musical harmonies usually form easily readable patterns&#8230; Also by these patterns it is possible to distinguish the timbre color of various musical instruments and voices sounding on the same note.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/eba\/cc6\/eab\/ebacc6eabb55f40cf67a0aa056ab19bb.png\" alt=\"forms\" title=\"Picture 9: forms\" width=\"1162\" height=\"776\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/eba\/cc6\/eab\/ebacc6eabb55f40cf67a0aa056ab19bb.png\"\/><\/p>\n<div><figcaption><em>Picture 9: forms<\/em><\/figcaption><\/div>\n<\/figure>\n<p>It is interesting that patterns can be both static and dynamic in nature, for example: rotating, pulsating, shimmering and flowing in a fascinating way.<\/p>\n<hr\/>\n<p>HOW IT WORKS?<\/p>\n<p>At a first approximation, there is a following algorithm:<\/p>\n<ul>\n<li>\n<p>take a short piece of audio signal with a duration of about 100 ms (time frame);<\/p>\n<\/li>\n<li>\n<p>find pure sinusoidal tones (frequencies) sounding in the signal, calculate their magnitude and phase shift with help of the Fourier transform;<\/p>\n<\/li>\n<li>\n<p>after construct and draw geometry based on this information.<\/p>\n<\/li>\n<\/ul>\n<p>But upon closer examination, everything becomes a little more complicated: the computational discrete fast Fourier transform (FFT) algorithm has some peculiarities that make high-precision signal analysis difficult. To eliminate these difficulties, the phase-magnitude interpolation (PMI) algorithm is additionally used, which is described in more details in the article <a href=\"https:\/\/gitlab.com\/Makeloft-Studio\/Rainbow\/-\/wikis\/RIDDLES-OF-THE-FAST-FOURIER-TRANSFORM\" rel=\"noopener noreferrer nofollow\">RIDDLES OF THE FAST FOURIER TRANSFORM<\/a>.<\/p>\n<p>As for the final geometric constructions, they are based on <a href=\"https:\/\/gitlab.com\/Makeloft-Studio\/Solfeggio\/-\/blob\/master\/Solfeggio\/Solfeggio\/Presenters\/GeometryPresenter.cs?ref_type=heads\" rel=\"noopener noreferrer nofollow\">the following algorithm<\/a> in a programming language <a href=\"https:\/\/ru.wikipedia.org\/wiki\/C_Sharp\" rel=\"noopener noreferrer nofollow\">C#<\/a>:<\/p>\n<pre><code class=\"cs\">public class GeometryPresenter { public static IEnumerable&lt;Point> Draw( IList&lt;Bin> peaks, int sampleSize, double sampleRate, double approximation = 1d, double spiralStep = 0d, double phaseAngle = 0d ) { if (peaks.Count.Is(0)) yield break;  var spiralScale = 1d; var pointsCount = (int)(sampleSize \/ approximation);  for (var i = 0; i &lt; pointsCount; i++, spiralScale -= spiralStep) { var a = 0d; var b = 0d;  for (var j = 0; j &lt; peaks.Count; j++) { var peak = peaks[j]; var w = Pi.Double * peak.Frequency; var t = 2d * i \/ sampleRate * approximation; var phase = peak.Phase + w * t + phaseAngle; var magnitude = peak.Magnitude * spiralScale;  a += magnitude * Math.Cos(phase); b += magnitude * Math.Sin(phase); }  yield return new(a, b); } } } <\/code><\/pre>\n<p>The source code of the 3D visualization algorithm is available <a href=\"https:\/\/gitlab.com\/Makeloft-Studio\/Solfeggio\/-\/blob\/master\/Solfeggio\/Solfeggio.Win\/Views\/TapeView.xaml.cs?ref_type=heads\" rel=\"noopener noreferrer nofollow\">link<\/a>.<\/p>\n<hr\/>\n<p>FOR REFLECTION<\/p>\n<p>Although time frames of signals are often presented in two dimensions, the Fourier transform allows to expand them into three dimensions and show from previously inaccessible angles, which makes it possible to research hidden intricate geometric patterns and match them with an exact acoustic equivalent.<\/p>\n<p>This is reminiscent of holographic photographs and stereoscopic pictures, when flat images, when viewed correctly, magically acquire volume.<\/p>\n<p>Also, photoholograms and time frames of signals have another similar property: due to the fact that each piece of the hologram partially stores information about the entire scene <a href=\"https:\/\/youtube.com\/shorts\/E4l7imVEWfE?si=I53JF6u0UR0gn9Ue\" rel=\"noopener noreferrer nofollow\">when it is divided (to a certain limit)<\/a> it is still possible to view the original scene in each individual piece, but from fewer angles. Like, when the window in the room is partially covered, the picture on the street is still visible, although in order to see it you need to come closer to the window or move a little to the side. Similarly, when reducing the size of the time frame of the signal, it remains possible to recognize the original \u00abscene\u00bb from harmonics with less accuracy.<\/p>\n<hr\/>\n<p>MIRRORS OF THE ARTICLE<\/p>\n<p>EN: <a href=\"https:\/\/gitlab.com\/Makeloft-Studio\/Rainbow\/-\/wikis\/GEOMETRY-OF-SOUND\" rel=\"noopener noreferrer nofollow\">gitlab<\/a>, <a href=\"https:\/\/habr.com\/ru\/articles\/766110\/\" rel=\"noopener noreferrer nofollow\">habr<\/a><\/p>\n<p>RU: <a href=\"https:\/\/gitlab.com\/Makeloft-Studio\/Rainbow\/-\/wikis\/%D0%93%D0%95%D0%9E%D0%9C%D0%95%D0%A2%D0%A0%D0%98%D0%AF-%D0%97%D0%92%D0%A3%D0%9A%D0%90\" rel=\"noopener noreferrer nofollow\">gitlab<\/a>, <a href=\"https:\/\/habr.com\/ru\/articles\/765170\/\" rel=\"noopener noreferrer nofollow\">habr<\/a><\/p>\n<hr\/>\n<p>ADDITIONAL MATERIALS<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/gitlab.com\/Makeloft-Studio\/Rainbow\/-\/wikis\/RIDDLES-OF-THE-FAST-FOURIER-TRANSFORM\" rel=\"noopener noreferrer nofollow\">RIDDLES OF THE FAST FOURIER TRANSFORM<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.3blue1brown.com\/lessons\/fourier-series\" rel=\"noopener noreferrer nofollow\">Fourier series<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=MBnnXbOM5S4&amp;pp=ygUUM2JsdWUxYnJvd24gZm91cmllciA%3D\" rel=\"noopener noreferrer nofollow\">The more general uncertainty principle, regarding Fourier transforms<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/766110\/\"> https:\/\/habr.com\/ru\/articles\/766110\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>Surprisingly, there are strict mathematical methods that literally allow to hear visual geometric forms and, conversely, to see the beauty of musical harmonies&#8230;<\/p>\n<p>Research in this area was inspired by mathematical videos from the channel <a href=\"https:\/\/www.youtube.com\/3Blue1Brown\" rel=\"noopener noreferrer nofollow\">\u00ab3Blue1Brown\u00bb<\/a>:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=r6sGWTCMz2k&amp;t=964s&amp;ab_channel=3Blue1Brown\" rel=\"noopener noreferrer nofollow\">But what is a Fourier series? From heat flow to drawing with circles<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=-qgreAUpPwM&amp;t=32s&amp;ab_channel=3Blue1Brown\" rel=\"noopener noreferrer nofollow\">Pure Fourier series animation montage<\/a><\/p>\n<\/li>\n<\/ul>\n<p>Turns out, it is possible with Fourier transform to encode vector-based visual images of high complexity, via decomposing them into harmonic components based on complex vector-numbers, which is clearly demonstrated into the above-mentioned videos and the encoding algorithm is described in more details into lections from channels <a href=\"https:\/\/www.youtube.com\/@Mathologer\" rel=\"noopener noreferrer nofollow\">\u00abMathologer\u00bb<\/a> and <a href=\"https:\/\/www.youtube.com\/@TheCodingTrain\" rel=\"noopener noreferrer nofollow\">\u00abThe Coding Train\u00bb<\/a>:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/youtu.be\/qS4H6PEcCCA?si=JUfDwT1TUkufEWR9\" rel=\"noopener noreferrer nofollow\">Epicycles, complex Fourier series and Homer Simpson&#8217;s orbit<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/qS4H6PEcCCA?si=JUfDwT1TUkufEWR9\" rel=\"noopener noreferrer nofollow\">Coding Challenge #130.1: Drawing with Fourier Transform and Epicycles<\/a><\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\">\n<div><figcaption><em>Picture 1: images-portraits of <\/em><a href=\"https:\/\/en.wikipedia.org\/wiki\/Joseph_Fourier\" rel=\"noopener noreferrer nofollow\"><em>Joseph Fourier<\/em><\/a><em> had been made with one stroke of the pen, which is encoded in varying detail using 10, 50 and 250 complex harmonic numbers, accordingly<\/em><\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption><em>Picture 2: a screenshot from <\/em><a href=\"https:\/\/3b1b-posts.us-east-1.linodeobjects.com\/\/content\/lessons\/2019\/fourier-series\/intricacy_1.mp4#t=0.001\" rel=\"noopener noreferrer nofollow\"><em>a short video<\/em><\/a><em> of drawing process<\/em><\/figcaption><\/div>\n<\/figure>\n<p>There are more examples with other images by request <a href=\"https:\/\/www.youtube.com\/results?search_query=epicycle+drawing+Fourier+transform\" rel=\"noopener noreferrer nofollow\">\u00abepicycle drawing Fourier transform\u00bb<\/a>.<\/p>\n<hr\/>\n<p>But also with Fourier transform it is simple to extract harmonic components from signals of various nature, for example, acoustic&#8230; Immediately intriguing questions arise: what if we apply the presented approach for research of signals?<\/p>\n<ul>\n<li>\n<p>How would be look sounding of a guitar string, another musical instruments, voice, different sounds?<\/p>\n<\/li>\n<\/ul>\n<p>And vice versa<\/p>\n<ul>\n<li>\n<p>How would be sound different visual forms of complex numbers geometry?<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<p>In order to reveal and explore in details these mysterious questions, it has been decided to implement appropriate visualization modules on base of <strong>SOLFEGGIO<\/strong> app for musical spectral analysis&#8230;<\/p>\n<p>At the current moment two branches of the app are available: desktop for <strong>Windows<\/strong> [<a href=\"https:\/\/www.microsoft.com\/store\/apps\/9P4DDJ3Q9Q73\" rel=\"noopener noreferrer nofollow\">Microsoft Store<\/a>, <a href=\"https:\/\/1drv.ms\/u\/s!AvvcPQX44tbIhf41FD0wp2C8MnvnXw?e=C3tdFk\" rel=\"noopener noreferrer nofollow\">One Drive<\/a>] and mobile for <strong>Android<\/strong> [<a href=\"https:\/\/play.google.com\/store\/apps\/details?id=edu.solfeggio\" rel=\"noopener noreferrer nofollow\">Google Play<\/a>]. The versions are very similar in functionality, but usually the desktop version is a little faster and more convenient for experiments, and also contains an additional powerful visualization module \u00abTape 3D\u00bb, which is missing in the mobile version.<\/p>\n<figure class=\"full-width\">\n<div><figcaption><em>Picture 3: visualization of ideal harmonic signal into the mobile version (flower)<\/em><\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption><em>Picture 4: visualization of acoustic signal from a microphone into the mobile version (flower + spiral)<\/em><\/figcaption><\/div>\n<\/figure>\n<p>To see sounds seriously, create three-dimensional geometric shapes with your voice and even fly into them, it is recommended to download the application, master basic skills and work directly with it. <strong>The program is free for educational and non-commercial use<\/strong>. In a case of commercial targets <a href=\"https:\/\/www.paypal.com\/donate\/?hosted_button_id=S8LGP5BQ5WA8Q\" rel=\"noopener noreferrer nofollow\">a donation of any size<\/a>(in good faith) must be performed.<\/p>\n<p>Also worth mentioning, that <strong>the app, source codes, results of researches and other related materials suggested for peaceful use<\/strong> (see for details the <a href=\"https:\/\/gitlab.com\/Makeloft-Studio\/Rainbow\/-\/wikis\/AGREEMENT\" rel=\"noopener noreferrer nofollow\"><strong>agreement<\/strong><\/a>).<\/p>\n<hr\/>\n<p>HOW TO USE THE PROGRAM?<\/p>\n<p>So, now let&#8217;s start our research. To intuitively understand how the various visualization methods work, firstly consider a single sine wave-based signal. For this:<\/p>\n<ol>\n<li>\n<p>go to \u00abSignal\u00bb section and choose \u00abGenerator\u00bb profile<\/p>\n<\/li>\n<li>\n<p>open \u00abGenerator\u00bb section and choose \u00abCamertone\u00bb profile<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\">\n<div><figcaption><em>Picture 5: sin tone<\/em><\/figcaption><\/div>\n<\/figure>\n<p>After completing these steps, you should hear a pure sine tone at the specified frequency (440 Hz by default) from your speakers. A circle will appear on the flower visualization, and an Archimedean spiral will appear on the spiral visualization. If you play with the frequency of the tone, the number of turns of the spiral will change, the value of the tone magnitude will affect on its radius.<\/p>\n<p>Now, if you fly slightly to the side in a 3D visualization, you can find a ribbon-spring, the vertical projection of which onto the horizontal plane forms the source sinusoid.<\/p>\n<figure class=\"full-width\">\n<div><figcaption><em>Picture 6: sin tone 3D<\/em><\/figcaption><\/div>\n<\/figure>\n<p>Here need to mark a record on a channel <a href=\"https:\/\/www.youtube.com\/@EugeneKhutoryansky\" rel=\"noopener noreferrer nofollow\">\u00abPhysics Videos by Eugene Khutoryansky\u00bb<\/a>, in which the same method of three-dimensional visualization is considered:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=r18Gi8lSkfM&amp;pp=ygURZm91cmllciB0cmFuc2Zvcm0%3D\" rel=\"noopener noreferrer nofollow\">Fourier Transform, Fourier Series, and frequency spectrum<\/a><\/p>\n<\/li>\n<\/ul>\n<p>If you start adding additional sinusoids of different frequencies and magnitudes to a single sinusoidal tone, then the patterns in the flower and spiral visualizations will begin to change significantly. It is important to note: although the spring ribbon will begin to twist into fancy lace curls (depending on the ratios of frequencies and magnitudes), in three-dimensional representation its projection onto the horizontal plane will still correspond to the original time frame.<\/p>\n<figure class=\"full-width\">\n<div><figcaption><em>Picture 7: harmony 3D<\/em><\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption><em>Picture 8: lace 3D<\/em><\/figcaption><\/div>\n<\/figure>\n<p>If you look at the springs exactly from the end, then the orthonormal projection will represent a circular floral geometry (this is the method used for drawing in the video channel <a href=\"https:\/\/www.youtube.com\/3Blue1Brown\" rel=\"noopener noreferrer nofollow\">\u00ab3Blue1Brown\u00bb<\/a>), while how the perspective projection will form spiral shapes.<\/p>\n<p>The variety of forms is extremely large (flowers, mandalas, lambs and many others), but significant that pure musical harmonies usually form easily readable patterns&#8230; Also by these patterns it is possible to distinguish the timbre color of various musical instruments and voices sounding on the same note.<\/p>\n<figure class=\"full-width\">\n<div><figcaption><em>Picture 9: forms<\/em><\/figcaption><\/div>\n<\/figure>\n<p>It is interesting that patterns can be both static and dynamic in nature, for example: rotating, pulsating, shimmering and flowing in a fascinating way.<\/p>\n<hr\/>\n<p>HOW IT WORKS?<\/p>\n<p>At a first approximation, there is a following algorithm:<\/p>\n<ul>\n<li>\n<p>take a short piece of audio signal with a duration of about 100 ms (time frame);<\/p>\n<\/li>\n<li>\n<p>find pure sinusoidal tones (frequencies) sounding in the signal, calculate their magnitude and phase shift with help of the Fourier transform;<\/p>\n<\/li>\n<li>\n<p>after construct and draw geometry based on this information.<\/p>\n<\/li>\n<\/ul>\n<p>But upon closer examination, everything becomes a little more complicated: the computational discrete fast Fourier transform (FFT) algorithm has some peculiarities that make high-precision signal analysis difficult. To eliminate these difficulties, the phase-magnitude interpolation (PMI) algorithm is additionally used, which is described in more details in the article <a href=\"https:\/\/gitlab.com\/Makeloft-Studio\/Rainbow\/-\/wikis\/RIDDLES-OF-THE-FAST-FOURIER-TRANSFORM\" rel=\"noopener noreferrer nofollow\">RIDDLES OF THE FAST FOURIER TRANSFORM<\/a>.<\/p>\n<p>As for the final geometric constructions, they are based on <a href=\"https:\/\/gitlab.com\/Makeloft-Studio\/Solfeggio\/-\/blob\/master\/Solfeggio\/Solfeggio\/Presenters\/GeometryPresenter.cs?ref_type=heads\" rel=\"noopener noreferrer nofollow\">the following algorithm<\/a> in a programming language <a href=\"https:\/\/ru.wikipedia.org\/wiki\/C_Sharp\" rel=\"noopener noreferrer nofollow\">C#<\/a>:<\/p>\n<pre><code class=\"cs\">public class GeometryPresenter { public static IEnumerable&lt;Point> Draw( IList&lt;Bin> peaks, int sampleSize, double sampleRate, double approximation = 1d, double spiralStep = 0d, double phaseAngle = 0d ) { if (peaks.Count.Is(0)) yield break;  var spiralScale = 1d; var pointsCount = (int)(sampleSize \/ approximation);  for (var i = 0; i &lt; pointsCount; i++, spiralScale -= spiralStep) { var a = 0d; var b = 0d;  for (var j = 0; j &lt; peaks.Count; j++) { var peak = peaks[j]; var w = Pi.Double * peak.Frequency; var t = 2d * i \/ sampleRate * approximation; var phase = peak.Phase + w * t + phaseAngle; var magnitude = peak.Magnitude * spiralScale;  a += magnitude * Math.Cos(phase); b += magnitude * Math.Sin(phase); }  yield return new(a, b); } } } <\/code><\/pre>\n<p>The source code of the 3D visualization algorithm is available <a href=\"https:\/\/gitlab.com\/Makeloft-Studio\/Solfeggio\/-\/blob\/master\/Solfeggio\/Solfeggio.Win\/Views\/TapeView.xaml.cs?ref_type=heads\" rel=\"noopener noreferrer nofollow\">link<\/a>.<\/p>\n<hr\/>\n<p>FOR REFLECTION<\/p>\n<p>Although time frames of signals are often presented in two dimensions, the Fourier transform allows to expand them into three dimensions and show from previously inaccessible angles, which makes it possible to research hidden intricate geometric patterns and match them with an exact acoustic equivalent.<\/p>\n<p>This is reminiscent of holographic photographs and stereoscopic pictures, when flat images, when viewed correctly, magically acquire volume.<\/p>\n<p>Also, photoholograms and time frames of signals have another similar property: due to the fact that each piece of the hologram partially stores information about the entire scene <a href=\"https:\/\/youtube.com\/shorts\/E4l7imVEWfE?si=I53JF6u0UR0gn9Ue\" rel=\"noopener noreferrer nofollow\">when it is divided (to a certain limit)<\/a> it is still possible to view the original scene in each individual piece, but from fewer angles. Like, when the window in the room is partially covered, the picture on the street is still visible, although in order to see it you need to come closer to the window or move a little to the side. Similarly, when reducing the size of the time frame of the signal, it remains possible to recognize the original \u00abscene\u00bb from harmonics with less accuracy.<\/p>\n<hr\/>\n<p>MIRRORS OF THE ARTICLE<\/p>\n<p>EN: <a href=\"https:\/\/gitlab.com\/Makeloft-Studio\/Rainbow\/-\/wikis\/GEOMETRY-OF-SOUND\" rel=\"noopener noreferrer nofollow\">gitlab<\/a>, <a href=\"https:\/\/habr.com\/ru\/articles\/766110\/\" rel=\"noopener noreferrer nofollow\">habr<\/a><\/p>\n<p>RU: <a href=\"https:\/\/gitlab.com\/Makeloft-Studio\/Rainbow\/-\/wikis\/%D0%93%D0%95%D0%9E%D0%9C%D0%95%D0%A2%D0%A0%D0%98%D0%AF-%D0%97%D0%92%D0%A3%D0%9A%D0%90\" rel=\"noopener noreferrer nofollow\">gitlab<\/a>, <a href=\"https:\/\/habr.com\/ru\/articles\/765170\/\" rel=\"noopener noreferrer nofollow\">habr<\/a><\/p>\n<hr\/>\n<p>ADDITIONAL MATERIALS<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/gitlab.com\/Makeloft-Studio\/Rainbow\/-\/wikis\/RIDDLES-OF-THE-FAST-FOURIER-TRANSFORM\" rel=\"noopener noreferrer nofollow\">RIDDLES OF THE FAST FOURIER TRANSFORM<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.3blue1brown.com\/lessons\/fourier-series\" rel=\"noopener noreferrer nofollow\">Fourier series<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=MBnnXbOM5S4&amp;pp=ygUUM2JsdWUxYnJvd24gZm91cmllciA%3D\" rel=\"noopener noreferrer nofollow\">The more general uncertainty principle, regarding Fourier transforms<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/766110\/\"> https:\/\/habr.com\/ru\/articles\/766110\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-356967","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/356967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=356967"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/356967\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=356967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=356967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=356967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}