{"id":41,"date":"2021-11-12T02:49:44","date_gmt":"2021-11-12T02:49:44","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/mccludav\/?p=41"},"modified":"2021-11-12T02:49:44","modified_gmt":"2021-11-12T02:49:44","slug":"audio-loop-station-5th-entry","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/mccludav\/2021\/11\/12\/audio-loop-station-5th-entry\/","title":{"rendered":"Audio Loop Station, 5th Entry"},"content":{"rendered":"\n<p class=\"has-text-color has-extra-large-font-size\" style=\"color:#dc29d3\">FFT and IFFT Implementation<\/p>\n\n\n\n<p>This week I was able to implement FFT, and IFFT functions into my program.  I proved to myself that it was working by printing out the original time-based real data, followed by FFT transform of that data, followed by IFFT transform of the frequency data.  I was excited to verify that the original time-based signal was reproduced as shown in the pic below.  I verified the results printing portions of the time sequence at the beginning, middle, and end of it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4756\/files\/2021\/11\/Standup-4-Pic-1.png\" alt=\"\" class=\"wp-image-43\" width=\"610\" height=\"403\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4756\/files\/2021\/11\/Standup-4-Pic-1.png 908w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4756\/files\/2021\/11\/Standup-4-Pic-1-300x198.png 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4756\/files\/2021\/11\/Standup-4-Pic-1-768x507.png 768w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><figcaption>t-space to f-space, and back again to t-space<\/figcaption><\/figure>\n\n\n\n<p class=\"has-text-color has-extra-large-font-size\" style=\"color:#dc29d3\">Pitch Shifting, and Time Stretching<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">It occurs to me that pitch shifting (while keeping time), and time stretching without changing frequency may not be as easy as I thought.  I will have to return to MathCad and study that concept some more.  One problem I have is that when using FFT, a number of points that is a power of 2 is used.  That means, I will have to zero-pad a time-signal at the end with a zero signal prior to entering into an FFT routine.  How does that zero-padding with FFT compare to just FT without zero-padding.  I must study this and understand it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"968\" height=\"239\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4756\/files\/2021\/11\/Blog-7-Pic-1.png\" alt=\"\" class=\"wp-image-44\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4756\/files\/2021\/11\/Blog-7-Pic-1.png 968w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4756\/files\/2021\/11\/Blog-7-Pic-1-300x74.png 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4756\/files\/2021\/11\/Blog-7-Pic-1-768x190.png 768w\" sizes=\"auto, (max-width: 968px) 100vw, 968px\" \/><figcaption>A constant frequency signal that is double time-stretched, then 0-padded at end.<\/figcaption><\/figure>\n\n\n\n<p>I may encounter sinc function considerations as I do this, as the above functions can be thought of an arbitrary time signal multiplied by a time-shifted step function that is initially 1, and then 0 after the signal is played.  This would be equivalent to zero-padding.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"403\" height=\"369\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4756\/files\/2021\/11\/Blog-7-Pic-2.png\" alt=\"\" class=\"wp-image-45\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4756\/files\/2021\/11\/Blog-7-Pic-2.png 403w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/4756\/files\/2021\/11\/Blog-7-Pic-2-300x275.png 300w\" sizes=\"auto, (max-width: 403px) 100vw, 403px\" \/><figcaption>sinc function from step functions or pulses<\/figcaption><\/figure>\n\n\n\n<p class=\"has-text-color has-extra-large-font-size\" style=\"color:#dc29d3\">O(N-N) or O(N-log(N))<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Will pitch shifting while maintaining time, and time-stretching while maintaining involve convolution?  If so, the run times will tend to N-squared.  If not then then run times can remain as N-log(N).  If convolution is unavoidable, then I may be better off not using Fast Fourier Transforms that would need 0-padding.  I should just use Fourier Transforms since N-squared run-times become unavoidable.<\/p>\n\n\n\n<p>It&#8217;s time to do some simulations.  This time I will use a single frequency sine wave run over part of a time interval, after which it is turned off to simulate 0-padding.  I must then determine what happens in frequency space during pitch shifting, and time-stretching.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>FFT and IFFT Implementation This week I was able to implement FFT, and IFFT functions into my program. I proved to myself that it was working by printing out the original time-based real data, followed by FFT transform of that data, followed by IFFT transform of the frequency data. I was excited to verify that&hellip; <a class=\"more-link\" href=\"https:\/\/blogs.oregonstate.edu\/mccludav\/2021\/11\/12\/audio-loop-station-5th-entry\/\">Continue reading <span class=\"screen-reader-text\">Audio Loop Station, 5th Entry<\/span><\/a><\/p>\n","protected":false},"author":11630,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-41","post","type-post","status-publish","format-standard","hentry","category-uncategorized","entry"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/mccludav\/wp-json\/wp\/v2\/posts\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/mccludav\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/mccludav\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/mccludav\/wp-json\/wp\/v2\/users\/11630"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/mccludav\/wp-json\/wp\/v2\/comments?post=41"}],"version-history":[{"count":1,"href":"https:\/\/blogs.oregonstate.edu\/mccludav\/wp-json\/wp\/v2\/posts\/41\/revisions"}],"predecessor-version":[{"id":46,"href":"https:\/\/blogs.oregonstate.edu\/mccludav\/wp-json\/wp\/v2\/posts\/41\/revisions\/46"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/mccludav\/wp-json\/wp\/v2\/media?parent=41"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/mccludav\/wp-json\/wp\/v2\/categories?post=41"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/mccludav\/wp-json\/wp\/v2\/tags?post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}