{"id":9,"date":"2005-03-17T17:24:42","date_gmt":"2005-03-17T17:24:42","guid":{"rendered":"http:\/\/ahay.org\/blog\/?p=9"},"modified":"2015-08-04T23:51:53","modified_gmt":"2015-08-04T23:51:53","slug":"fft","status":"publish","type":"post","link":"https:\/\/ahay.org\/blog\/2005\/03\/17\/fft\/","title":{"rendered":"FFT"},"content":{"rendered":"<p><b>How is FFT implemented in RSF?  What FFT conventions are used?  What choices of array size are efficient?<\/b><br \/>\nThere are two main fft programs: <a href=\"\/RSF\/sffft1.html\">sffft1<\/a> and <a href=\"\/RSF\/sffft3.html\">sffft3<\/a>.<br \/>\n<u>sffft1<\/u> takes real input and transforms it to complex by applying real-to-complex FFT on the first axis. It does the inverse transform when <b>inv=y<\/b>.<br \/>\n<u>sffft3<\/u> applies complex-to-complex FFT on the specified <b>axis<\/b>. The sign of the transform is determined by the <b>sign<\/b> parameter.<br \/>\n<a href=\"\/RSF\/sffft1.html\">sfcosft<\/a> applies real-to-real cosine transform.<br \/>\nHere is an example 2-D FFT figure from <a href=\"http:\/\/sepwww.stanford.edu\/sep\/prof\/bei\/ft1\/paper_html\/node15.html\">Jon Claerbout<\/a> reproduced in <a href=\"\/RSF\/book\/bei\/ft1\/plane4.html\">bei\/ft1\/plane4<\/a>:<br \/>\n<img decoding=\"async\" src=\"\/RSF\/book\/bei\/ft1\/plane4\/Fig\/plane4.png\" alt=\"\" \/><br \/>\nRSF utilizes the <a href=\"http:\/\/sourceforge.net\/projects\/kissfft\/\">KISS FFT<\/a> library for applying FFT. There are some faster open-source software solutions available, most notably <a href=\"http:\/\/www.fftw.org\/\">FFTW<\/a> but KISS (Keep It Simple, Stupid) FFT is attractive because of it simplicity and compactness. The library can handle an arbitrary data size. However, some sizes (prime factor powers) are more efficient than others. For example, here are CPU times for running <b>sffft1<\/b> on files with different sizes:<\/p>\n<table  border=\"1\" cellspacing=\"1\" cellpadding=\"0\" class=\"table table-bordered table-striped\">\n<tr>\n<th bgcolor=\"#99CCCC\">n1<\/th>\n<th bgcolor=\"#99CCCC\">CPU time<\/th>\n<\/tr>\n<tr>\n<td align=\"right\"> 999,999 <\/td>\n<td align=\"center\"> 0.01 s<\/td>\n<\/tr>\n<tr>\n<td align=\"right\"> 1,000,000 <\/td>\n<td align=\"center\"> 0.01 s<\/td>\n<\/tr>\n<tr>\n<td align=\"right\"> 1,000,001 <\/td>\n<td align=\"center\">   1.64 s<\/td>\n<\/tr>\n<\/table>\n<p><font color=\"red\"><b>Update:<\/b> <u>sffft1<\/u>, <u>sffft3<\/u>, and some other programs that use FFT, now pad the data to the nearest optimal size.<\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How is FFT implemented in RSF? What FFT conventions are used? What choices of array size are efficient? There are two main fft programs: sffft1 and sffft3. sffft1 takes real input and transforms it to complex by applying real-to-complex FFT on the first axis. It does the inverse transform when inv=y. sffft3 applies complex-to-complex FFT [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","activitypub_content_warning":"","activitypub_content_visibility":"local","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"","footnotes":""},"categories":[4],"tags":[],"class_list":["post-9","post","type-post","status-publish","format-standard","hentry","category-faq"],"_links":{"self":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/comments?post=9"}],"version-history":[{"count":1,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/9\/revisions"}],"predecessor-version":[{"id":906,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/9\/revisions\/906"}],"wp:attachment":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/media?parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/categories?post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/tags?post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}