{"id":8095,"date":"2024-05-03T14:49:22","date_gmt":"2024-05-03T12:49:22","guid":{"rendered":"http:\/\/www.tonmeister.ca\/wordpress\/?p=8095"},"modified":"2024-05-28T15:20:10","modified_gmt":"2024-05-28T13:20:10","slug":"perfect-symmetry","status":"publish","type":"post","link":"http:\/\/www.tonmeister.ca\/wordpress\/2024\/05\/03\/perfect-symmetry\/","title":{"rendered":"Perfect symmetry"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">When working on the last series of posts, I stumbled on a signal that caused an FFT analysis to look a little strange to me. This post is about that strangeness.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If I make a sine wave (in a floating point world) that sits perfectly on an FFT bin, and I do an FFT of it, the noise floor that I see is the result a lack of precision of the calculations that were used to make the signal. An example of this is shown in Figure 1.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/symmetry_fig_01-1024x768.png\" alt=\"\" class=\"wp-image-8096\" srcset=\"http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/symmetry_fig_01-1024x768.png 1024w, http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/symmetry_fig_01-300x225.png 300w, http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/symmetry_fig_01-768x576.png 768w, http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/symmetry_fig_01.png 1120w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Figure 1. Two plots of the same analysis. The top plot has a logarithmic frequency scale and a range of 20 Hz to 20 kHz. The bottom plot is on a linear frequency scale, and has a range of 0 Hz to 2 kHz.<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">As can be seen there, the noise floor in the fit is typically at least 300 dB down from the signal level. This means that if the signal has a peak amplitude of 1, then each bin in my FFT has a peak amplitude of less than 0.000 000 000 000 001, which is very, very, low.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If I dither and quantise the sine wave with, say, a 24-bit LPCM precision, then the result would be different, as shown in Figure 2.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/symmetry_fig_02-1024x768.png\" alt=\"\" class=\"wp-image-8097\" srcset=\"http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/symmetry_fig_02-1024x768.png 1024w, http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/symmetry_fig_02-300x225.png 300w, http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/symmetry_fig_02-768x576.png 768w, http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/symmetry_fig_02.png 1120w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Figure 2. Two plots of the same analysis. The top plot has a logarithmic frequency scale and a range of 20 Hz to 20 kHz. The bottom plot is on a linear frequency scale, and has a range of 0 Hz to 2 kHz.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now the noise floor seen in the FFT analysis is the noise that is intentionally generated as dither to randomise the quantisation error when converting to LPCM.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, what happens if the signal is quantised but not dithered? Then the result looks like Figure 3.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/symmetry_fig_03-1024x768.png\" alt=\"\" class=\"wp-image-8099\" style=\"width:840px;height:auto\" srcset=\"http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/symmetry_fig_03-1024x768.png 1024w, http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/symmetry_fig_03-300x225.png 300w, http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/symmetry_fig_03-768x576.png 768w, http:\/\/www.tonmeister.ca\/wordpress\/wp-content\/uploads\/symmetry_fig_03.png 1120w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Figure 3.<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">This is interesting because, starting the first bin, every second bin has nothing in it, so on a decibel scale, the value is -\u221e dB. Why does this happen?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The short answer is symmetry. By quantising the sine wave, I made it perfectly symmetrical.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This removes the DC content, since the positive-going portion of the waveform is identical to the negative-going portion. Therefore there&#8217;s nothing at 0 Hz (which is DC) or any of its &#8220;harmonics&#8221; (at least in the world of FFT bins&#8230;).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There is content of some kind in the other bins because our sine wave is not perfectly sinusoidal. All those steps that I put in it are an error that generates information at frequency centres other than the sine tone&#8217;s itself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, if you do an FFT on a sinusoidal signal and you see a result where half of the bins have nothing in them, one possible reason is that you&#8217;re dealing with a perfectly symmetrical signal.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When working on the last series of posts, I stumbled on a signal that caused an FFT analysis to look a little strange to me. This post is about that strangeness. If I make a sine wave (in a floating point world) that sits perfectly on an FFT bin, and I do an FFT of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[63,4,59,42],"tags":[],"class_list":["post-8095","post","type-post","status-publish","format-standard","hentry","category-analysis","category-audio","category-digital-audio","category-math"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p48hIM-26z","_links":{"self":[{"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/posts\/8095","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/comments?post=8095"}],"version-history":[{"count":3,"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/posts\/8095\/revisions"}],"predecessor-version":[{"id":8106,"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/posts\/8095\/revisions\/8106"}],"wp:attachment":[{"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/media?parent=8095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/categories?post=8095"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.tonmeister.ca\/wordpress\/wp-json\/wp\/v2\/tags?post=8095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}