From b364e9aa0cf1f0a580a5d97bd953f8b75c573966 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Tue, 7 Jun 2016 21:03:40 -0400 Subject: [PATCH] Initial checkin --- .gitignore | 8 + LICENSE | 717 +++++ app/.gitignore | 1 + app/build.gradle | 34 + app/proguard-rules.pro | 20 + app/src/main/AndroidManifest.xml | 32 + .../acmetensortoys/watchviz/MainActivity.java | 266 ++ .../java/org/jtransforms/fft/FloatFFT_1D.java | 1277 ++++++++ .../org/jtransforms/utils/CommonUtils.java | 2653 +++++++++++++++++ app/src/main/res/layout/activity_main.xml | 64 + app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3391 bytes app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2363 bytes app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4575 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7171 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 9708 bytes app/src/main/res/values/strings.xml | 4 + build.gradle | 23 + gradle.properties | 18 + settings.gradle | 1 + 19 files changed, 5118 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 app/.gitignore create mode 100644 app/build.gradle create mode 100644 app/proguard-rules.pro create mode 100644 app/src/main/AndroidManifest.xml create mode 100644 app/src/main/java/com/acmetensortoys/watchviz/MainActivity.java create mode 100644 app/src/main/java/org/jtransforms/fft/FloatFFT_1D.java create mode 100644 app/src/main/java/org/jtransforms/utils/CommonUtils.java create mode 100644 app/src/main/res/layout/activity_main.xml create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 app/src/main/res/values/strings.xml create mode 100644 build.gradle create mode 100644 gradle.properties create mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c6cbe56 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6e8cb6e --- /dev/null +++ b/LICENSE @@ -0,0 +1,717 @@ +This project contains code under multiple licenses: + + - The directory app/src/main/java/org/jtransforms and its contents are + distributed under a 2-BSD license reproduced below. The contents + of the files therein have been heavily reduced from the versions + available at https://github.com/wendykierp/JTransforms to just contain + a single-theaded 1-dimensional float-resolution FFT, in an effort to + placate proguard. No other modifications have been (deliberately) + made. + + - All other files, but especially including the directory + app/src/main/java/com/acmetensortoys and its contents, are made + available under the GNU AGPLv3, also reproduced (in its entirety) below. + Several of these files originally come from the Android Studio + templates, which are "Copyright (c) 2005-2014, The Android Open Source + Project" and are "Licensed under the Apache License, Version 2.0". The + relicensing of these files under AGPLv3 is as per + http://www.apache.org/licenses/GPL-compatibility.html . + + - Some assets were created using Android Asset Studio + (https://romannurik.github.io/AndroidAssetStudio) and are therefore + made available here under a "Creative Commons Attribution 3.0 Unported + License": + + app/src/main/res/mipmap-*/ic_launcher.png + +JTransforms License +################### + +JTransforms +Copyright (c) 2007 onward, Piotr Wendykier +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +AGPLv3 +###### + + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..fd20a0d --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,34 @@ +apply plugin: 'com.android.application' + +android { + signingConfigs { + } + compileSdkVersion 23 + buildToolsVersion "23.0.3" + defaultConfig { + applicationId "com.acmetensortoys.watchviz" + minSdkVersion 23 + targetSdkVersion 23 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + dexOptions { + } +} + +dependencies { + compile fileTree(include: ['*.jar'], dir: 'libs') + compile 'com.google.android.support:wearable:2.0.0-alpha1' + compile 'com.google.android.gms:play-services-wearable:9.0.2' +} + +dependencies { + // compile 'com.github.wendykierp:JTransforms:3.1' // brought just the bit we need in + compile 'org.apache.commons:commons-math3:+' +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..427ca83 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,20 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /home/nwf/Android/Sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# This apparently wants some part of the AWT, which we don't have. Whatever. +-dontwarn org.apache.commons.math3.geometry.euclidean.twod.Line \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..debbb76 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/acmetensortoys/watchviz/MainActivity.java b/app/src/main/java/com/acmetensortoys/watchviz/MainActivity.java new file mode 100644 index 0000000..841f16d --- /dev/null +++ b/app/src/main/java/com/acmetensortoys/watchviz/MainActivity.java @@ -0,0 +1,266 @@ +/* + AcmeTensorToys WatchViz: a sound visualization application for Android Wear + Copyright (C) 2016 Nathaniel Wesley Filardo + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + +package com.acmetensortoys.watchviz; + +import android.Manifest; +import android.content.pm.PackageManager; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.PorterDuff; +import android.media.AudioFormat; +import android.media.AudioRecord; +import android.media.MediaRecorder; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.wearable.activity.WearableActivity; +import android.support.wearable.view.BoxInsetLayout; +import android.util.Log; +import android.view.SurfaceHolder; +import android.view.SurfaceView; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.TextView; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; + +import org.jtransforms.fft.FloatFFT_1D; + +public class MainActivity extends WearableActivity +{ + private static final SimpleDateFormat AMBIENT_DATE_FORMAT = + new SimpleDateFormat("HH:mm", Locale.US); + + private BoxInsetLayout mOuterContainer; + private LinearLayout mInnerContainer; + private TextView mTextView, mClockView, mDebugView; + private boolean doDebug = false; + + private SurfaceView cyclersv; + private Thread cycler; + + // The surface to which this callback is bound is created only after audio permissions + // have been checked. We therefore can simply start in the created callback. Stopping + // happens in onPause below, which fires before the surface is destroyed. + private SurfaceHolder.Callback shc = new SurfaceHolder.Callback() { + @Override + public void surfaceCreated(final SurfaceHolder h) { + Log.d("shc", "Surface Created"); + Canvas c = h.lockCanvas(); + c.drawColor(Color.RED); + h.unlockCanvasAndPost(c); + + final TextView dbv = mDebugView; + final AudioRecord ar = new AudioRecord( + MediaRecorder.AudioSource.MIC, + 11025, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_FLOAT, 2048); + Log.d("shc", "Audio session ID:" + ar.getAudioSessionId()); + + cycler = new Thread() { + public void run() { + float[] hsv = new float[]{0.0f, 1.0f, 1.0f}; + float[] samples = new float[512]; + FloatFFT_1D fft = new FloatFFT_1D(samples.length); + + /* + * Debug: triangle wave + * + for(int i = 0; i < samples.length; i++) { + samples[i] = (float)((i % 16) - 8) / 8; + if (i % 32 >= 16) { samples[i] *= -1; } + } + */ + ar.startRecording(); + while (!Thread.interrupted()) { + ar.read(samples, 0, samples.length, AudioRecord.READ_BLOCKING); + fft.realForward(samples); + + float msamp = 0.0f; + int mix = -1; + for (int i = 0; i < samples.length; i += 2) { + if (samples[i] > msamp) { + msamp = samples[i]; + mix = i; + } + } + if (doDebug) { + final float fmsamp = msamp; + final int fmix = mix; + dbv.post(new Runnable() { + public void run() { + dbv.setText(String.format(Locale.US, "%1$8.1E @ %2$d", fmsamp, fmix)); + } + }); + } + + int canvalpha = msamp > 3 ? 255 : (int) (msamp * 64) + 63; // XXX wtf scale? + + int c = Color.HSVToColor(hsv); + hsv[0] = hsv[0] >= 359 ? 0.0f : hsv[0] + 1.0f; + + Canvas cv = h.lockCanvas(); + cv.drawColor(c); + cv.drawColor(Color.rgb(canvalpha, canvalpha, canvalpha), PorterDuff.Mode.MULTIPLY); + h.unlockCanvasAndPost(cv); + + // try { Thread.sleep(100); } catch (InterruptedException e) { break; } + } + ar.stop(); + ar.release(); + Log.d("cycler", "exit"); + } + }; + cycler.start(); + } + + @Override + public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { + Log.d("shc", "Surface Changed"); + ; + } + + @Override + public void surfaceDestroyed(SurfaceHolder holder) { + Log.d("shc", "Surface Destroyed"); + } + }; + + private void createSurface() { + Log.d("createSurface", "top"); + cyclersv = new SurfaceView(this); + + cyclersv.getHolder().addCallback(shc); + + mInnerContainer.addView(cyclersv, -1, + new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT)); + } + + private void removeSurface() { + Log.d("removeSurface", "stopping cycler"); + if(cycler != null) { + cycler.interrupt(); + try { cycler.join(); } + catch (InterruptedException e) { Log.d("shc", "IE while join cycler"); } + } + Log.d("removeSurface", "removing view"); + mInnerContainer.removeView(cyclersv); + Log.d("removeSurface", "done"); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + setAmbientEnabled(); + + mOuterContainer = (BoxInsetLayout) findViewById(R.id.top_container); + mInnerContainer = (LinearLayout) findViewById(R.id.linear_container); + mTextView = (TextView) findViewById(R.id.text); + mDebugView = (TextView) findViewById(R.id.dbg); + mClockView = (TextView) findViewById(R.id.clock); + + updateDisplay(); + } + + @Override + public void onStart() { + Log.d("onStart", "top"); + super.onStart(); + + if(checkSelfPermission(Manifest.permission.RECORD_AUDIO) + == PackageManager.PERMISSION_GRANTED) { + createSurface(); + } else { + requestPermissions(new String[]{Manifest.permission.RECORD_AUDIO}, 1); + } + } + + @Override + public void onRequestPermissionsResult(int rq, @NonNull String[] ps, @NonNull int[] rs) { + if(rq == 1) { + if (rs[0] == 1) { + createSurface(); + } else { + //TODO: Something else + throw new RuntimeException("asdf"); + } + } + } + + @Override + public void onEnterAmbient(Bundle ambientDetails) { + super.onEnterAmbient(ambientDetails); + updateDisplay(); + } + + @Override + public void onUpdateAmbient() { + super.onUpdateAmbient(); + updateDisplay(); + } + + @Override + public void onExitAmbient() { + updateDisplay(); + super.onExitAmbient(); + } + + private void updateDisplay() { + final int black = getResources().getColor(android.R.color.black,null); + mClockView.setText(AMBIENT_DATE_FORMAT.format(new Date())); + + if (isAmbient()) { + final int white = getResources().getColor(android.R.color.white,null); + mOuterContainer.setBackgroundColor(black); + mTextView.setTextColor(white); + mClockView.setTextColor(white); + mDebugView.setVisibility(View.GONE); + doDebug = false; + } else { + mOuterContainer.setBackground(null); + mTextView.setTextColor(black); + mClockView.setTextColor(black); + mDebugView.setVisibility(View.VISIBLE); + doDebug = true; + } + } + + @Override + public void onPause() { + Log.d("onPause", "top"); + removeSurface(); + super.onPause(); + } + + @Override + public void onStop() { + Log.d("onStop", "top"); + super.onStop(); + } + + @Override + public void onDestroy() { + Log.d("onDestroy", "top"); + super.onDestroy(); + } +} diff --git a/app/src/main/java/org/jtransforms/fft/FloatFFT_1D.java b/app/src/main/java/org/jtransforms/fft/FloatFFT_1D.java new file mode 100644 index 0000000..aa6a990 --- /dev/null +++ b/app/src/main/java/org/jtransforms/fft/FloatFFT_1D.java @@ -0,0 +1,1277 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * JTransforms + * Copyright (c) 2007 onward, Piotr Wendykier + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ +package org.jtransforms.fft; + +import org.jtransforms.utils.CommonUtils; +import static org.apache.commons.math3.util.FastMath.*; + +/** + * Computes 1D Discrete Fourier Transform (DFT) of complex and real, single + * precision data. The size of the data can be an arbitrary number. + *
+ * This code is derived from General Purpose FFT Package written by Takuya Ooura + * (http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html) and from JFFTPack written + * by Baoshe Zhang (http://jfftpack.sourceforge.net/) + * + * @author Piotr Wendykier (piotr.wendykier@gmail.com) + */ +public final class FloatFFT_1D +{ + private enum Plans + { + SPLIT_RADIX, MIXED_RADIX, BLUESTEIN + } + + private int n; + + private int nBluestein; + + private int[] ip; + + private float[] w; + + private int nw; + + private int nc; + + private float[] wtable; + + private float[] wtable_r; + + private float[] bk1; + + private float[] bk2; + + private Plans plan; + + private static final int[] factors = {4, 2, 3, 5}; + + private static final float PI = 3.14159265358979311599796346854418516f; + + private static final float TWO_PI = 6.28318530717958623199592693708837032f; + + /** + * Creates new instance of FloatFFT_1D. + * + * @param n size of data + */ + public FloatFFT_1D(long n) + { + if (n < 1) { + throw new IllegalArgumentException("n must be greater than 0"); + } + this.n = (int) n; + if (!CommonUtils.isPowerOf2(n)) { + if (CommonUtils.getReminder(n, factors) >= 211) { + plan = Plans.BLUESTEIN; + nBluestein = CommonUtils.nextPow2(this.n * 2 - 1); + bk1 = new float[2 * nBluestein]; + bk2 = new float[2 * nBluestein]; + this.ip = new int[2 + (int) ceil(2 + (1 << (int) (log(nBluestein + 0.5f) / log(2)) / 2))]; + this.w = new float[nBluestein]; + int twon = 2 * nBluestein; + nw = twon >> 2; + CommonUtils.makewt(nw, ip, w); + nc = nBluestein >> 2; + CommonUtils.makect(nc, w, nw, ip); + bluesteini(); + } else { + plan = Plans.MIXED_RADIX; + wtable = new float[4 * this.n + 15]; + wtable_r = new float[2 * this.n + 15]; + cffti(); + rffti(); + } + } else { + plan = Plans.SPLIT_RADIX; + this.ip = new int[2 + (int) ceil(2 + (1 << (int) (log(n + 0.5f) / log(2)) / 2))]; + this.w = new float[this.n]; + int twon = 2 * this.n; + nw = twon >> 2; + CommonUtils.makewt(nw, ip, w); + nc = this.n >> 2; + CommonUtils.makect(nc, w, nw, ip); + } + } + + /** + * Computes 1D forward DFT of real data leaving the result in a + * . The physical layout of the output data is as follows:
+ * + * if n is even then + * + *
+     * a[2*k] = Re[k], 0<=k<n/2 
+     * a[2*k+1] = Im[k], 0<k<n/2 
+     * a[1] = Re[n/2]
+     * 
+ * + * if n is odd then + * + *
+     * a[2*k] = Re[k], 0<=k<(n+1)/2 
+     * a[2*k+1] = Im[k], 0<k<(n-1)/2
+     * a[1] = Im[(n-1)/2]
+     * 
+ * + * This method computes only half of the elements of the real transform. The + * other half satisfies the symmetry condition. If you want the full real + * forward transform, use realForwardFull. To get back the + * original data, use realInverse on the output of this method. + * + * @param a data to transform + */ + public void realForward(float[] a) + { + realForward(a, 0); + } + + + /** + * Computes 1D forward DFT of real data leaving the result in a + * . The physical layout of the output data is as follows:
+ * + * if n is even then + * + *
+     * a[offa+2*k] = Re[k], 0<=k<n/2 
+     * a[offa+2*k+1] = Im[k], 0<k<n/2
+     * a[offa+1] = Re[n/2]
+     * 
+ * + * if n is odd then + * + *
+     * a[offa+2*k] = Re[k], 0<=k<(n+1)/2 
+     * a[offa+2*k+1] = Im[k], 0<k<(n-1)/2 
+     * a[offa+1] = Im[(n-1)/2]
+     * 
+ * + * This method computes only half of the elements of the real transform. The + * other half satisfies the symmetry condition. If you want the full real + * forward transform, use realForwardFull. To get back the + * original data, use realInverse on the output of this method. + * + * @param a data to transform + * @param offa index of the first element in array a + */ + public void realForward(float[] a, int offa) { + if (n == 1) { + return; + } + + switch (plan) { + case SPLIT_RADIX: + float xi; + + if (n > 4) { + CommonUtils.cftfsub(n, a, offa, ip, nw, w); + CommonUtils.rftfsub(n, a, offa, nc, w, nw); + } else if (n == 4) { + CommonUtils.cftx020(a, offa); + } + xi = a[offa] - a[offa + 1]; + a[offa] += a[offa + 1]; + a[offa + 1] = xi; + break; + case MIXED_RADIX: + rfftf(a, offa); + for (int k = n - 1; k >= 2; k--) { + int idx = offa + k; + float tmp = a[idx]; + a[idx] = a[idx - 1]; + a[idx - 1] = tmp; + } + break; + case BLUESTEIN: + bluestein_real_forward(a, offa); + break; + } + } + + /* -------- initializing routines -------- */ + + final void cffti() + { + if (n == 1) { + return; + } + + final int twon = 2 * n; + final int fourn = 4 * n; + float argh; + int idot, ntry = 0, i, j; + float argld; + int i1, k1, l1, l2, ib; + float fi; + int ld, ii, nf, ipll, nll, nq, nr; + float arg; + int ido, ipm; + + nll = n; + nf = 0; + j = 0; + + factorize_loop: + while (true) { + j++; + if (j <= 4) { + ntry = factors[j - 1]; + } else { + ntry += 2; + } + do { + nq = nll / ntry; + nr = nll - ntry * nq; + if (nr != 0) { + continue factorize_loop; + } + nf++; + wtable[nf + 1 + fourn] = ntry; + nll = nq; + if (ntry == 2 && nf != 1) { + for (i = 2; i <= nf; i++) { + ib = nf - i + 2; + int idx = ib + fourn; + wtable[idx + 1] = wtable[idx]; + } + wtable[2 + fourn] = 2; + } + } while (nll != 1); + break; + } + wtable[fourn] = n; + wtable[1 + fourn] = nf; + argh = TWO_PI / (float) n; + i = 1; + l1 = 1; + for (k1 = 1; k1 <= nf; k1++) { + ipll = (int) wtable[k1 + 1 + fourn]; + ld = 0; + l2 = l1 * ipll; + ido = n / l2; + idot = ido + ido + 2; + ipm = ipll - 1; + for (j = 1; j <= ipm; j++) { + i1 = i; + wtable[i - 1 + twon] = 1; + wtable[i + twon] = 0; + ld += l1; + fi = 0; + argld = ld * argh; + for (ii = 4; ii <= idot; ii += 2) { + i += 2; + fi += 1; + arg = fi * argld; + int idx = i + twon; + wtable[idx - 1] = (float) cos(arg); + wtable[idx] = (float) sin(arg); + } + if (ipll > 5) { + int idx1 = i1 + twon; + int idx2 = i + twon; + wtable[idx1 - 1] = wtable[idx2 - 1]; + wtable[idx1] = wtable[idx2]; + } + } + l1 = l2; + } + + } + + void rffti() + { + + if (n == 1) { + return; + } + final int twon = 2 * n; + float argh; + int ntry = 0, i, j; + float argld; + int k1, l1, l2, ib; + float fi; + int ld, ii, nf, ipll, nll, is, nq, nr; + float arg; + int ido, ipm; + int nfm1; + + nll = n; + nf = 0; + j = 0; + + factorize_loop: + while (true) { + ++j; + if (j <= 4) { + ntry = factors[j - 1]; + } else { + ntry += 2; + } + do { + nq = nll / ntry; + nr = nll - ntry * nq; + if (nr != 0) { + continue factorize_loop; + } + ++nf; + wtable_r[nf + 1 + twon] = ntry; + + nll = nq; + if (ntry == 2 && nf != 1) { + for (i = 2; i <= nf; i++) { + ib = nf - i + 2; + int idx = ib + twon; + wtable_r[idx + 1] = wtable_r[idx]; + } + wtable_r[2 + twon] = 2; + } + } while (nll != 1); + break; + } + wtable_r[twon] = n; + wtable_r[1 + twon] = nf; + argh = TWO_PI / (float) (n); + is = 0; + nfm1 = nf - 1; + l1 = 1; + if (nfm1 == 0) { + return; + } + for (k1 = 1; k1 <= nfm1; k1++) { + ipll = (int) wtable_r[k1 + 1 + twon]; + ld = 0; + l2 = l1 * ipll; + ido = n / l2; + ipm = ipll - 1; + for (j = 1; j <= ipm; ++j) { + ld += l1; + i = is; + argld = (float) ld * argh; + + fi = 0; + for (ii = 3; ii <= ido; ii += 2) { + i += 2; + fi += 1; + arg = fi * argld; + int idx = i + n; + wtable_r[idx - 2] = (float) cos(arg); + wtable_r[idx - 1] = (float) sin(arg); + } + is += ido; + } + l1 = l2; + } + } + + private void bluesteini() + { + int k = 0; + float arg; + float pi_n = PI / n; + bk1[0] = 1; + bk1[1] = 0; + for (int i = 1; i < n; i++) { + k += 2 * i - 1; + if (k >= 2 * n) { + k -= 2 * n; + } + arg = pi_n * k; + bk1[2 * i] = (float) cos(arg); + bk1[2 * i + 1] = (float) sin(arg); + } + float scale = 1.0f / nBluestein; + bk2[0] = bk1[0] * scale; + bk2[1] = bk1[1] * scale; + for (int i = 2; i < 2 * n; i += 2) { + bk2[i] = bk1[i] * scale; + bk2[i + 1] = bk1[i + 1] * scale; + bk2[2 * nBluestein - i] = bk2[i]; + bk2[2 * nBluestein - i + 1] = bk2[i + 1]; + } + CommonUtils.cftbsub(2 * nBluestein, bk2, 0, ip, nw, w); + } + + + private void bluestein_real_forward(final float[] a, final int offa) + { + final float[] ak = new float[2 * nBluestein]; + + for (int i = 0; i < n; i++) { + int idx1 = 2 * i; + int idx2 = idx1 + 1; + int idx3 = offa + i; + ak[idx1] = a[idx3] * bk1[idx1]; + ak[idx2] = -a[idx3] * bk1[idx2]; + } + + CommonUtils.cftbsub(2 * nBluestein, ak, 0, ip, nw, w); + + for (int i = 0; i < nBluestein; i++) { + int idx1 = 2 * i; + int idx2 = idx1 + 1; + float im = ak[idx1] * bk2[idx2] + ak[idx2] * bk2[idx1]; + ak[idx1] = ak[idx1] * bk2[idx1] - ak[idx2] * bk2[idx2]; + ak[idx2] = im; + } + + CommonUtils.cftfsub(2 * nBluestein, ak, 0, ip, nw, w); + + if (n % 2 == 0) { + a[offa] = bk1[0] * ak[0] + bk1[1] * ak[1]; + a[offa + 1] = bk1[n] * ak[n] + bk1[n + 1] * ak[n + 1]; + for (int i = 1; i < n / 2; i++) { + int idx1 = 2 * i; + int idx2 = idx1 + 1; + a[offa + idx1] = bk1[idx1] * ak[idx1] + bk1[idx2] * ak[idx2]; + a[offa + idx2] = -bk1[idx2] * ak[idx1] + bk1[idx1] * ak[idx2]; + } + } else { + a[offa] = bk1[0] * ak[0] + bk1[1] * ak[1]; + a[offa + 1] = -bk1[n] * ak[n - 1] + bk1[n - 1] * ak[n]; + for (int i = 1; i < (n - 1) / 2; i++) { + int idx1 = 2 * i; + int idx2 = idx1 + 1; + a[offa + idx1] = bk1[idx1] * ak[idx1] + bk1[idx2] * ak[idx2]; + a[offa + idx2] = -bk1[idx2] * ak[idx1] + bk1[idx1] * ak[idx2]; + } + a[offa + n - 1] = bk1[n - 1] * ak[n - 1] + bk1[n] * ak[n]; + } + } + + /*--------------------------------------------------------- + rfftf1: further processing of Real forward FFT + --------------------------------------------------------*/ + void rfftf(final float a[], final int offa) + { + if (n == 1) { + return; + } + int l1, l2, na, kh, nf, ipll, iw, ido, idl1; + + final float[] ch = new float[n]; + final int twon = 2 * n; + nf = (int) wtable_r[1 + twon]; + na = 1; + l2 = n; + iw = twon - 1; + for (int k1 = 1; k1 <= nf; ++k1) { + kh = nf - k1; + ipll = (int) wtable_r[kh + 2 + twon]; + l1 = l2 / ipll; + ido = n / l2; + idl1 = ido * l1; + iw -= (ipll - 1) * ido; + na = 1 - na; + switch (ipll) { + case 2: + if (na == 0) { + radf2(ido, l1, a, offa, ch, 0, iw); + } else { + radf2(ido, l1, ch, 0, a, offa, iw); + } + break; + case 3: + if (na == 0) { + radf3(ido, l1, a, offa, ch, 0, iw); + } else { + radf3(ido, l1, ch, 0, a, offa, iw); + } + break; + case 4: + if (na == 0) { + radf4(ido, l1, a, offa, ch, 0, iw); + } else { + radf4(ido, l1, ch, 0, a, offa, iw); + } + break; + case 5: + if (na == 0) { + radf5(ido, l1, a, offa, ch, 0, iw); + } else { + radf5(ido, l1, ch, 0, a, offa, iw); + } + break; + default: + if (ido == 1) { + na = 1 - na; + } + if (na == 0) { + radfg(ido, ipll, l1, idl1, a, offa, ch, 0, iw); + na = 1; + } else { + radfg(ido, ipll, l1, idl1, ch, 0, a, offa, iw); + na = 0; + } + break; + } + l2 = l1; + } + if (na == 1) { + return; + } + System.arraycopy(ch, 0, a, offa, n); + } + + /*------------------------------------------------- + radf2: Real FFT's forward processing of factor 2 + -------------------------------------------------*/ + void radf2(final int ido, final int l1, final float in[], final int in_off, final float out[], final int out_off, final int offset) + { + int i, ic, idx0, idx1, idx2, idx3, idx4; + float t1i, t1r, w1r, w1i; + int iw1; + iw1 = offset; + idx0 = l1 * ido; + idx1 = 2 * ido; + for (int k = 0; k < l1; k++) { + int oidx1 = out_off + k * idx1; + int oidx2 = oidx1 + idx1 - 1; + int iidx1 = in_off + k * ido; + int iidx2 = iidx1 + idx0; + + float i1r = in[iidx1]; + float i2r = in[iidx2]; + + out[oidx1] = i1r + i2r; + out[oidx2] = i1r - i2r; + } + if (ido < 2) { + return; + } + if (ido != 2) { + for (int k = 0; k < l1; k++) { + idx1 = k * ido; + idx2 = 2 * idx1; + idx3 = idx2 + ido; + idx4 = idx1 + idx0; + for (i = 2; i < ido; i += 2) { + ic = ido - i; + int widx1 = i - 1 + iw1; + int oidx1 = out_off + i + idx2; + int oidx2 = out_off + ic + idx3; + int iidx1 = in_off + i + idx1; + int iidx2 = in_off + i + idx4; + + float a1i = in[iidx1 - 1]; + float a1r = in[iidx1]; + float a2i = in[iidx2 - 1]; + float a2r = in[iidx2]; + + w1r = wtable_r[widx1 - 1]; + w1i = wtable_r[widx1]; + + t1r = w1r * a2i + w1i * a2r; + t1i = w1r * a2r - w1i * a2i; + + out[oidx1] = a1r + t1i; + out[oidx1 - 1] = a1i + t1r; + + out[oidx2] = t1i - a1r; + out[oidx2 - 1] = a1i - t1r; + } + } + if (ido % 2 == 1) { + return; + } + } + idx2 = 2 * idx1; + for (int k = 0; k < l1; k++) { + idx1 = k * ido; + int oidx1 = out_off + idx2 + ido; + int iidx1 = in_off + ido - 1 + idx1; + + out[oidx1] = -in[iidx1 + idx0]; + out[oidx1 - 1] = in[iidx1]; + } + } + + /*------------------------------------------------- + radf3: Real FFT's forward processing of factor 3 + -------------------------------------------------*/ + void radf3(final int ido, final int l1, final float in[], final int in_off, final float out[], final int out_off, final int offset) + { + final float taur = -0.5f; + final float taui = 0.866025403784438707610604524234076962f; + int i, ic; + float ci2, di2, di3, cr2, dr2, dr3, ti2, ti3, tr2, tr3, w1r, w2r, w1i, w2i; + int iw1, iw2; + iw1 = offset; + iw2 = iw1 + ido; + + int idx0 = l1 * ido; + for (int k = 0; k < l1; k++) { + int idx1 = k * ido; + int idx3 = 2 * idx0; + int idx4 = (3 * k + 1) * ido; + int iidx1 = in_off + idx1; + int iidx2 = iidx1 + idx0; + int iidx3 = iidx1 + idx3; + float i1r = in[iidx1]; + float i2r = in[iidx2]; + float i3r = in[iidx3]; + cr2 = i2r + i3r; + out[out_off + 3 * idx1] = i1r + cr2; + out[out_off + idx4 + ido] = taui * (i3r - i2r); + out[out_off + ido - 1 + idx4] = i1r + taur * cr2; + } + if (ido == 1) { + return; + } + for (int k = 0; k < l1; k++) { + int idx3 = k * ido; + int idx4 = 3 * idx3; + int idx5 = idx3 + idx0; + int idx6 = idx5 + idx0; + int idx7 = idx4 + ido; + int idx8 = idx7 + ido; + for (i = 2; i < ido; i += 2) { + ic = ido - i; + int widx1 = i - 1 + iw1; + int widx2 = i - 1 + iw2; + + w1r = wtable_r[widx1 - 1]; + w1i = wtable_r[widx1]; + w2r = wtable_r[widx2 - 1]; + w2i = wtable_r[widx2]; + + int idx9 = in_off + i; + int idx10 = out_off + i; + int idx11 = out_off + ic; + int iidx1 = idx9 + idx3; + int iidx2 = idx9 + idx5; + int iidx3 = idx9 + idx6; + + float i1i = in[iidx1 - 1]; + float i1r = in[iidx1]; + float i2i = in[iidx2 - 1]; + float i2r = in[iidx2]; + float i3i = in[iidx3 - 1]; + float i3r = in[iidx3]; + + dr2 = w1r * i2i + w1i * i2r; + di2 = w1r * i2r - w1i * i2i; + dr3 = w2r * i3i + w2i * i3r; + di3 = w2r * i3r - w2i * i3i; + cr2 = dr2 + dr3; + ci2 = di2 + di3; + tr2 = i1i + taur * cr2; + ti2 = i1r + taur * ci2; + tr3 = taui * (di2 - di3); + ti3 = taui * (dr3 - dr2); + + int oidx1 = idx10 + idx4; + int oidx2 = idx11 + idx7; + int oidx3 = idx10 + idx8; + + out[oidx1 - 1] = i1i + cr2; + out[oidx1] = i1r + ci2; + out[oidx2 - 1] = tr2 - tr3; + out[oidx2] = ti3 - ti2; + out[oidx3 - 1] = tr2 + tr3; + out[oidx3] = ti2 + ti3; + } + } + } + + /*------------------------------------------------- + radf4: Real FFT's forward processing of factor 4 + -------------------------------------------------*/ + void radf4(final int ido, final int l1, final float in[], final int in_off, final float out[], final int out_off, final int offset) + { + final float hsqt2 = 0.707106781186547572737310929369414225f; + int i, ic; + float ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, tr3, tr4, w1r, w1i, w2r, w2i, w3r, w3i; + int iw1, iw2, iw3; + iw1 = offset; + iw2 = offset + ido; + iw3 = iw2 + ido; + int idx0 = l1 * ido; + for (int k = 0; k < l1; k++) { + int idx1 = k * ido; + int idx2 = 4 * idx1; + int idx3 = idx1 + idx0; + int idx4 = idx3 + idx0; + int idx5 = idx4 + idx0; + int idx6 = idx2 + ido; + float i1r = in[in_off + idx1]; + float i2r = in[in_off + idx3]; + float i3r = in[in_off + idx4]; + float i4r = in[in_off + idx5]; + + tr1 = i2r + i4r; + tr2 = i1r + i3r; + + int oidx1 = out_off + idx2; + int oidx2 = out_off + idx6 + ido; + + out[oidx1] = tr1 + tr2; + out[oidx2 - 1 + ido + ido] = tr2 - tr1; + out[oidx2 - 1] = i1r - i3r; + out[oidx2] = i4r - i2r; + } + if (ido < 2) { + return; + } + if (ido != 2) { + for (int k = 0; k < l1; k++) { + int idx1 = k * ido; + int idx2 = idx1 + idx0; + int idx3 = idx2 + idx0; + int idx4 = idx3 + idx0; + int idx5 = 4 * idx1; + int idx6 = idx5 + ido; + int idx7 = idx6 + ido; + int idx8 = idx7 + ido; + for (i = 2; i < ido; i += 2) { + ic = ido - i; + int widx1 = i - 1 + iw1; + int widx2 = i - 1 + iw2; + int widx3 = i - 1 + iw3; + w1r = wtable_r[widx1 - 1]; + w1i = wtable_r[widx1]; + w2r = wtable_r[widx2 - 1]; + w2i = wtable_r[widx2]; + w3r = wtable_r[widx3 - 1]; + w3i = wtable_r[widx3]; + + int idx9 = in_off + i; + int idx10 = out_off + i; + int idx11 = out_off + ic; + int iidx1 = idx9 + idx1; + int iidx2 = idx9 + idx2; + int iidx3 = idx9 + idx3; + int iidx4 = idx9 + idx4; + + float i1i = in[iidx1 - 1]; + float i1r = in[iidx1]; + float i2i = in[iidx2 - 1]; + float i2r = in[iidx2]; + float i3i = in[iidx3 - 1]; + float i3r = in[iidx3]; + float i4i = in[iidx4 - 1]; + float i4r = in[iidx4]; + + cr2 = w1r * i2i + w1i * i2r; + ci2 = w1r * i2r - w1i * i2i; + cr3 = w2r * i3i + w2i * i3r; + ci3 = w2r * i3r - w2i * i3i; + cr4 = w3r * i4i + w3i * i4r; + ci4 = w3r * i4r - w3i * i4i; + tr1 = cr2 + cr4; + tr4 = cr4 - cr2; + ti1 = ci2 + ci4; + ti4 = ci2 - ci4; + ti2 = i1r + ci3; + ti3 = i1r - ci3; + tr2 = i1i + cr3; + tr3 = i1i - cr3; + + int oidx1 = idx10 + idx5; + int oidx2 = idx11 + idx6; + int oidx3 = idx10 + idx7; + int oidx4 = idx11 + idx8; + + out[oidx1 - 1] = tr1 + tr2; + out[oidx4 - 1] = tr2 - tr1; + out[oidx1] = ti1 + ti2; + out[oidx4] = ti1 - ti2; + out[oidx3 - 1] = ti4 + tr3; + out[oidx2 - 1] = tr3 - ti4; + out[oidx3] = tr4 + ti3; + out[oidx2] = tr4 - ti3; + } + } + if (ido % 2 == 1) { + return; + } + } + for (int k = 0; k < l1; k++) { + int idx1 = k * ido; + int idx2 = 4 * idx1; + int idx3 = idx1 + idx0; + int idx4 = idx3 + idx0; + int idx5 = idx4 + idx0; + int idx6 = idx2 + ido; + int idx7 = idx6 + ido; + int idx8 = idx7 + ido; + int idx9 = in_off + ido; + int idx10 = out_off + ido; + + float i1i = in[idx9 - 1 + idx1]; + float i2i = in[idx9 - 1 + idx3]; + float i3i = in[idx9 - 1 + idx4]; + float i4i = in[idx9 - 1 + idx5]; + + ti1 = -hsqt2 * (i2i + i4i); + tr1 = hsqt2 * (i2i - i4i); + + out[idx10 - 1 + idx2] = tr1 + i1i; + out[idx10 - 1 + idx7] = i1i - tr1; + out[out_off + idx6] = ti1 - i3i; + out[out_off + idx8] = ti1 + i3i; + } + } + + /*------------------------------------------------- + radf5: Real FFT's forward processing of factor 5 + -------------------------------------------------*/ + void radf5(final int ido, final int l1, final float in[], final int in_off, final float out[], final int out_off, final int offset) + { + final float tr11 = 0.309016994374947451262869435595348477f; + final float ti11 = 0.951056516295153531181938433292089030f; + final float tr12 = -0.809016994374947340240566973079694435f; + final float ti12 = 0.587785252292473248125759255344746634f; + int i, ic; + float ci2, di2, ci4, ci5, di3, di4, di5, ci3, cr2, cr3, dr2, dr3, dr4, dr5, cr5, cr4, ti2, ti3, ti5, ti4, tr2, tr3, tr4, tr5, w1r, w1i, w2r, w2i, w3r, w3i, w4r, w4i; + int iw1, iw2, iw3, iw4; + iw1 = offset; + iw2 = iw1 + ido; + iw3 = iw2 + ido; + iw4 = iw3 + ido; + + int idx0 = l1 * ido; + for (int k = 0; k < l1; k++) { + int idx1 = k * ido; + int idx2 = 5 * idx1; + int idx3 = idx2 + ido; + int idx4 = idx3 + ido; + int idx5 = idx4 + ido; + int idx6 = idx5 + ido; + int idx7 = idx1 + idx0; + int idx8 = idx7 + idx0; + int idx9 = idx8 + idx0; + int idx10 = idx9 + idx0; + int idx11 = out_off + ido - 1; + + float i1r = in[in_off + idx1]; + float i2r = in[in_off + idx7]; + float i3r = in[in_off + idx8]; + float i4r = in[in_off + idx9]; + float i5r = in[in_off + idx10]; + + cr2 = i5r + i2r; + ci5 = i5r - i2r; + cr3 = i4r + i3r; + ci4 = i4r - i3r; + + out[out_off + idx2] = i1r + cr2 + cr3; + out[idx11 + idx3] = i1r + tr11 * cr2 + tr12 * cr3; + out[out_off + idx4] = ti11 * ci5 + ti12 * ci4; + out[idx11 + idx5] = i1r + tr12 * cr2 + tr11 * cr3; + out[out_off + idx6] = ti12 * ci5 - ti11 * ci4; + } + if (ido == 1) { + return; + } + for (int k = 0; k < l1; ++k) { + int idx1 = k * ido; + int idx2 = 5 * idx1; + int idx3 = idx2 + ido; + int idx4 = idx3 + ido; + int idx5 = idx4 + ido; + int idx6 = idx5 + ido; + int idx7 = idx1 + idx0; + int idx8 = idx7 + idx0; + int idx9 = idx8 + idx0; + int idx10 = idx9 + idx0; + for (i = 2; i < ido; i += 2) { + int widx1 = i - 1 + iw1; + int widx2 = i - 1 + iw2; + int widx3 = i - 1 + iw3; + int widx4 = i - 1 + iw4; + w1r = wtable_r[widx1 - 1]; + w1i = wtable_r[widx1]; + w2r = wtable_r[widx2 - 1]; + w2i = wtable_r[widx2]; + w3r = wtable_r[widx3 - 1]; + w3i = wtable_r[widx3]; + w4r = wtable_r[widx4 - 1]; + w4i = wtable_r[widx4]; + + ic = ido - i; + int idx15 = in_off + i; + int idx16 = out_off + i; + int idx17 = out_off + ic; + + int iidx1 = idx15 + idx1; + int iidx2 = idx15 + idx7; + int iidx3 = idx15 + idx8; + int iidx4 = idx15 + idx9; + int iidx5 = idx15 + idx10; + + float i1i = in[iidx1 - 1]; + float i1r = in[iidx1]; + float i2i = in[iidx2 - 1]; + float i2r = in[iidx2]; + float i3i = in[iidx3 - 1]; + float i3r = in[iidx3]; + float i4i = in[iidx4 - 1]; + float i4r = in[iidx4]; + float i5i = in[iidx5 - 1]; + float i5r = in[iidx5]; + + dr2 = w1r * i2i + w1i * i2r; + di2 = w1r * i2r - w1i * i2i; + dr3 = w2r * i3i + w2i * i3r; + di3 = w2r * i3r - w2i * i3i; + dr4 = w3r * i4i + w3i * i4r; + di4 = w3r * i4r - w3i * i4i; + dr5 = w4r * i5i + w4i * i5r; + di5 = w4r * i5r - w4i * i5i; + + cr2 = dr2 + dr5; + ci5 = dr5 - dr2; + cr5 = di2 - di5; + ci2 = di2 + di5; + cr3 = dr3 + dr4; + ci4 = dr4 - dr3; + cr4 = di3 - di4; + ci3 = di3 + di4; + + tr2 = i1i + tr11 * cr2 + tr12 * cr3; + ti2 = i1r + tr11 * ci2 + tr12 * ci3; + tr3 = i1i + tr12 * cr2 + tr11 * cr3; + ti3 = i1r + tr12 * ci2 + tr11 * ci3; + tr5 = ti11 * cr5 + ti12 * cr4; + ti5 = ti11 * ci5 + ti12 * ci4; + tr4 = ti12 * cr5 - ti11 * cr4; + ti4 = ti12 * ci5 - ti11 * ci4; + + int oidx1 = idx16 + idx2; + int oidx2 = idx17 + idx3; + int oidx3 = idx16 + idx4; + int oidx4 = idx17 + idx5; + int oidx5 = idx16 + idx6; + + out[oidx1 - 1] = i1i + cr2 + cr3; + out[oidx1] = i1r + ci2 + ci3; + out[oidx3 - 1] = tr2 + tr5; + out[oidx2 - 1] = tr2 - tr5; + out[oidx3] = ti2 + ti5; + out[oidx2] = ti5 - ti2; + out[oidx5 - 1] = tr3 + tr4; + out[oidx4 - 1] = tr3 - tr4; + out[oidx5] = ti3 + ti4; + out[oidx4] = ti4 - ti3; + } + } + } + + /*--------------------------------------------------------- + radfg: Real FFT's forward processing of general factor + --------------------------------------------------------*/ + void radfg(final int ido, final int ip, final int l1, final int idl1, final float in[], final int in_off, final float out[], final int out_off, final int offset) + { + int idij, ipph, j2, ic, jc, lc, is, nbd; + float dc2, ai1, ai2, ar1, ar2, ds2, dcp, arg, dsp, ar1h, ar2h, w1r, w1i; + int iw1 = offset; + + arg = TWO_PI / (float) ip; + dcp = (float) cos(arg); + dsp = (float) sin(arg); + ipph = (ip + 1) / 2; + nbd = (ido - 1) / 2; + if (ido != 1) { + for (int ik = 0; ik < idl1; ik++) { + out[out_off + ik] = in[in_off + ik]; + } + for (int j = 1; j < ip; j++) { + int idx1 = j * l1 * ido; + for (int k = 0; k < l1; k++) { + int idx2 = k * ido + idx1; + out[out_off + idx2] = in[in_off + idx2]; + } + } + if (nbd <= l1) { + is = -ido; + for (int j = 1; j < ip; j++) { + is += ido; + idij = is - 1; + int idx1 = j * l1 * ido; + for (int i = 2; i < ido; i += 2) { + idij += 2; + int idx2 = idij + iw1; + int idx4 = in_off + i; + int idx5 = out_off + i; + w1r = wtable_r[idx2 - 1]; + w1i = wtable_r[idx2]; + for (int k = 0; k < l1; k++) { + int idx3 = k * ido + idx1; + int oidx1 = idx5 + idx3; + int iidx1 = idx4 + idx3; + float i1i = in[iidx1 - 1]; + float i1r = in[iidx1]; + + out[oidx1 - 1] = w1r * i1i + w1i * i1r; + out[oidx1] = w1r * i1r - w1i * i1i; + } + } + } + } else { + is = -ido; + for (int j = 1; j < ip; j++) { + is += ido; + int idx1 = j * l1 * ido; + for (int k = 0; k < l1; k++) { + idij = is - 1; + int idx3 = k * ido + idx1; + for (int i = 2; i < ido; i += 2) { + idij += 2; + int idx2 = idij + iw1; + w1r = wtable_r[idx2 - 1]; + w1i = wtable_r[idx2]; + int oidx1 = out_off + i + idx3; + int iidx1 = in_off + i + idx3; + float i1i = in[iidx1 - 1]; + float i1r = in[iidx1]; + + out[oidx1 - 1] = w1r * i1i + w1i * i1r; + out[oidx1] = w1r * i1r - w1i * i1i; + } + } + } + } + if (nbd >= l1) { + for (int j = 1; j < ipph; j++) { + jc = ip - j; + int idx1 = j * l1 * ido; + int idx2 = jc * l1 * ido; + for (int k = 0; k < l1; k++) { + int idx3 = k * ido + idx1; + int idx4 = k * ido + idx2; + for (int i = 2; i < ido; i += 2) { + int idx5 = in_off + i; + int idx6 = out_off + i; + int iidx1 = idx5 + idx3; + int iidx2 = idx5 + idx4; + int oidx1 = idx6 + idx3; + int oidx2 = idx6 + idx4; + float o1i = out[oidx1 - 1]; + float o1r = out[oidx1]; + float o2i = out[oidx2 - 1]; + float o2r = out[oidx2]; + + in[iidx1 - 1] = o1i + o2i; + in[iidx1] = o1r + o2r; + + in[iidx2 - 1] = o1r - o2r; + in[iidx2] = o2i - o1i; + } + } + } + } else { + for (int j = 1; j < ipph; j++) { + jc = ip - j; + int idx1 = j * l1 * ido; + int idx2 = jc * l1 * ido; + for (int i = 2; i < ido; i += 2) { + int idx5 = in_off + i; + int idx6 = out_off + i; + for (int k = 0; k < l1; k++) { + int idx3 = k * ido + idx1; + int idx4 = k * ido + idx2; + int iidx1 = idx5 + idx3; + int iidx2 = idx5 + idx4; + int oidx1 = idx6 + idx3; + int oidx2 = idx6 + idx4; + float o1i = out[oidx1 - 1]; + float o1r = out[oidx1]; + float o2i = out[oidx2 - 1]; + float o2r = out[oidx2]; + + in[iidx1 - 1] = o1i + o2i; + in[iidx1] = o1r + o2r; + in[iidx2 - 1] = o1r - o2r; + in[iidx2] = o2i - o1i; + } + } + } + } + } else { + System.arraycopy(out, out_off, in, in_off, idl1); + } + for (int j = 1; j < ipph; j++) { + jc = ip - j; + int idx1 = j * l1 * ido; + int idx2 = jc * l1 * ido; + for (int k = 0; k < l1; k++) { + int idx3 = k * ido + idx1; + int idx4 = k * ido + idx2; + int oidx1 = out_off + idx3; + int oidx2 = out_off + idx4; + float o1r = out[oidx1]; + float o2r = out[oidx2]; + + in[in_off + idx3] = o1r + o2r; + in[in_off + idx4] = o2r - o1r; + } + } + + ar1 = 1; + ai1 = 0; + int idx0 = (ip - 1) * idl1; + for (int l = 1; l < ipph; l++) { + lc = ip - l; + ar1h = dcp * ar1 - dsp * ai1; + ai1 = dcp * ai1 + dsp * ar1; + ar1 = ar1h; + int idx1 = l * idl1; + int idx2 = lc * idl1; + for (int ik = 0; ik < idl1; ik++) { + int idx3 = out_off + ik; + int idx4 = in_off + ik; + out[idx3 + idx1] = in[idx4] + ar1 * in[idx4 + idl1]; + out[idx3 + idx2] = ai1 * in[idx4 + idx0]; + } + dc2 = ar1; + ds2 = ai1; + ar2 = ar1; + ai2 = ai1; + for (int j = 2; j < ipph; j++) { + jc = ip - j; + ar2h = dc2 * ar2 - ds2 * ai2; + ai2 = dc2 * ai2 + ds2 * ar2; + ar2 = ar2h; + int idx3 = j * idl1; + int idx4 = jc * idl1; + for (int ik = 0; ik < idl1; ik++) { + int idx5 = out_off + ik; + int idx6 = in_off + ik; + out[idx5 + idx1] += ar2 * in[idx6 + idx3]; + out[idx5 + idx2] += ai2 * in[idx6 + idx4]; + } + } + } + for (int j = 1; j < ipph; j++) { + int idx1 = j * idl1; + for (int ik = 0; ik < idl1; ik++) { + out[out_off + ik] += in[in_off + ik + idx1]; + } + } + + if (ido >= l1) { + for (int k = 0; k < l1; k++) { + int idx1 = k * ido; + int idx2 = idx1 * ip; + for (int i = 0; i < ido; i++) { + in[in_off + i + idx2] = out[out_off + i + idx1]; + } + } + } else { + for (int i = 0; i < ido; i++) { + for (int k = 0; k < l1; k++) { + int idx1 = k * ido; + in[in_off + i + idx1 * ip] = out[out_off + i + idx1]; + } + } + } + int idx01 = ip * ido; + for (int j = 1; j < ipph; j++) { + jc = ip - j; + j2 = 2 * j; + int idx1 = j * l1 * ido; + int idx2 = jc * l1 * ido; + int idx3 = j2 * ido; + for (int k = 0; k < l1; k++) { + int idx4 = k * ido; + int idx5 = idx4 + idx1; + int idx6 = idx4 + idx2; + int idx7 = k * idx01; + in[in_off + ido - 1 + idx3 - ido + idx7] = out[out_off + idx5]; + in[in_off + idx3 + idx7] = out[out_off + idx6]; + } + } + if (ido == 1) { + return; + } + if (nbd >= l1) { + for (int j = 1; j < ipph; j++) { + jc = ip - j; + j2 = 2 * j; + int idx1 = j * l1 * ido; + int idx2 = jc * l1 * ido; + int idx3 = j2 * ido; + for (int k = 0; k < l1; k++) { + int idx4 = k * idx01; + int idx5 = k * ido; + for (int i = 2; i < ido; i += 2) { + ic = ido - i; + int idx6 = in_off + i; + int idx7 = in_off + ic; + int idx8 = out_off + i; + int iidx1 = idx6 + idx3 + idx4; + int iidx2 = idx7 + idx3 - ido + idx4; + int oidx1 = idx8 + idx5 + idx1; + int oidx2 = idx8 + idx5 + idx2; + float o1i = out[oidx1 - 1]; + float o1r = out[oidx1]; + float o2i = out[oidx2 - 1]; + float o2r = out[oidx2]; + + in[iidx1 - 1] = o1i + o2i; + in[iidx2 - 1] = o1i - o2i; + in[iidx1] = o1r + o2r; + in[iidx2] = o2r - o1r; + } + } + } + } else { + for (int j = 1; j < ipph; j++) { + jc = ip - j; + j2 = 2 * j; + int idx1 = j * l1 * ido; + int idx2 = jc * l1 * ido; + int idx3 = j2 * ido; + for (int i = 2; i < ido; i += 2) { + ic = ido - i; + int idx6 = in_off + i; + int idx7 = in_off + ic; + int idx8 = out_off + i; + for (int k = 0; k < l1; k++) { + int idx4 = k * idx01; + int idx5 = k * ido; + int iidx1 = idx6 + idx3 + idx4; + int iidx2 = idx7 + idx3 - ido + idx4; + int oidx1 = idx8 + idx5 + idx1; + int oidx2 = idx8 + idx5 + idx2; + float o1i = out[oidx1 - 1]; + float o1r = out[oidx1]; + float o2i = out[oidx2 - 1]; + float o2r = out[oidx2]; + + in[iidx1 - 1] = o1i + o2i; + in[iidx2 - 1] = o1i - o2i; + in[iidx1] = o1r + o2r; + in[iidx2] = o2r - o1r; + } + } + } + } + } + +} diff --git a/app/src/main/java/org/jtransforms/utils/CommonUtils.java b/app/src/main/java/org/jtransforms/utils/CommonUtils.java new file mode 100644 index 0000000..31baad5 --- /dev/null +++ b/app/src/main/java/org/jtransforms/utils/CommonUtils.java @@ -0,0 +1,2653 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * JTransforms + * Copyright (c) 2007 onward, Piotr Wendykier + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ +package org.jtransforms.utils; + +import static org.apache.commons.math3.util.FastMath.*; + +/** + * Static utility methods. + * + * @author Piotr Wendykier (piotr.wendykier@gmail.com) + */ +public class CommonUtils +{ + public CommonUtils() + { + } + + /** + * Returns the closest power-of-two number greater than or equal to x. + * + * @param x input value + * + * @return the closest power-of-two number greater than or equal to x + */ + public static int nextPow2(int x) + { + if (x < 1) { + throw new IllegalArgumentException("x must be greater or equal 1"); + } + if ((x & (x - 1)) == 0) { + return x; // x is already a power-of-two number + } + x |= (x >>> 1); + x |= (x >>> 2); + x |= (x >>> 4); + x |= (x >>> 8); + x |= (x >>> 16); + return x + 1; + } + + /** + * Checks if x is a power-of-two number. + * + * @param x input value + * + * @return true if x is a power-of-two number + */ + public static boolean isPowerOf2(long x) { + return x > 0 && (x & (x - 1L)) == 0; + } + + public static long getReminder(long n, int factors[]) + { + long reminder = n; + + if (n <= 0) { + throw new IllegalArgumentException("n must be positive integer"); + } + + for (int i = 0; i < factors.length && reminder != 1L; i++) { + long factor = factors[i]; + while ((reminder % factor) == 0) { + reminder /= factor; + } + } + return reminder; + } + + public static void makeipt(int nw, int[] ip) + { + int j, l, m, m2, p, q; + + ip[2] = 0; + ip[3] = 16; + m = 2; + for (l = nw; l > 32; l >>= 2) { + m2 = m << 1; + q = m2 << 3; + for (j = m; j < m2; j++) { + p = ip[j] << 2; + ip[m + j] = p; + ip[m2 + j] = p + q; + } + m = m2; + } + } + + public static void makect(int nc, float[] c, int startc, int[] ip) + { + int j, nch; + float delta, deltaj; + + ip[1] = nc; + if (nc > 1) { + nch = nc >> 1; + delta = 0.785398163397448278999490867136046290f / nch; + c[startc] = (float) cos(delta * nch); + c[startc + nch] = 0.5f * c[startc]; + for (j = 1; j < nch; j++) { + deltaj = delta * j; + c[startc + j] = 0.5f * (float) cos(deltaj); + c[startc + nc - j] = 0.5f * (float) sin(deltaj); + } + } + } + + public static void makewt(int nw, int[] ip, float[] w) + { + int j, nwh, nw0, nw1; + float delta, wn4r, wk1r, wk1i, wk3r, wk3i; + float delta2, deltaj, deltaj3; + + ip[0] = nw; + ip[1] = 1; + if (nw > 2) { + nwh = nw >> 1; + delta = 0.785398163397448278999490867136046290f / nwh; + delta2 = delta * 2; + wn4r = (float) cos(delta * nwh); + w[0] = 1; + w[1] = wn4r; + if (nwh == 4) { + w[2] = (float) cos(delta2); + w[3] = (float) sin(delta2); + } else if (nwh > 4) { + CommonUtils.makeipt(nw, ip); + w[2] = 0.5f / (float) cos(delta2); + w[3] = 0.5f / (float) cos(delta * 6); + for (j = 4; j < nwh; j += 4) { + deltaj = delta * j; + deltaj3 = 3 * deltaj; + w[j] = (float) cos(deltaj); + w[j + 1] = (float) sin(deltaj); + w[j + 2] = (float) cos(deltaj3); + w[j + 3] = -(float) sin(deltaj3); + } + } + nw0 = 0; + while (nwh > 2) { + nw1 = nw0 + nwh; + nwh >>= 1; + w[nw1] = 1; + w[nw1 + 1] = wn4r; + if (nwh == 4) { + wk1r = w[nw0 + 4]; + wk1i = w[nw0 + 5]; + w[nw1 + 2] = wk1r; + w[nw1 + 3] = wk1i; + } else if (nwh > 4) { + wk1r = w[nw0 + 4]; + wk3r = w[nw0 + 6]; + w[nw1 + 2] = 0.5f / wk1r; + w[nw1 + 3] = 0.5f / wk3r; + for (j = 4; j < nwh; j += 4) { + int idx1 = nw0 + 2 * j; + int idx2 = nw1 + j; + wk1r = w[idx1]; + wk1i = w[idx1 + 1]; + wk3r = w[idx1 + 2]; + wk3i = w[idx1 + 3]; + w[idx2] = wk1r; + w[idx2 + 1] = wk1i; + w[idx2 + 2] = wk3r; + w[idx2 + 3] = wk3i; + } + } + nw0 = nw1; + } + } + } + + public static void cftfsub(int n, float[] a, int offa, int[] ip, int nw, float[] w) + { + if (n > 8) { + if (n > 32) { + cftf1st(n, a, offa, w, nw - (n >> 2)); + if (n > 512) { + cftrec4(n, a, offa, nw, w); + } else if (n > 128) { + cftleaf(n, 1, a, offa, nw, w); + } else { + cftfx41(n, a, offa, nw, w); + } + bitrv2(n, ip, a, offa); + } else if (n == 32) { + cftf161(a, offa, w, nw - 8); + bitrv216(a, offa); + } else { + cftf081(a, offa, w, 0); + bitrv208(a, offa); + } + } else if (n == 8) { + cftf040(a, offa); + } else if (n == 4) { + cftxb020(a, offa); + } + } + + public static void cftbsub(int n, float[] a, int offa, int[] ip, int nw, float[] w) + { + if (n > 8) { + if (n > 32) { + cftb1st(n, a, offa, w, nw - (n >> 2)); + if (n > 512) { + cftrec4(n, a, offa, nw, w); + } else if (n > 128) { + cftleaf(n, 1, a, offa, nw, w); + } else { + cftfx41(n, a, offa, nw, w); + } + bitrv2conj(n, ip, a, offa); + } else if (n == 32) { + cftf161(a, offa, w, nw - 8); + bitrv216neg(a, offa); + } else { + cftf081(a, offa, w, 0); + bitrv208neg(a, offa); + } + } else if (n == 8) { + cftb040(a, offa); + } else if (n == 4) { + cftxb020(a, offa); + } + } + + public static void bitrv2(int n, int[] ip, float[] a, int offa) + { + int j1, k1, l, m, nh, nm; + float xr, xi, yr, yi; + int idx0, idx1, idx2; + + m = 1; + for (l = n >> 2; l > 8; l >>= 2) { + m <<= 1; + } + nh = n >> 1; + nm = 4 * m; + if (l == 8) { + for (int k = 0; k < m; k++) { + idx0 = 4 * k; + for (int j = 0; j < k; j++) { + j1 = 4 * j + 2 * ip[m + k]; + k1 = idx0 + 2 * ip[m + j]; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 -= nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nh; + k1 += 2; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nm; + k1 -= 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nm; + k1 += nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nm; + k1 -= 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += 2; + k1 += nh; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 -= nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nh; + k1 -= 2; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nm; + k1 -= 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nm; + k1 += nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nm; + k1 -= 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + } + k1 = idx0 + 2 * ip[m + k]; + j1 = k1 + 2; + k1 += nh; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 -= nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= 2; + k1 -= nh; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nh + 2; + k1 += nh + 2; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nh - nm; + k1 += 2 * nm - 2; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + } + } else { + for (int k = 0; k < m; k++) { + idx0 = 4 * k; + for (int j = 0; j < k; j++) { + j1 = 4 * j + ip[m + k]; + k1 = idx0 + ip[m + j]; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 += nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nh; + k1 += 2; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nm; + k1 -= nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += 2; + k1 += nh; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 += nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nh; + k1 -= 2; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nm; + k1 -= nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + } + k1 = idx0 + ip[m + k]; + j1 = k1 + 2; + k1 += nh; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 += nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = a[idx1 + 1]; + yr = a[idx2]; + yi = a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + } + } + } + + public static void bitrv2conj(int n, int[] ip, float[] a, int offa) { + int j1, k1, l, m, nh, nm; + float xr, xi, yr, yi; + int idx0, idx1, idx2; + + m = 1; + for (l = n >> 2; l > 8; l >>= 2) { + m <<= 1; + } + nh = n >> 1; + nm = 4 * m; + if (l == 8) { + for (int k = 0; k < m; k++) { + idx0 = 4 * k; + for (int j = 0; j < k; j++) { + j1 = 4 * j + 2 * ip[m + k]; + k1 = idx0 + 2 * ip[m + j]; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 -= nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nh; + k1 += 2; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nm; + k1 -= 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nm; + k1 += nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nm; + k1 -= 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += 2; + k1 += nh; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 -= nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 += 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nh; + k1 -= 2; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nm; + k1 -= 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nm; + k1 += nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nm; + k1 -= 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + } + k1 = idx0 + 2 * ip[m + k]; + j1 = k1 + 2; + k1 += nh; + idx1 = offa + j1; + idx2 = offa + k1; + a[idx1 - 1] = -a[idx1 - 1]; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + a[idx2 + 3] = -a[idx2 + 3]; + j1 += nm; + k1 += 2 * nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 -= nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= 2; + k1 -= nh; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nh + 2; + k1 += nh + 2; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nh - nm; + k1 += 2 * nm - 2; + idx1 = offa + j1; + idx2 = offa + k1; + a[idx1 - 1] = -a[idx1 - 1]; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + a[idx2 + 3] = -a[idx2 + 3]; + } + } else { + for (int k = 0; k < m; k++) { + idx0 = 4 * k; + for (int j = 0; j < k; j++) { + j1 = 4 * j + ip[m + k]; + k1 = idx0 + ip[m + j]; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 += nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nh; + k1 += 2; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nm; + k1 -= nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += 2; + k1 += nh; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 += nm; + k1 += nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nh; + k1 -= 2; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + j1 -= nm; + k1 -= nm; + idx1 = offa + j1; + idx2 = offa + k1; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + } + k1 = idx0 + ip[m + k]; + j1 = k1 + 2; + k1 += nh; + idx1 = offa + j1; + idx2 = offa + k1; + a[idx1 - 1] = -a[idx1 - 1]; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + a[idx2 + 3] = -a[idx2 + 3]; + j1 += nm; + k1 += nm; + idx1 = offa + j1; + idx2 = offa + k1; + a[idx1 - 1] = -a[idx1 - 1]; + xr = a[idx1]; + xi = -a[idx1 + 1]; + yr = a[idx2]; + yi = -a[idx2 + 1]; + a[idx1] = yr; + a[idx1 + 1] = yi; + a[idx2] = xr; + a[idx2 + 1] = xi; + a[idx2 + 3] = -a[idx2 + 3]; + } + } + } + + public static void bitrv216(float[] a, int offa) + { + float x1r, x1i, x2r, x2i, x3r, x3i, x4r, x4i, x5r, x5i, x7r, x7i, x8r, x8i, x10r, x10i, x11r, x11i, x12r, x12i, x13r, x13i, x14r, x14i; + + x1r = a[offa + 2]; + x1i = a[offa + 3]; + x2r = a[offa + 4]; + x2i = a[offa + 5]; + x3r = a[offa + 6]; + x3i = a[offa + 7]; + x4r = a[offa + 8]; + x4i = a[offa + 9]; + x5r = a[offa + 10]; + x5i = a[offa + 11]; + x7r = a[offa + 14]; + x7i = a[offa + 15]; + x8r = a[offa + 16]; + x8i = a[offa + 17]; + x10r = a[offa + 20]; + x10i = a[offa + 21]; + x11r = a[offa + 22]; + x11i = a[offa + 23]; + x12r = a[offa + 24]; + x12i = a[offa + 25]; + x13r = a[offa + 26]; + x13i = a[offa + 27]; + x14r = a[offa + 28]; + x14i = a[offa + 29]; + a[offa + 2] = x8r; + a[offa + 3] = x8i; + a[offa + 4] = x4r; + a[offa + 5] = x4i; + a[offa + 6] = x12r; + a[offa + 7] = x12i; + a[offa + 8] = x2r; + a[offa + 9] = x2i; + a[offa + 10] = x10r; + a[offa + 11] = x10i; + a[offa + 14] = x14r; + a[offa + 15] = x14i; + a[offa + 16] = x1r; + a[offa + 17] = x1i; + a[offa + 20] = x5r; + a[offa + 21] = x5i; + a[offa + 22] = x13r; + a[offa + 23] = x13i; + a[offa + 24] = x3r; + a[offa + 25] = x3i; + a[offa + 26] = x11r; + a[offa + 27] = x11i; + a[offa + 28] = x7r; + a[offa + 29] = x7i; + } + + public static void bitrv216neg(float[] a, int offa) + { + float x1r, x1i, x2r, x2i, x3r, x3i, x4r, x4i, x5r, x5i, x6r, x6i, x7r, x7i, x8r, x8i, x9r, x9i, x10r, x10i, x11r, x11i, x12r, x12i, x13r, x13i, x14r, x14i, x15r, x15i; + + x1r = a[offa + 2]; + x1i = a[offa + 3]; + x2r = a[offa + 4]; + x2i = a[offa + 5]; + x3r = a[offa + 6]; + x3i = a[offa + 7]; + x4r = a[offa + 8]; + x4i = a[offa + 9]; + x5r = a[offa + 10]; + x5i = a[offa + 11]; + x6r = a[offa + 12]; + x6i = a[offa + 13]; + x7r = a[offa + 14]; + x7i = a[offa + 15]; + x8r = a[offa + 16]; + x8i = a[offa + 17]; + x9r = a[offa + 18]; + x9i = a[offa + 19]; + x10r = a[offa + 20]; + x10i = a[offa + 21]; + x11r = a[offa + 22]; + x11i = a[offa + 23]; + x12r = a[offa + 24]; + x12i = a[offa + 25]; + x13r = a[offa + 26]; + x13i = a[offa + 27]; + x14r = a[offa + 28]; + x14i = a[offa + 29]; + x15r = a[offa + 30]; + x15i = a[offa + 31]; + a[offa + 2] = x15r; + a[offa + 3] = x15i; + a[offa + 4] = x7r; + a[offa + 5] = x7i; + a[offa + 6] = x11r; + a[offa + 7] = x11i; + a[offa + 8] = x3r; + a[offa + 9] = x3i; + a[offa + 10] = x13r; + a[offa + 11] = x13i; + a[offa + 12] = x5r; + a[offa + 13] = x5i; + a[offa + 14] = x9r; + a[offa + 15] = x9i; + a[offa + 16] = x1r; + a[offa + 17] = x1i; + a[offa + 18] = x14r; + a[offa + 19] = x14i; + a[offa + 20] = x6r; + a[offa + 21] = x6i; + a[offa + 22] = x10r; + a[offa + 23] = x10i; + a[offa + 24] = x2r; + a[offa + 25] = x2i; + a[offa + 26] = x12r; + a[offa + 27] = x12i; + a[offa + 28] = x4r; + a[offa + 29] = x4i; + a[offa + 30] = x8r; + a[offa + 31] = x8i; + } + + public static void bitrv208(float[] a, int offa) + { + float x1r, x1i, x3r, x3i, x4r, x4i, x6r, x6i; + + x1r = a[offa + 2]; + x1i = a[offa + 3]; + x3r = a[offa + 6]; + x3i = a[offa + 7]; + x4r = a[offa + 8]; + x4i = a[offa + 9]; + x6r = a[offa + 12]; + x6i = a[offa + 13]; + a[offa + 2] = x4r; + a[offa + 3] = x4i; + a[offa + 6] = x6r; + a[offa + 7] = x6i; + a[offa + 8] = x1r; + a[offa + 9] = x1i; + a[offa + 12] = x3r; + a[offa + 13] = x3i; + } + + public static void bitrv208neg(float[] a, int offa) + { + float x1r, x1i, x2r, x2i, x3r, x3i, x4r, x4i, x5r, x5i, x6r, x6i, x7r, x7i; + + x1r = a[offa + 2]; + x1i = a[offa + 3]; + x2r = a[offa + 4]; + x2i = a[offa + 5]; + x3r = a[offa + 6]; + x3i = a[offa + 7]; + x4r = a[offa + 8]; + x4i = a[offa + 9]; + x5r = a[offa + 10]; + x5i = a[offa + 11]; + x6r = a[offa + 12]; + x6i = a[offa + 13]; + x7r = a[offa + 14]; + x7i = a[offa + 15]; + a[offa + 2] = x7r; + a[offa + 3] = x7i; + a[offa + 4] = x3r; + a[offa + 5] = x3i; + a[offa + 6] = x5r; + a[offa + 7] = x5i; + a[offa + 8] = x1r; + a[offa + 9] = x1i; + a[offa + 10] = x6r; + a[offa + 11] = x6i; + a[offa + 12] = x2r; + a[offa + 13] = x2i; + a[offa + 14] = x4r; + a[offa + 15] = x4i; + } + + public static void cftf1st(int n, float[] a, int offa, float[] w, int startw) + { + int j0, j1, j2, j3, k, m, mh; + float wn4r, csc1, csc3, wk1r, wk1i, wk3r, wk3i, wd1r, wd1i, wd3r, wd3i; + float x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, y0r, y0i, y1r, y1i, y2r, y2i, y3r, y3i; + int idx0, idx1, idx2, idx3, idx4, idx5; + mh = n >> 3; + m = 2 * mh; + j1 = m; + j2 = j1 + m; + j3 = j2 + m; + idx1 = offa + j1; + idx2 = offa + j2; + idx3 = offa + j3; + x0r = a[offa] + a[idx2]; + x0i = a[offa + 1] + a[idx2 + 1]; + x1r = a[offa] - a[idx2]; + x1i = a[offa + 1] - a[idx2 + 1]; + x2r = a[idx1] + a[idx3]; + x2i = a[idx1 + 1] + a[idx3 + 1]; + x3r = a[idx1] - a[idx3]; + x3i = a[idx1 + 1] - a[idx3 + 1]; + a[offa] = x0r + x2r; + a[offa + 1] = x0i + x2i; + a[idx1] = x0r - x2r; + a[idx1 + 1] = x0i - x2i; + a[idx2] = x1r - x3i; + a[idx2 + 1] = x1i + x3r; + a[idx3] = x1r + x3i; + a[idx3 + 1] = x1i - x3r; + wn4r = w[startw + 1]; + csc1 = w[startw + 2]; + csc3 = w[startw + 3]; + wd1r = 1; + wd1i = 0; + wd3r = 1; + wd3i = 0; + k = 0; + for (int j = 2; j < mh - 2; j += 4) { + k += 4; + idx4 = startw + k; + wk1r = csc1 * (wd1r + w[idx4]); + wk1i = csc1 * (wd1i + w[idx4 + 1]); + wk3r = csc3 * (wd3r + w[idx4 + 2]); + wk3i = csc3 * (wd3i + w[idx4 + 3]); + wd1r = w[idx4]; + wd1i = w[idx4 + 1]; + wd3r = w[idx4 + 2]; + wd3i = w[idx4 + 3]; + j1 = j + m; + j2 = j1 + m; + j3 = j2 + m; + idx1 = offa + j1; + idx2 = offa + j2; + idx3 = offa + j3; + idx5 = offa + j; + x0r = a[idx5] + a[idx2]; + x0i = a[idx5 + 1] + a[idx2 + 1]; + x1r = a[idx5] - a[idx2]; + x1i = a[idx5 + 1] - a[idx2 + 1]; + y0r = a[idx5 + 2] + a[idx2 + 2]; + y0i = a[idx5 + 3] + a[idx2 + 3]; + y1r = a[idx5 + 2] - a[idx2 + 2]; + y1i = a[idx5 + 3] - a[idx2 + 3]; + x2r = a[idx1] + a[idx3]; + x2i = a[idx1 + 1] + a[idx3 + 1]; + x3r = a[idx1] - a[idx3]; + x3i = a[idx1 + 1] - a[idx3 + 1]; + y2r = a[idx1 + 2] + a[idx3 + 2]; + y2i = a[idx1 + 3] + a[idx3 + 3]; + y3r = a[idx1 + 2] - a[idx3 + 2]; + y3i = a[idx1 + 3] - a[idx3 + 3]; + a[idx5] = x0r + x2r; + a[idx5 + 1] = x0i + x2i; + a[idx5 + 2] = y0r + y2r; + a[idx5 + 3] = y0i + y2i; + a[idx1] = x0r - x2r; + a[idx1 + 1] = x0i - x2i; + a[idx1 + 2] = y0r - y2r; + a[idx1 + 3] = y0i - y2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[idx2] = wk1r * x0r - wk1i * x0i; + a[idx2 + 1] = wk1r * x0i + wk1i * x0r; + x0r = y1r - y3i; + x0i = y1i + y3r; + a[idx2 + 2] = wd1r * x0r - wd1i * x0i; + a[idx2 + 3] = wd1r * x0i + wd1i * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[idx3] = wk3r * x0r + wk3i * x0i; + a[idx3 + 1] = wk3r * x0i - wk3i * x0r; + x0r = y1r + y3i; + x0i = y1i - y3r; + a[idx3 + 2] = wd3r * x0r + wd3i * x0i; + a[idx3 + 3] = wd3r * x0i - wd3i * x0r; + j0 = m - j; + j1 = j0 + m; + j2 = j1 + m; + j3 = j2 + m; + idx0 = offa + j0; + idx1 = offa + j1; + idx2 = offa + j2; + idx3 = offa + j3; + x0r = a[idx0] + a[idx2]; + x0i = a[idx0 + 1] + a[idx2 + 1]; + x1r = a[idx0] - a[idx2]; + x1i = a[idx0 + 1] - a[idx2 + 1]; + y0r = a[idx0 - 2] + a[idx2 - 2]; + y0i = a[idx0 - 1] + a[idx2 - 1]; + y1r = a[idx0 - 2] - a[idx2 - 2]; + y1i = a[idx0 - 1] - a[idx2 - 1]; + x2r = a[idx1] + a[idx3]; + x2i = a[idx1 + 1] + a[idx3 + 1]; + x3r = a[idx1] - a[idx3]; + x3i = a[idx1 + 1] - a[idx3 + 1]; + y2r = a[idx1 - 2] + a[idx3 - 2]; + y2i = a[idx1 - 1] + a[idx3 - 1]; + y3r = a[idx1 - 2] - a[idx3 - 2]; + y3i = a[idx1 - 1] - a[idx3 - 1]; + a[idx0] = x0r + x2r; + a[idx0 + 1] = x0i + x2i; + a[idx0 - 2] = y0r + y2r; + a[idx0 - 1] = y0i + y2i; + a[idx1] = x0r - x2r; + a[idx1 + 1] = x0i - x2i; + a[idx1 - 2] = y0r - y2r; + a[idx1 - 1] = y0i - y2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[idx2] = wk1i * x0r - wk1r * x0i; + a[idx2 + 1] = wk1i * x0i + wk1r * x0r; + x0r = y1r - y3i; + x0i = y1i + y3r; + a[idx2 - 2] = wd1i * x0r - wd1r * x0i; + a[idx2 - 1] = wd1i * x0i + wd1r * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[idx3] = wk3i * x0r + wk3r * x0i; + a[idx3 + 1] = wk3i * x0i - wk3r * x0r; + x0r = y1r + y3i; + x0i = y1i - y3r; + a[offa + j3 - 2] = wd3i * x0r + wd3r * x0i; + a[offa + j3 - 1] = wd3i * x0i - wd3r * x0r; + } + wk1r = csc1 * (wd1r + wn4r); + wk1i = csc1 * (wd1i + wn4r); + wk3r = csc3 * (wd3r - wn4r); + wk3i = csc3 * (wd3i - wn4r); + j0 = mh; + j1 = j0 + m; + j2 = j1 + m; + j3 = j2 + m; + idx0 = offa + j0; + idx1 = offa + j1; + idx2 = offa + j2; + idx3 = offa + j3; + x0r = a[idx0 - 2] + a[idx2 - 2]; + x0i = a[idx0 - 1] + a[idx2 - 1]; + x1r = a[idx0 - 2] - a[idx2 - 2]; + x1i = a[idx0 - 1] - a[idx2 - 1]; + x2r = a[idx1 - 2] + a[idx3 - 2]; + x2i = a[idx1 - 1] + a[idx3 - 1]; + x3r = a[idx1 - 2] - a[idx3 - 2]; + x3i = a[idx1 - 1] - a[idx3 - 1]; + a[idx0 - 2] = x0r + x2r; + a[idx0 - 1] = x0i + x2i; + a[idx1 - 2] = x0r - x2r; + a[idx1 - 1] = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[idx2 - 2] = wk1r * x0r - wk1i * x0i; + a[idx2 - 1] = wk1r * x0i + wk1i * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[idx3 - 2] = wk3r * x0r + wk3i * x0i; + a[idx3 - 1] = wk3r * x0i - wk3i * x0r; + x0r = a[idx0] + a[idx2]; + x0i = a[idx0 + 1] + a[idx2 + 1]; + x1r = a[idx0] - a[idx2]; + x1i = a[idx0 + 1] - a[idx2 + 1]; + x2r = a[idx1] + a[idx3]; + x2i = a[idx1 + 1] + a[idx3 + 1]; + x3r = a[idx1] - a[idx3]; + x3i = a[idx1 + 1] - a[idx3 + 1]; + a[idx0] = x0r + x2r; + a[idx0 + 1] = x0i + x2i; + a[idx1] = x0r - x2r; + a[idx1 + 1] = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[idx2] = wn4r * (x0r - x0i); + a[idx2 + 1] = wn4r * (x0i + x0r); + x0r = x1r + x3i; + x0i = x1i - x3r; + a[idx3] = -wn4r * (x0r + x0i); + a[idx3 + 1] = -wn4r * (x0i - x0r); + x0r = a[idx0 + 2] + a[idx2 + 2]; + x0i = a[idx0 + 3] + a[idx2 + 3]; + x1r = a[idx0 + 2] - a[idx2 + 2]; + x1i = a[idx0 + 3] - a[idx2 + 3]; + x2r = a[idx1 + 2] + a[idx3 + 2]; + x2i = a[idx1 + 3] + a[idx3 + 3]; + x3r = a[idx1 + 2] - a[idx3 + 2]; + x3i = a[idx1 + 3] - a[idx3 + 3]; + a[idx0 + 2] = x0r + x2r; + a[idx0 + 3] = x0i + x2i; + a[idx1 + 2] = x0r - x2r; + a[idx1 + 3] = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[idx2 + 2] = wk1i * x0r - wk1r * x0i; + a[idx2 + 3] = wk1i * x0i + wk1r * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[idx3 + 2] = wk3i * x0r + wk3r * x0i; + a[idx3 + 3] = wk3i * x0i - wk3r * x0r; + } + + public static void cftb1st(int n, float[] a, int offa, float[] w, int startw) + { + int j0, j1, j2, j3, k, m, mh; + float wn4r, csc1, csc3, wk1r, wk1i, wk3r, wk3i, wd1r, wd1i, wd3r, wd3i; + float x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, y0r, y0i, y1r, y1i, y2r, y2i, y3r, y3i; + int idx0, idx1, idx2, idx3, idx4, idx5; + mh = n >> 3; + m = 2 * mh; + j1 = m; + j2 = j1 + m; + j3 = j2 + m; + idx1 = offa + j1; + idx2 = offa + j2; + idx3 = offa + j3; + + x0r = a[offa] + a[idx2]; + x0i = -a[offa + 1] - a[idx2 + 1]; + x1r = a[offa] - a[idx2]; + x1i = -a[offa + 1] + a[idx2 + 1]; + x2r = a[idx1] + a[idx3]; + x2i = a[idx1 + 1] + a[idx3 + 1]; + x3r = a[idx1] - a[idx3]; + x3i = a[idx1 + 1] - a[idx3 + 1]; + a[offa] = x0r + x2r; + a[offa + 1] = x0i - x2i; + a[idx1] = x0r - x2r; + a[idx1 + 1] = x0i + x2i; + a[idx2] = x1r + x3i; + a[idx2 + 1] = x1i + x3r; + a[idx3] = x1r - x3i; + a[idx3 + 1] = x1i - x3r; + wn4r = w[startw + 1]; + csc1 = w[startw + 2]; + csc3 = w[startw + 3]; + wd1r = 1; + wd1i = 0; + wd3r = 1; + wd3i = 0; + k = 0; + for (int j = 2; j < mh - 2; j += 4) { + k += 4; + idx4 = startw + k; + wk1r = csc1 * (wd1r + w[idx4]); + wk1i = csc1 * (wd1i + w[idx4 + 1]); + wk3r = csc3 * (wd3r + w[idx4 + 2]); + wk3i = csc3 * (wd3i + w[idx4 + 3]); + wd1r = w[idx4]; + wd1i = w[idx4 + 1]; + wd3r = w[idx4 + 2]; + wd3i = w[idx4 + 3]; + j1 = j + m; + j2 = j1 + m; + j3 = j2 + m; + idx1 = offa + j1; + idx2 = offa + j2; + idx3 = offa + j3; + idx5 = offa + j; + x0r = a[idx5] + a[idx2]; + x0i = -a[idx5 + 1] - a[idx2 + 1]; + x1r = a[idx5] - a[offa + j2]; + x1i = -a[idx5 + 1] + a[idx2 + 1]; + y0r = a[idx5 + 2] + a[idx2 + 2]; + y0i = -a[idx5 + 3] - a[idx2 + 3]; + y1r = a[idx5 + 2] - a[idx2 + 2]; + y1i = -a[idx5 + 3] + a[idx2 + 3]; + x2r = a[idx1] + a[idx3]; + x2i = a[idx1 + 1] + a[idx3 + 1]; + x3r = a[idx1] - a[idx3]; + x3i = a[idx1 + 1] - a[idx3 + 1]; + y2r = a[idx1 + 2] + a[idx3 + 2]; + y2i = a[idx1 + 3] + a[idx3 + 3]; + y3r = a[idx1 + 2] - a[idx3 + 2]; + y3i = a[idx1 + 3] - a[idx3 + 3]; + a[idx5] = x0r + x2r; + a[idx5 + 1] = x0i - x2i; + a[idx5 + 2] = y0r + y2r; + a[idx5 + 3] = y0i - y2i; + a[idx1] = x0r - x2r; + a[idx1 + 1] = x0i + x2i; + a[idx1 + 2] = y0r - y2r; + a[idx1 + 3] = y0i + y2i; + x0r = x1r + x3i; + x0i = x1i + x3r; + a[idx2] = wk1r * x0r - wk1i * x0i; + a[idx2 + 1] = wk1r * x0i + wk1i * x0r; + x0r = y1r + y3i; + x0i = y1i + y3r; + a[idx2 + 2] = wd1r * x0r - wd1i * x0i; + a[idx2 + 3] = wd1r * x0i + wd1i * x0r; + x0r = x1r - x3i; + x0i = x1i - x3r; + a[idx3] = wk3r * x0r + wk3i * x0i; + a[idx3 + 1] = wk3r * x0i - wk3i * x0r; + x0r = y1r - y3i; + x0i = y1i - y3r; + a[idx3 + 2] = wd3r * x0r + wd3i * x0i; + a[idx3 + 3] = wd3r * x0i - wd3i * x0r; + j0 = m - j; + j1 = j0 + m; + j2 = j1 + m; + j3 = j2 + m; + idx0 = offa + j0; + idx1 = offa + j1; + idx2 = offa + j2; + idx3 = offa + j3; + x0r = a[idx0] + a[idx2]; + x0i = -a[idx0 + 1] - a[idx2 + 1]; + x1r = a[idx0] - a[idx2]; + x1i = -a[idx0 + 1] + a[idx2 + 1]; + y0r = a[idx0 - 2] + a[idx2 - 2]; + y0i = -a[idx0 - 1] - a[idx2 - 1]; + y1r = a[idx0 - 2] - a[idx2 - 2]; + y1i = -a[idx0 - 1] + a[idx2 - 1]; + x2r = a[idx1] + a[idx3]; + x2i = a[idx1 + 1] + a[idx3 + 1]; + x3r = a[idx1] - a[idx3]; + x3i = a[idx1 + 1] - a[idx3 + 1]; + y2r = a[idx1 - 2] + a[idx3 - 2]; + y2i = a[idx1 - 1] + a[idx3 - 1]; + y3r = a[idx1 - 2] - a[idx3 - 2]; + y3i = a[idx1 - 1] - a[idx3 - 1]; + a[idx0] = x0r + x2r; + a[idx0 + 1] = x0i - x2i; + a[idx0 - 2] = y0r + y2r; + a[idx0 - 1] = y0i - y2i; + a[idx1] = x0r - x2r; + a[idx1 + 1] = x0i + x2i; + a[idx1 - 2] = y0r - y2r; + a[idx1 - 1] = y0i + y2i; + x0r = x1r + x3i; + x0i = x1i + x3r; + a[idx2] = wk1i * x0r - wk1r * x0i; + a[idx2 + 1] = wk1i * x0i + wk1r * x0r; + x0r = y1r + y3i; + x0i = y1i + y3r; + a[idx2 - 2] = wd1i * x0r - wd1r * x0i; + a[idx2 - 1] = wd1i * x0i + wd1r * x0r; + x0r = x1r - x3i; + x0i = x1i - x3r; + a[idx3] = wk3i * x0r + wk3r * x0i; + a[idx3 + 1] = wk3i * x0i - wk3r * x0r; + x0r = y1r - y3i; + x0i = y1i - y3r; + a[idx3 - 2] = wd3i * x0r + wd3r * x0i; + a[idx3 - 1] = wd3i * x0i - wd3r * x0r; + } + wk1r = csc1 * (wd1r + wn4r); + wk1i = csc1 * (wd1i + wn4r); + wk3r = csc3 * (wd3r - wn4r); + wk3i = csc3 * (wd3i - wn4r); + j0 = mh; + j1 = j0 + m; + j2 = j1 + m; + j3 = j2 + m; + idx0 = offa + j0; + idx1 = offa + j1; + idx2 = offa + j2; + idx3 = offa + j3; + x0r = a[idx0 - 2] + a[idx2 - 2]; + x0i = -a[idx0 - 1] - a[idx2 - 1]; + x1r = a[idx0 - 2] - a[idx2 - 2]; + x1i = -a[idx0 - 1] + a[idx2 - 1]; + x2r = a[idx1 - 2] + a[idx3 - 2]; + x2i = a[idx1 - 1] + a[idx3 - 1]; + x3r = a[idx1 - 2] - a[idx3 - 2]; + x3i = a[idx1 - 1] - a[idx3 - 1]; + a[idx0 - 2] = x0r + x2r; + a[idx0 - 1] = x0i - x2i; + a[idx1 - 2] = x0r - x2r; + a[idx1 - 1] = x0i + x2i; + x0r = x1r + x3i; + x0i = x1i + x3r; + a[idx2 - 2] = wk1r * x0r - wk1i * x0i; + a[idx2 - 1] = wk1r * x0i + wk1i * x0r; + x0r = x1r - x3i; + x0i = x1i - x3r; + a[idx3 - 2] = wk3r * x0r + wk3i * x0i; + a[idx3 - 1] = wk3r * x0i - wk3i * x0r; + x0r = a[idx0] + a[idx2]; + x0i = -a[idx0 + 1] - a[idx2 + 1]; + x1r = a[idx0] - a[idx2]; + x1i = -a[idx0 + 1] + a[idx2 + 1]; + x2r = a[idx1] + a[idx3]; + x2i = a[idx1 + 1] + a[idx3 + 1]; + x3r = a[idx1] - a[idx3]; + x3i = a[idx1 + 1] - a[idx3 + 1]; + a[idx0] = x0r + x2r; + a[idx0 + 1] = x0i - x2i; + a[idx1] = x0r - x2r; + a[idx1 + 1] = x0i + x2i; + x0r = x1r + x3i; + x0i = x1i + x3r; + a[idx2] = wn4r * (x0r - x0i); + a[idx2 + 1] = wn4r * (x0i + x0r); + x0r = x1r - x3i; + x0i = x1i - x3r; + a[idx3] = -wn4r * (x0r + x0i); + a[idx3 + 1] = -wn4r * (x0i - x0r); + x0r = a[idx0 + 2] + a[idx2 + 2]; + x0i = -a[idx0 + 3] - a[idx2 + 3]; + x1r = a[idx0 + 2] - a[idx2 + 2]; + x1i = -a[idx0 + 3] + a[idx2 + 3]; + x2r = a[idx1 + 2] + a[idx3 + 2]; + x2i = a[idx1 + 3] + a[idx3 + 3]; + x3r = a[idx1 + 2] - a[idx3 + 2]; + x3i = a[idx1 + 3] - a[idx3 + 3]; + a[idx0 + 2] = x0r + x2r; + a[idx0 + 3] = x0i - x2i; + a[idx1 + 2] = x0r - x2r; + a[idx1 + 3] = x0i + x2i; + x0r = x1r + x3i; + x0i = x1i + x3r; + a[idx2 + 2] = wk1i * x0r - wk1r * x0i; + a[idx2 + 3] = wk1i * x0i + wk1r * x0r; + x0r = x1r - x3i; + x0i = x1i - x3r; + a[idx3 + 2] = wk3i * x0r + wk3r * x0i; + a[idx3 + 3] = wk3i * x0i - wk3r * x0r; + } + + public static void cftrec4(int n, float[] a, int offa, int nw, float[] w) + { + int isplt, j, k, m; + + m = n; + int idx1 = offa + n; + while (m > 512) { + m >>= 2; + cftmdl1(m, a, idx1 - m, w, nw - (m >> 1)); + } + cftleaf(m, 1, a, idx1 - m, nw, w); + k = 0; + int idx2 = offa - m; + for (j = n - m; j > 0; j -= m) { + k++; + isplt = cfttree(m, j, k, a, offa, nw, w); + cftleaf(m, isplt, a, idx2 + j, nw, w); + } + } + + public static int cfttree(int n, int j, int k, float[] a, int offa, int nw, float[] w) + { + int i, isplt, m; + int idx1 = offa - n; + if ((k & 3) != 0) { + isplt = k & 1; + if (isplt != 0) { + cftmdl1(n, a, idx1 + j, w, nw - (n >> 1)); + } else { + cftmdl2(n, a, idx1 + j, w, nw - n); + } + } else { + m = n; + for (i = k; (i & 3) == 0; i >>= 2) { + m <<= 2; + } + isplt = i & 1; + int idx2 = offa + j; + if (isplt != 0) { + while (m > 128) { + cftmdl1(m, a, idx2 - m, w, nw - (m >> 1)); + m >>= 2; + } + } else { + while (m > 128) { + cftmdl2(m, a, idx2 - m, w, nw - m); + m >>= 2; + } + } + } + return isplt; + } + + public static void cftleaf(int n, int isplt, float[] a, int offa, int nw, float[] w) + { + if (n == 512) { + cftmdl1(128, a, offa, w, nw - 64); + cftf161(a, offa, w, nw - 8); + cftf162(a, offa + 32, w, nw - 32); + cftf161(a, offa + 64, w, nw - 8); + cftf161(a, offa + 96, w, nw - 8); + cftmdl2(128, a, offa + 128, w, nw - 128); + cftf161(a, offa + 128, w, nw - 8); + cftf162(a, offa + 160, w, nw - 32); + cftf161(a, offa + 192, w, nw - 8); + cftf162(a, offa + 224, w, nw - 32); + cftmdl1(128, a, offa + 256, w, nw - 64); + cftf161(a, offa + 256, w, nw - 8); + cftf162(a, offa + 288, w, nw - 32); + cftf161(a, offa + 320, w, nw - 8); + cftf161(a, offa + 352, w, nw - 8); + if (isplt != 0) { + cftmdl1(128, a, offa + 384, w, nw - 64); + cftf161(a, offa + 480, w, nw - 8); + } else { + cftmdl2(128, a, offa + 384, w, nw - 128); + cftf162(a, offa + 480, w, nw - 32); + } + cftf161(a, offa + 384, w, nw - 8); + cftf162(a, offa + 416, w, nw - 32); + cftf161(a, offa + 448, w, nw - 8); + } else { + cftmdl1(64, a, offa, w, nw - 32); + cftf081(a, offa, w, nw - 8); + cftf082(a, offa + 16, w, nw - 8); + cftf081(a, offa + 32, w, nw - 8); + cftf081(a, offa + 48, w, nw - 8); + cftmdl2(64, a, offa + 64, w, nw - 64); + cftf081(a, offa + 64, w, nw - 8); + cftf082(a, offa + 80, w, nw - 8); + cftf081(a, offa + 96, w, nw - 8); + cftf082(a, offa + 112, w, nw - 8); + cftmdl1(64, a, offa + 128, w, nw - 32); + cftf081(a, offa + 128, w, nw - 8); + cftf082(a, offa + 144, w, nw - 8); + cftf081(a, offa + 160, w, nw - 8); + cftf081(a, offa + 176, w, nw - 8); + if (isplt != 0) { + cftmdl1(64, a, offa + 192, w, nw - 32); + cftf081(a, offa + 240, w, nw - 8); + } else { + cftmdl2(64, a, offa + 192, w, nw - 64); + cftf082(a, offa + 240, w, nw - 8); + } + cftf081(a, offa + 192, w, nw - 8); + cftf082(a, offa + 208, w, nw - 8); + cftf081(a, offa + 224, w, nw - 8); + } + } + + public static void cftmdl1(int n, float[] a, int offa, float[] w, int startw) + { + int j0, j1, j2, j3, k, m, mh; + float wn4r, wk1r, wk1i, wk3r, wk3i; + float x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i; + int idx0, idx1, idx2, idx3, idx4, idx5; + + mh = n >> 3; + m = 2 * mh; + j1 = m; + j2 = j1 + m; + j3 = j2 + m; + idx1 = offa + j1; + idx2 = offa + j2; + idx3 = offa + j3; + x0r = a[offa] + a[idx2]; + x0i = a[offa + 1] + a[idx2 + 1]; + x1r = a[offa] - a[idx2]; + x1i = a[offa + 1] - a[idx2 + 1]; + x2r = a[idx1] + a[idx3]; + x2i = a[idx1 + 1] + a[idx3 + 1]; + x3r = a[idx1] - a[idx3]; + x3i = a[idx1 + 1] - a[idx3 + 1]; + a[offa] = x0r + x2r; + a[offa + 1] = x0i + x2i; + a[idx1] = x0r - x2r; + a[idx1 + 1] = x0i - x2i; + a[idx2] = x1r - x3i; + a[idx2 + 1] = x1i + x3r; + a[idx3] = x1r + x3i; + a[idx3 + 1] = x1i - x3r; + wn4r = w[startw + 1]; + k = 0; + for (int j = 2; j < mh; j += 2) { + k += 4; + idx4 = startw + k; + wk1r = w[idx4]; + wk1i = w[idx4 + 1]; + wk3r = w[idx4 + 2]; + wk3i = w[idx4 + 3]; + j1 = j + m; + j2 = j1 + m; + j3 = j2 + m; + idx1 = offa + j1; + idx2 = offa + j2; + idx3 = offa + j3; + idx5 = offa + j; + x0r = a[idx5] + a[idx2]; + x0i = a[idx5 + 1] + a[idx2 + 1]; + x1r = a[idx5] - a[idx2]; + x1i = a[idx5 + 1] - a[idx2 + 1]; + x2r = a[idx1] + a[idx3]; + x2i = a[idx1 + 1] + a[idx3 + 1]; + x3r = a[idx1] - a[idx3]; + x3i = a[idx1 + 1] - a[idx3 + 1]; + a[idx5] = x0r + x2r; + a[idx5 + 1] = x0i + x2i; + a[idx1] = x0r - x2r; + a[idx1 + 1] = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[idx2] = wk1r * x0r - wk1i * x0i; + a[idx2 + 1] = wk1r * x0i + wk1i * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[idx3] = wk3r * x0r + wk3i * x0i; + a[idx3 + 1] = wk3r * x0i - wk3i * x0r; + j0 = m - j; + j1 = j0 + m; + j2 = j1 + m; + j3 = j2 + m; + idx0 = offa + j0; + idx1 = offa + j1; + idx2 = offa + j2; + idx3 = offa + j3; + x0r = a[idx0] + a[idx2]; + x0i = a[idx0 + 1] + a[idx2 + 1]; + x1r = a[idx0] - a[idx2]; + x1i = a[idx0 + 1] - a[idx2 + 1]; + x2r = a[idx1] + a[idx3]; + x2i = a[idx1 + 1] + a[idx3 + 1]; + x3r = a[idx1] - a[idx3]; + x3i = a[idx1 + 1] - a[idx3 + 1]; + a[idx0] = x0r + x2r; + a[idx0 + 1] = x0i + x2i; + a[idx1] = x0r - x2r; + a[idx1 + 1] = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[idx2] = wk1i * x0r - wk1r * x0i; + a[idx2 + 1] = wk1i * x0i + wk1r * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + a[idx3] = wk3i * x0r + wk3r * x0i; + a[idx3 + 1] = wk3i * x0i - wk3r * x0r; + } + j0 = mh; + j1 = j0 + m; + j2 = j1 + m; + j3 = j2 + m; + idx0 = offa + j0; + idx1 = offa + j1; + idx2 = offa + j2; + idx3 = offa + j3; + x0r = a[idx0] + a[idx2]; + x0i = a[idx0 + 1] + a[idx2 + 1]; + x1r = a[idx0] - a[idx2]; + x1i = a[idx0 + 1] - a[idx2 + 1]; + x2r = a[idx1] + a[idx3]; + x2i = a[idx1 + 1] + a[idx3 + 1]; + x3r = a[idx1] - a[idx3]; + x3i = a[idx1 + 1] - a[idx3 + 1]; + a[idx0] = x0r + x2r; + a[idx0 + 1] = x0i + x2i; + a[idx1] = x0r - x2r; + a[idx1 + 1] = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + a[idx2] = wn4r * (x0r - x0i); + a[idx2 + 1] = wn4r * (x0i + x0r); + x0r = x1r + x3i; + x0i = x1i - x3r; + a[idx3] = -wn4r * (x0r + x0i); + a[idx3 + 1] = -wn4r * (x0i - x0r); + } + + public static void cftmdl2(int n, float[] a, int offa, float[] w, int startw) + { + int j0, j1, j2, j3, k, kr, m, mh; + float wn4r, wk1r, wk1i, wk3r, wk3i, wd1r, wd1i, wd3r, wd3i; + float x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, y0r, y0i, y2r, y2i; + int idx0, idx1, idx2, idx3, idx4, idx5, idx6; + + mh = n >> 3; + m = 2 * mh; + wn4r = w[startw + 1]; + j1 = m; + j2 = j1 + m; + j3 = j2 + m; + idx1 = offa + j1; + idx2 = offa + j2; + idx3 = offa + j3; + x0r = a[offa] - a[idx2 + 1]; + x0i = a[offa + 1] + a[idx2]; + x1r = a[offa] + a[idx2 + 1]; + x1i = a[offa + 1] - a[idx2]; + x2r = a[idx1] - a[idx3 + 1]; + x2i = a[idx1 + 1] + a[idx3]; + x3r = a[idx1] + a[idx3 + 1]; + x3i = a[idx1 + 1] - a[idx3]; + y0r = wn4r * (x2r - x2i); + y0i = wn4r * (x2i + x2r); + a[offa] = x0r + y0r; + a[offa + 1] = x0i + y0i; + a[idx1] = x0r - y0r; + a[idx1 + 1] = x0i - y0i; + y0r = wn4r * (x3r - x3i); + y0i = wn4r * (x3i + x3r); + a[idx2] = x1r - y0i; + a[idx2 + 1] = x1i + y0r; + a[idx3] = x1r + y0i; + a[idx3 + 1] = x1i - y0r; + k = 0; + kr = 2 * m; + for (int j = 2; j < mh; j += 2) { + k += 4; + idx4 = startw + k; + wk1r = w[idx4]; + wk1i = w[idx4 + 1]; + wk3r = w[idx4 + 2]; + wk3i = w[idx4 + 3]; + kr -= 4; + idx5 = startw + kr; + wd1i = w[idx5]; + wd1r = w[idx5 + 1]; + wd3i = w[idx5 + 2]; + wd3r = w[idx5 + 3]; + j1 = j + m; + j2 = j1 + m; + j3 = j2 + m; + idx1 = offa + j1; + idx2 = offa + j2; + idx3 = offa + j3; + idx6 = offa + j; + x0r = a[idx6] - a[idx2 + 1]; + x0i = a[idx6 + 1] + a[idx2]; + x1r = a[idx6] + a[idx2 + 1]; + x1i = a[idx6 + 1] - a[idx2]; + x2r = a[idx1] - a[idx3 + 1]; + x2i = a[idx1 + 1] + a[idx3]; + x3r = a[idx1] + a[idx3 + 1]; + x3i = a[idx1 + 1] - a[idx3]; + y0r = wk1r * x0r - wk1i * x0i; + y0i = wk1r * x0i + wk1i * x0r; + y2r = wd1r * x2r - wd1i * x2i; + y2i = wd1r * x2i + wd1i * x2r; + a[idx6] = y0r + y2r; + a[idx6 + 1] = y0i + y2i; + a[idx1] = y0r - y2r; + a[idx1 + 1] = y0i - y2i; + y0r = wk3r * x1r + wk3i * x1i; + y0i = wk3r * x1i - wk3i * x1r; + y2r = wd3r * x3r + wd3i * x3i; + y2i = wd3r * x3i - wd3i * x3r; + a[idx2] = y0r + y2r; + a[idx2 + 1] = y0i + y2i; + a[idx3] = y0r - y2r; + a[idx3 + 1] = y0i - y2i; + j0 = m - j; + j1 = j0 + m; + j2 = j1 + m; + j3 = j2 + m; + idx0 = offa + j0; + idx1 = offa + j1; + idx2 = offa + j2; + idx3 = offa + j3; + x0r = a[idx0] - a[idx2 + 1]; + x0i = a[idx0 + 1] + a[idx2]; + x1r = a[idx0] + a[idx2 + 1]; + x1i = a[idx0 + 1] - a[idx2]; + x2r = a[idx1] - a[idx3 + 1]; + x2i = a[idx1 + 1] + a[idx3]; + x3r = a[idx1] + a[idx3 + 1]; + x3i = a[idx1 + 1] - a[idx3]; + y0r = wd1i * x0r - wd1r * x0i; + y0i = wd1i * x0i + wd1r * x0r; + y2r = wk1i * x2r - wk1r * x2i; + y2i = wk1i * x2i + wk1r * x2r; + a[idx0] = y0r + y2r; + a[idx0 + 1] = y0i + y2i; + a[idx1] = y0r - y2r; + a[idx1 + 1] = y0i - y2i; + y0r = wd3i * x1r + wd3r * x1i; + y0i = wd3i * x1i - wd3r * x1r; + y2r = wk3i * x3r + wk3r * x3i; + y2i = wk3i * x3i - wk3r * x3r; + a[idx2] = y0r + y2r; + a[idx2 + 1] = y0i + y2i; + a[idx3] = y0r - y2r; + a[idx3 + 1] = y0i - y2i; + } + wk1r = w[startw + m]; + wk1i = w[startw + m + 1]; + j0 = mh; + j1 = j0 + m; + j2 = j1 + m; + j3 = j2 + m; + idx0 = offa + j0; + idx1 = offa + j1; + idx2 = offa + j2; + idx3 = offa + j3; + x0r = a[idx0] - a[idx2 + 1]; + x0i = a[idx0 + 1] + a[idx2]; + x1r = a[idx0] + a[idx2 + 1]; + x1i = a[idx0 + 1] - a[idx2]; + x2r = a[idx1] - a[idx3 + 1]; + x2i = a[idx1 + 1] + a[idx3]; + x3r = a[idx1] + a[idx3 + 1]; + x3i = a[idx1 + 1] - a[idx3]; + y0r = wk1r * x0r - wk1i * x0i; + y0i = wk1r * x0i + wk1i * x0r; + y2r = wk1i * x2r - wk1r * x2i; + y2i = wk1i * x2i + wk1r * x2r; + a[idx0] = y0r + y2r; + a[idx0 + 1] = y0i + y2i; + a[idx1] = y0r - y2r; + a[idx1 + 1] = y0i - y2i; + y0r = wk1i * x1r - wk1r * x1i; + y0i = wk1i * x1i + wk1r * x1r; + y2r = wk1r * x3r - wk1i * x3i; + y2i = wk1r * x3i + wk1i * x3r; + a[idx2] = y0r - y2r; + a[idx2 + 1] = y0i - y2i; + a[idx3] = y0r + y2r; + a[idx3 + 1] = y0i + y2i; + } + + public static void cftfx41(int n, float[] a, int offa, int nw, float[] w) + { + if (n == 128) { + cftf161(a, offa, w, nw - 8); + cftf162(a, offa + 32, w, nw - 32); + cftf161(a, offa + 64, w, nw - 8); + cftf161(a, offa + 96, w, nw - 8); + } else { + cftf081(a, offa, w, nw - 8); + cftf082(a, offa + 16, w, nw - 8); + cftf081(a, offa + 32, w, nw - 8); + cftf081(a, offa + 48, w, nw - 8); + } + } + + public static void cftf161(float[] a, int offa, float[] w, int startw) + { + float wn4r, wk1r, wk1i, x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, y0r, y0i, y1r, y1i, y2r, y2i, y3r, y3i, y4r, y4i, y5r, y5i, y6r, y6i, y7r, y7i, y8r, y8i, y9r, y9i, y10r, y10i, y11r, y11i, y12r, y12i, y13r, y13i, y14r, y14i, y15r, y15i; + + wn4r = w[startw + 1]; + wk1r = w[startw + 2]; + wk1i = w[startw + 3]; + + x0r = a[offa] + a[offa + 16]; + x0i = a[offa + 1] + a[offa + 17]; + x1r = a[offa] - a[offa + 16]; + x1i = a[offa + 1] - a[offa + 17]; + x2r = a[offa + 8] + a[offa + 24]; + x2i = a[offa + 9] + a[offa + 25]; + x3r = a[offa + 8] - a[offa + 24]; + x3i = a[offa + 9] - a[offa + 25]; + y0r = x0r + x2r; + y0i = x0i + x2i; + y4r = x0r - x2r; + y4i = x0i - x2i; + y8r = x1r - x3i; + y8i = x1i + x3r; + y12r = x1r + x3i; + y12i = x1i - x3r; + x0r = a[offa + 2] + a[offa + 18]; + x0i = a[offa + 3] + a[offa + 19]; + x1r = a[offa + 2] - a[offa + 18]; + x1i = a[offa + 3] - a[offa + 19]; + x2r = a[offa + 10] + a[offa + 26]; + x2i = a[offa + 11] + a[offa + 27]; + x3r = a[offa + 10] - a[offa + 26]; + x3i = a[offa + 11] - a[offa + 27]; + y1r = x0r + x2r; + y1i = x0i + x2i; + y5r = x0r - x2r; + y5i = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + y9r = wk1r * x0r - wk1i * x0i; + y9i = wk1r * x0i + wk1i * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + y13r = wk1i * x0r - wk1r * x0i; + y13i = wk1i * x0i + wk1r * x0r; + x0r = a[offa + 4] + a[offa + 20]; + x0i = a[offa + 5] + a[offa + 21]; + x1r = a[offa + 4] - a[offa + 20]; + x1i = a[offa + 5] - a[offa + 21]; + x2r = a[offa + 12] + a[offa + 28]; + x2i = a[offa + 13] + a[offa + 29]; + x3r = a[offa + 12] - a[offa + 28]; + x3i = a[offa + 13] - a[offa + 29]; + y2r = x0r + x2r; + y2i = x0i + x2i; + y6r = x0r - x2r; + y6i = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + y10r = wn4r * (x0r - x0i); + y10i = wn4r * (x0i + x0r); + x0r = x1r + x3i; + x0i = x1i - x3r; + y14r = wn4r * (x0r + x0i); + y14i = wn4r * (x0i - x0r); + x0r = a[offa + 6] + a[offa + 22]; + x0i = a[offa + 7] + a[offa + 23]; + x1r = a[offa + 6] - a[offa + 22]; + x1i = a[offa + 7] - a[offa + 23]; + x2r = a[offa + 14] + a[offa + 30]; + x2i = a[offa + 15] + a[offa + 31]; + x3r = a[offa + 14] - a[offa + 30]; + x3i = a[offa + 15] - a[offa + 31]; + y3r = x0r + x2r; + y3i = x0i + x2i; + y7r = x0r - x2r; + y7i = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + y11r = wk1i * x0r - wk1r * x0i; + y11i = wk1i * x0i + wk1r * x0r; + x0r = x1r + x3i; + x0i = x1i - x3r; + y15r = wk1r * x0r - wk1i * x0i; + y15i = wk1r * x0i + wk1i * x0r; + x0r = y12r - y14r; + x0i = y12i - y14i; + x1r = y12r + y14r; + x1i = y12i + y14i; + x2r = y13r - y15r; + x2i = y13i - y15i; + x3r = y13r + y15r; + x3i = y13i + y15i; + a[offa + 24] = x0r + x2r; + a[offa + 25] = x0i + x2i; + a[offa + 26] = x0r - x2r; + a[offa + 27] = x0i - x2i; + a[offa + 28] = x1r - x3i; + a[offa + 29] = x1i + x3r; + a[offa + 30] = x1r + x3i; + a[offa + 31] = x1i - x3r; + x0r = y8r + y10r; + x0i = y8i + y10i; + x1r = y8r - y10r; + x1i = y8i - y10i; + x2r = y9r + y11r; + x2i = y9i + y11i; + x3r = y9r - y11r; + x3i = y9i - y11i; + a[offa + 16] = x0r + x2r; + a[offa + 17] = x0i + x2i; + a[offa + 18] = x0r - x2r; + a[offa + 19] = x0i - x2i; + a[offa + 20] = x1r - x3i; + a[offa + 21] = x1i + x3r; + a[offa + 22] = x1r + x3i; + a[offa + 23] = x1i - x3r; + x0r = y5r - y7i; + x0i = y5i + y7r; + x2r = wn4r * (x0r - x0i); + x2i = wn4r * (x0i + x0r); + x0r = y5r + y7i; + x0i = y5i - y7r; + x3r = wn4r * (x0r - x0i); + x3i = wn4r * (x0i + x0r); + x0r = y4r - y6i; + x0i = y4i + y6r; + x1r = y4r + y6i; + x1i = y4i - y6r; + a[offa + 8] = x0r + x2r; + a[offa + 9] = x0i + x2i; + a[offa + 10] = x0r - x2r; + a[offa + 11] = x0i - x2i; + a[offa + 12] = x1r - x3i; + a[offa + 13] = x1i + x3r; + a[offa + 14] = x1r + x3i; + a[offa + 15] = x1i - x3r; + x0r = y0r + y2r; + x0i = y0i + y2i; + x1r = y0r - y2r; + x1i = y0i - y2i; + x2r = y1r + y3r; + x2i = y1i + y3i; + x3r = y1r - y3r; + x3i = y1i - y3i; + a[offa] = x0r + x2r; + a[offa + 1] = x0i + x2i; + a[offa + 2] = x0r - x2r; + a[offa + 3] = x0i - x2i; + a[offa + 4] = x1r - x3i; + a[offa + 5] = x1i + x3r; + a[offa + 6] = x1r + x3i; + a[offa + 7] = x1i - x3r; + } + + public static void cftf162(float[] a, int offa, float[] w, int startw) + { + float wn4r, wk1r, wk1i, wk2r, wk2i, wk3r, wk3i, x0r, x0i, x1r, x1i, x2r, x2i, y0r, y0i, y1r, y1i, y2r, y2i, y3r, y3i, y4r, y4i, y5r, y5i, y6r, y6i, y7r, y7i, y8r, y8i, y9r, y9i, y10r, y10i, y11r, y11i, y12r, y12i, y13r, y13i, y14r, y14i, y15r, y15i; + + wn4r = w[startw + 1]; + wk1r = w[startw + 4]; + wk1i = w[startw + 5]; + wk3r = w[startw + 6]; + wk3i = -w[startw + 7]; + wk2r = w[startw + 8]; + wk2i = w[startw + 9]; + x1r = a[offa] - a[offa + 17]; + x1i = a[offa + 1] + a[offa + 16]; + x0r = a[offa + 8] - a[offa + 25]; + x0i = a[offa + 9] + a[offa + 24]; + x2r = wn4r * (x0r - x0i); + x2i = wn4r * (x0i + x0r); + y0r = x1r + x2r; + y0i = x1i + x2i; + y4r = x1r - x2r; + y4i = x1i - x2i; + x1r = a[offa] + a[offa + 17]; + x1i = a[offa + 1] - a[offa + 16]; + x0r = a[offa + 8] + a[offa + 25]; + x0i = a[offa + 9] - a[offa + 24]; + x2r = wn4r * (x0r - x0i); + x2i = wn4r * (x0i + x0r); + y8r = x1r - x2i; + y8i = x1i + x2r; + y12r = x1r + x2i; + y12i = x1i - x2r; + x0r = a[offa + 2] - a[offa + 19]; + x0i = a[offa + 3] + a[offa + 18]; + x1r = wk1r * x0r - wk1i * x0i; + x1i = wk1r * x0i + wk1i * x0r; + x0r = a[offa + 10] - a[offa + 27]; + x0i = a[offa + 11] + a[offa + 26]; + x2r = wk3i * x0r - wk3r * x0i; + x2i = wk3i * x0i + wk3r * x0r; + y1r = x1r + x2r; + y1i = x1i + x2i; + y5r = x1r - x2r; + y5i = x1i - x2i; + x0r = a[offa + 2] + a[offa + 19]; + x0i = a[offa + 3] - a[offa + 18]; + x1r = wk3r * x0r - wk3i * x0i; + x1i = wk3r * x0i + wk3i * x0r; + x0r = a[offa + 10] + a[offa + 27]; + x0i = a[offa + 11] - a[offa + 26]; + x2r = wk1r * x0r + wk1i * x0i; + x2i = wk1r * x0i - wk1i * x0r; + y9r = x1r - x2r; + y9i = x1i - x2i; + y13r = x1r + x2r; + y13i = x1i + x2i; + x0r = a[offa + 4] - a[offa + 21]; + x0i = a[offa + 5] + a[offa + 20]; + x1r = wk2r * x0r - wk2i * x0i; + x1i = wk2r * x0i + wk2i * x0r; + x0r = a[offa + 12] - a[offa + 29]; + x0i = a[offa + 13] + a[offa + 28]; + x2r = wk2i * x0r - wk2r * x0i; + x2i = wk2i * x0i + wk2r * x0r; + y2r = x1r + x2r; + y2i = x1i + x2i; + y6r = x1r - x2r; + y6i = x1i - x2i; + x0r = a[offa + 4] + a[offa + 21]; + x0i = a[offa + 5] - a[offa + 20]; + x1r = wk2i * x0r - wk2r * x0i; + x1i = wk2i * x0i + wk2r * x0r; + x0r = a[offa + 12] + a[offa + 29]; + x0i = a[offa + 13] - a[offa + 28]; + x2r = wk2r * x0r - wk2i * x0i; + x2i = wk2r * x0i + wk2i * x0r; + y10r = x1r - x2r; + y10i = x1i - x2i; + y14r = x1r + x2r; + y14i = x1i + x2i; + x0r = a[offa + 6] - a[offa + 23]; + x0i = a[offa + 7] + a[offa + 22]; + x1r = wk3r * x0r - wk3i * x0i; + x1i = wk3r * x0i + wk3i * x0r; + x0r = a[offa + 14] - a[offa + 31]; + x0i = a[offa + 15] + a[offa + 30]; + x2r = wk1i * x0r - wk1r * x0i; + x2i = wk1i * x0i + wk1r * x0r; + y3r = x1r + x2r; + y3i = x1i + x2i; + y7r = x1r - x2r; + y7i = x1i - x2i; + x0r = a[offa + 6] + a[offa + 23]; + x0i = a[offa + 7] - a[offa + 22]; + x1r = wk1i * x0r + wk1r * x0i; + x1i = wk1i * x0i - wk1r * x0r; + x0r = a[offa + 14] + a[offa + 31]; + x0i = a[offa + 15] - a[offa + 30]; + x2r = wk3i * x0r - wk3r * x0i; + x2i = wk3i * x0i + wk3r * x0r; + y11r = x1r + x2r; + y11i = x1i + x2i; + y15r = x1r - x2r; + y15i = x1i - x2i; + x1r = y0r + y2r; + x1i = y0i + y2i; + x2r = y1r + y3r; + x2i = y1i + y3i; + a[offa] = x1r + x2r; + a[offa + 1] = x1i + x2i; + a[offa + 2] = x1r - x2r; + a[offa + 3] = x1i - x2i; + x1r = y0r - y2r; + x1i = y0i - y2i; + x2r = y1r - y3r; + x2i = y1i - y3i; + a[offa + 4] = x1r - x2i; + a[offa + 5] = x1i + x2r; + a[offa + 6] = x1r + x2i; + a[offa + 7] = x1i - x2r; + x1r = y4r - y6i; + x1i = y4i + y6r; + x0r = y5r - y7i; + x0i = y5i + y7r; + x2r = wn4r * (x0r - x0i); + x2i = wn4r * (x0i + x0r); + a[offa + 8] = x1r + x2r; + a[offa + 9] = x1i + x2i; + a[offa + 10] = x1r - x2r; + a[offa + 11] = x1i - x2i; + x1r = y4r + y6i; + x1i = y4i - y6r; + x0r = y5r + y7i; + x0i = y5i - y7r; + x2r = wn4r * (x0r - x0i); + x2i = wn4r * (x0i + x0r); + a[offa + 12] = x1r - x2i; + a[offa + 13] = x1i + x2r; + a[offa + 14] = x1r + x2i; + a[offa + 15] = x1i - x2r; + x1r = y8r + y10r; + x1i = y8i + y10i; + x2r = y9r - y11r; + x2i = y9i - y11i; + a[offa + 16] = x1r + x2r; + a[offa + 17] = x1i + x2i; + a[offa + 18] = x1r - x2r; + a[offa + 19] = x1i - x2i; + x1r = y8r - y10r; + x1i = y8i - y10i; + x2r = y9r + y11r; + x2i = y9i + y11i; + a[offa + 20] = x1r - x2i; + a[offa + 21] = x1i + x2r; + a[offa + 22] = x1r + x2i; + a[offa + 23] = x1i - x2r; + x1r = y12r - y14i; + x1i = y12i + y14r; + x0r = y13r + y15i; + x0i = y13i - y15r; + x2r = wn4r * (x0r - x0i); + x2i = wn4r * (x0i + x0r); + a[offa + 24] = x1r + x2r; + a[offa + 25] = x1i + x2i; + a[offa + 26] = x1r - x2r; + a[offa + 27] = x1i - x2i; + x1r = y12r + y14i; + x1i = y12i - y14r; + x0r = y13r - y15i; + x0i = y13i + y15r; + x2r = wn4r * (x0r - x0i); + x2i = wn4r * (x0i + x0r); + a[offa + 28] = x1r - x2i; + a[offa + 29] = x1i + x2r; + a[offa + 30] = x1r + x2i; + a[offa + 31] = x1i - x2r; + } + + public static void cftf081(float[] a, int offa, float[] w, int startw) + { + float wn4r, x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, y0r, y0i, y1r, y1i, y2r, y2i, y3r, y3i, y4r, y4i, y5r, y5i, y6r, y6i, y7r, y7i; + + wn4r = w[startw + 1]; + x0r = a[offa] + a[offa + 8]; + x0i = a[offa + 1] + a[offa + 9]; + x1r = a[offa] - a[offa + 8]; + x1i = a[offa + 1] - a[offa + 9]; + x2r = a[offa + 4] + a[offa + 12]; + x2i = a[offa + 5] + a[offa + 13]; + x3r = a[offa + 4] - a[offa + 12]; + x3i = a[offa + 5] - a[offa + 13]; + y0r = x0r + x2r; + y0i = x0i + x2i; + y2r = x0r - x2r; + y2i = x0i - x2i; + y1r = x1r - x3i; + y1i = x1i + x3r; + y3r = x1r + x3i; + y3i = x1i - x3r; + x0r = a[offa + 2] + a[offa + 10]; + x0i = a[offa + 3] + a[offa + 11]; + x1r = a[offa + 2] - a[offa + 10]; + x1i = a[offa + 3] - a[offa + 11]; + x2r = a[offa + 6] + a[offa + 14]; + x2i = a[offa + 7] + a[offa + 15]; + x3r = a[offa + 6] - a[offa + 14]; + x3i = a[offa + 7] - a[offa + 15]; + y4r = x0r + x2r; + y4i = x0i + x2i; + y6r = x0r - x2r; + y6i = x0i - x2i; + x0r = x1r - x3i; + x0i = x1i + x3r; + x2r = x1r + x3i; + x2i = x1i - x3r; + y5r = wn4r * (x0r - x0i); + y5i = wn4r * (x0r + x0i); + y7r = wn4r * (x2r - x2i); + y7i = wn4r * (x2r + x2i); + a[offa + 8] = y1r + y5r; + a[offa + 9] = y1i + y5i; + a[offa + 10] = y1r - y5r; + a[offa + 11] = y1i - y5i; + a[offa + 12] = y3r - y7i; + a[offa + 13] = y3i + y7r; + a[offa + 14] = y3r + y7i; + a[offa + 15] = y3i - y7r; + a[offa] = y0r + y4r; + a[offa + 1] = y0i + y4i; + a[offa + 2] = y0r - y4r; + a[offa + 3] = y0i - y4i; + a[offa + 4] = y2r - y6i; + a[offa + 5] = y2i + y6r; + a[offa + 6] = y2r + y6i; + a[offa + 7] = y2i - y6r; + } + + public static void cftf082(float[] a, int offa, float[] w, int startw) + { + float wn4r, wk1r, wk1i, x0r, x0i, x1r, x1i, y0r, y0i, y1r, y1i, y2r, y2i, y3r, y3i, y4r, y4i, y5r, y5i, y6r, y6i, y7r, y7i; + + wn4r = w[startw + 1]; + wk1r = w[startw + 2]; + wk1i = w[startw + 3]; + y0r = a[offa] - a[offa + 9]; + y0i = a[offa + 1] + a[offa + 8]; + y1r = a[offa] + a[offa + 9]; + y1i = a[offa + 1] - a[offa + 8]; + x0r = a[offa + 4] - a[offa + 13]; + x0i = a[offa + 5] + a[offa + 12]; + y2r = wn4r * (x0r - x0i); + y2i = wn4r * (x0i + x0r); + x0r = a[offa + 4] + a[offa + 13]; + x0i = a[offa + 5] - a[offa + 12]; + y3r = wn4r * (x0r - x0i); + y3i = wn4r * (x0i + x0r); + x0r = a[offa + 2] - a[offa + 11]; + x0i = a[offa + 3] + a[offa + 10]; + y4r = wk1r * x0r - wk1i * x0i; + y4i = wk1r * x0i + wk1i * x0r; + x0r = a[offa + 2] + a[offa + 11]; + x0i = a[offa + 3] - a[offa + 10]; + y5r = wk1i * x0r - wk1r * x0i; + y5i = wk1i * x0i + wk1r * x0r; + x0r = a[offa + 6] - a[offa + 15]; + x0i = a[offa + 7] + a[offa + 14]; + y6r = wk1i * x0r - wk1r * x0i; + y6i = wk1i * x0i + wk1r * x0r; + x0r = a[offa + 6] + a[offa + 15]; + x0i = a[offa + 7] - a[offa + 14]; + y7r = wk1r * x0r - wk1i * x0i; + y7i = wk1r * x0i + wk1i * x0r; + x0r = y0r + y2r; + x0i = y0i + y2i; + x1r = y4r + y6r; + x1i = y4i + y6i; + a[offa] = x0r + x1r; + a[offa + 1] = x0i + x1i; + a[offa + 2] = x0r - x1r; + a[offa + 3] = x0i - x1i; + x0r = y0r - y2r; + x0i = y0i - y2i; + x1r = y4r - y6r; + x1i = y4i - y6i; + a[offa + 4] = x0r - x1i; + a[offa + 5] = x0i + x1r; + a[offa + 6] = x0r + x1i; + a[offa + 7] = x0i - x1r; + x0r = y1r - y3i; + x0i = y1i + y3r; + x1r = y5r - y7r; + x1i = y5i - y7i; + a[offa + 8] = x0r + x1r; + a[offa + 9] = x0i + x1i; + a[offa + 10] = x0r - x1r; + a[offa + 11] = x0i - x1i; + x0r = y1r + y3i; + x0i = y1i - y3r; + x1r = y5r + y7r; + x1i = y5i + y7i; + a[offa + 12] = x0r - x1i; + a[offa + 13] = x0i + x1r; + a[offa + 14] = x0r + x1i; + a[offa + 15] = x0i - x1r; + } + + public static void cftf040(float[] a, int offa) + { + float x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i; + + x0r = a[offa] + a[offa + 4]; + x0i = a[offa + 1] + a[offa + 5]; + x1r = a[offa] - a[offa + 4]; + x1i = a[offa + 1] - a[offa + 5]; + x2r = a[offa + 2] + a[offa + 6]; + x2i = a[offa + 3] + a[offa + 7]; + x3r = a[offa + 2] - a[offa + 6]; + x3i = a[offa + 3] - a[offa + 7]; + a[offa] = x0r + x2r; + a[offa + 1] = x0i + x2i; + a[offa + 2] = x1r - x3i; + a[offa + 3] = x1i + x3r; + a[offa + 4] = x0r - x2r; + a[offa + 5] = x0i - x2i; + a[offa + 6] = x1r + x3i; + a[offa + 7] = x1i - x3r; + } + + public static void cftb040(float[] a, int offa) + { + float x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i; + + x0r = a[offa] + a[offa + 4]; + x0i = a[offa + 1] + a[offa + 5]; + x1r = a[offa] - a[offa + 4]; + x1i = a[offa + 1] - a[offa + 5]; + x2r = a[offa + 2] + a[offa + 6]; + x2i = a[offa + 3] + a[offa + 7]; + x3r = a[offa + 2] - a[offa + 6]; + x3i = a[offa + 3] - a[offa + 7]; + a[offa] = x0r + x2r; + a[offa + 1] = x0i + x2i; + a[offa + 2] = x1r + x3i; + a[offa + 3] = x1i - x3r; + a[offa + 4] = x0r - x2r; + a[offa + 5] = x0i - x2i; + a[offa + 6] = x1r - x3i; + a[offa + 7] = x1i + x3r; + } + + public static void cftx020(float[] a, int offa) + { + float x0r, x0i; + x0r = a[offa] - a[offa + 2]; + x0i = -a[offa + 1] + a[offa + 3]; + a[offa] += a[offa + 2]; + a[offa + 1] += a[offa + 3]; + a[offa + 2] = x0r; + a[offa + 3] = x0i; + } + + public static void cftxb020(float[] a, int offa) + { + float x0r, x0i; + + x0r = a[offa] - a[offa + 2]; + x0i = a[offa + 1] - a[offa + 3]; + a[offa] += a[offa + 2]; + a[offa + 1] += a[offa + 3]; + a[offa + 2] = x0r; + a[offa + 3] = x0i; + } + + public static void rftfsub(int n, float[] a, int offa, int nc, float[] c, int startc) + { + int k, kk, ks, m; + float wkr, wki, xr, xi, yr, yi; + int idx1, idx2; + + m = n >> 1; + ks = 2 * nc / m; + kk = 0; + for (int j = 2; j < m; j += 2) { + k = n - j; + kk += ks; + wkr = 0.5f - c[startc + nc - kk]; + wki = c[startc + kk]; + idx1 = offa + j; + idx2 = offa + k; + xr = a[idx1] - a[idx2]; + xi = a[idx1 + 1] + a[idx2 + 1]; + yr = wkr * xr - wki * xi; + yi = wkr * xi + wki * xr; + a[idx1] -= yr; + a[idx1 + 1] = yi - a[idx1 + 1]; + a[idx2] += yr; + a[idx2 + 1] = yi - a[idx2 + 1]; + } + a[offa + m + 1] = -a[offa + m + 1]; + } +} diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..ebf1030 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..ccf9e0d3dfcd435b092f386009d4a362828d53e1 GIT binary patch literal 3391 zcmV-F4Z!k=P)Bp(vU_W{@j8)9<@!W9fjFc1zqCV>=a2yR0&r88+-GAT^j93)QD91Tq} zou;LowB#V+3};-!B;h820fWsM+qfLIz}U#QCCfUt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DriFPlR z96v%b&lNfO7XtfEho z@&u>d2U!(_Q)o@iRV!}on{XUDZMS}!!qy1?K@io6{tMS8DK$A9;f$18*+(=y?ZU{i zEC%RIvNWJ2Cyqdl1$6|+_K6(MY@+6nQ^uNYi>vo6qgZ6<){mRm0P)}N2%ZuYJM8_K zj4k~X>Qoiy@gpO$;4qG7k;6vaVOm3o207iqPcQD&+yUtN3biIb)~ z7jpq)uI<|+UN4{Cel9YUxi}a#RvDT4Qq-hXgA`%ueYhYE2S<48wM7?!4>KM{aneA^ zVhc|fV8*5M9;+lBe5kEDhvgu0n7f=)$kHMO_UdIvy#B2ZTeIPXMuHz4M7GLRf{6S}^oXkv@Q^1oB#t9f;g zyeSPDV;h>9uK`96-xu<1rCrd0%K*4aKw<8pqwazZ9TrsrG!d{IwD}uZKF77f{{uJE VB+wQeS-$`P002ovPDHLkV1mxZV)6h0 literal 0 HcmV?d00001 diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..e2e13f50a2d7c2cef2f25908f6609b61f0ca81fc GIT binary patch literal 2363 zcmV-B3B>k^P)b(B703TQvnvT5z>1Y*>j0@h5EBY?AcH|1K4JsLBsk^>0XrdBki;fc2~|ls5QKy6 z4-TZtIf~#^VeDW>;!rq>!vrB=fmn#S4CYcKp@SeH?P#^ScV|1*Ju}OUv|35*l8X9^ zcC~%HU%%JyO}{q;eKd+(fpsCs_4L&@n7{XTUE*(1Hi;&9O~R`qgwU`E+To(X6tw$X zB+N`aogJ--wI4UK-}Ey0TDMmKZQ$MboN&=B|Bia-cL13AoJ=9Tv>Hn^{+c}#w`1er z7De96B+E#xufwX6Q%IET{`X9o+f6|WsBB&re|LMEKZw2oM*eV{K*{RL0Sg#v!?VZScuz=)t?{4wAy<<`w|dPP+0&8ae7?!7n`alEp9Ekr^(dAC>&t%t zXL$I404Cn4z}h1R_#BZBAozFHgt!KdH&tc_1;C#Pt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jhQIsjND$B6=Tq$ClP7V8i2f$Wj5KP}S(IZeY_8YjIJR0|g z4)d#nSf>N&mF393c@xQMK+_HA0Z`Fcm{rc^dQozs(P=Gt6Qm>m@E<@q)F~**wJuh>ieBn|D6wri3S|ea{-?(oA|BFsSu&;PV%%VVYD@5NCae$?AAT%dq9bx zR8|Jux{o!n%@GB$uFKhS%3W6uppGK9)8CsieU=s(#A+NAx8utYU7>rx!VYkNoP*4+ hczh}Mw)5J2{{`!9Hj9oS(YOEr002ovPDHLkV1f!{SO)+A literal 0 HcmV?d00001 diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..ff422276441d1acec137267bacaf6a7277bf9abd GIT binary patch literal 4575 zcmV<55g_h~P)9n#cdQUR8nYAP5Ko#)v4O(T*M!m!P;On$2kJ*jbM~Mw9eRlJR8H$&lDRi`{ch zl9@9d9h08eW}is3RTPb&qR~WSTp%dJCi_l7K~Yez?wtFmB2~qERj(EnnYtd1M|tnw zcmKcp-Q~L*fj11R0>sm)Q)DWD0*}Y*>F;zczGO;}X>{#f@wYrC6vcXuB|-2d@5v7w zX>oZvpB@1~k*OreG%&H~FSe*!>Wq;F&ZwqDK}VW^u6z%nMxx{uJz-IbdUAPBuaHlR zJi8L7`5m_buoA&aeOuhtP(6Bn1CaYc=mb!xh3{lW;enu2sc;u)iA-Dh3YRxfImK zJw1(pd__Q#D5Zkxo(gS#WAM?uG+d6Kh#pQUE7}Ro4Os9~0Tx$OAf!tt>m4}{F|i0C zFdB_TT0{4vlj}Y$aMu!C24Gq8yP-eN#5YpfV=D2&x5~+sy=Sh*#^RlfmC&hGE=4t| zt`<+`a%nApr*^LiL(i~ltVM|i;?Rm#`^?)M=1>lzHN0>$!UP!OVQGITZNwO23NrakkMt5)EYIOfkbC1yMp z^}w`y)DhgRUc|vtr5LY0h1ySg&wp4CD>~`bFgG&m&u7mA?`FL( z1%=}&U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w8h_8s%+@!)hGwq39*5^fgiK^Z z6nuMu?#?=Z?fhfnJKgiK{02{n#NuJ1tAhcxFQ8(3103xSa6^nCeU+V<#eTYhUQM6q z?1xo5E|+|B20R78GCpPzEM8B?J*1+GB*w&MKdi*NExbAY{{!UT`xRkq^mYIM002ov JPDHLkV1kZWfAjzV literal 0 HcmV?d00001 diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..7e4bc3dff867069978439e05a6b70c55dc8fa010 GIT binary patch literal 7171 zcmV+e9Q@;nP)SYBkk9+xJ{Q zPg|AOYHeL2AR?gb1dt_c5h7t1vhRT;Gm~Yu^FHThZgMl3<=&aOlgxPU$9!;R&OP^> z|M}kk|9}2xW1w7$1bmPHE=`y4A3!^2m~=I&LU-Ow7Xh5hKwY8Hr9!7%VJH7{*>60;q_MgqymUc%u=SwKd2) zdxnf^xlY?hSZ2ra@h^qH)9}wR1E?p!IhK$OiIt;2pf4ydYq{ZZth{W`<15sd{NSxt zmU){2liBmekbzS?$H%0i;O1GVjg5m<<%!+C;z?+0#iWXIOs}rO&E;jX$xckh4AWh9 z0&-quBabFly|+J55J{7onA$j`;VV)%=Aj=l1RvUeHWNaaZhxqs)}h}CsdD_xgYR{k z9a$5xb#gYEqGMadqv<3TTv37DQyzRk&9LtRFxvGTL_a{Er$&I<(bw{kJShE zAnST-K%VFL5SC%gEw(OAmD%vbqWVp57Gl0?0rvIue*IY}IRRoB zjq=3YWRa>}W#Z3?^CMU2GD;XA%|?h701Y4p>}m@O!{hg@fk_o`Zn-+9G&ka@P3w?g zqjA1~UYxA2SXwJzt}UAS8LF?@?VI1byfOil&uO3SiObV&(j}Y%K_mfa)Hz_1G_z_v zcjukBl0d^u19#Bk^0l!H!&X?@+IO~A%zD~*v@{pUDe!b)bi2WcbCo?x}%yB|Um_6Pi%kvy1QWF=4r&g?lnGLAL zblEVYu3y8GTQ(rNq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%;=9y~;Y z86b)9aJ!6zlm-&`K#p6e$cTpctSLl;6(EW5^i-PnfhsNf;2w>CCt=~l??asuQFJoY-+ScYM*np@gGY`K{GmyR>V_WD+6~HYli$j5nC33sHvKdRP8>LMP3?p|N0n}c7cs>`{+u0&Aq}``b~ocAV0wa z6~kECZD#ceQ^T=U4Lg?3N2+lj%7P1^M=&jXEl%pT4_p4wHru4m|dRSCtYdx+##0aa>4;Y&PdZ-9BU$hhBcR|Yq5S1~F`Oq^AB9jmvTaQlNZ)2wA%+!te&m>ki zGF}zV9XX(420k=&|AUXfq>*M>(;6G`!p2V|K_^V?4|uqk4Li}{ip zAYKbm+n}SGC?4AAW|-6(4fndU@n%)*6z#A?4Xak${2$|ztR4IwWph#je+9y*-Zt56 z))G@=L$k(8HI2<|He2GMwKT&-eIBZLI_%D~-+Nzt)#Nl`JfO6$6e4;cX+$^>9s#Yc z3t){fF&d3#;BA;>)CSKDX0zEA2`vc&Y}a6-z)*jOu5zUR(w-NE$M3#Rpa61&i26j- zq|rYLl{ySyHG?!lJ$Nv2UJ^54?do=p=^urKnk)K8eID8234{p~f=V?F)!@{8aq!qb z)9-mrD7Qu&>`aI)AFom9zf{9efT*8Cp`riM&$4QsKx!bzXHj5;e?o6j0Z1G|LV$RP zC@}n=u-_prM=w(iM1whMn}H~Um*N_fw+Uei7&yEn{vXALf39puOOyZr002ovPDHLk FV1j|Xg((04 literal 0 HcmV?d00001 diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..87baa267bf8b6537e64f40307da85775595c7d5a GIT binary patch literal 9708 zcmYLP1yodBw7xSiFm!hfUDDlMBHf@g(yd4d1Bf)zh;$1`DqVx5QlcQ;NY~IMyzzf) zy?57|JL}Flcc1Uud!Kvu`R>H%YOCR4Q)2@FfTy9ZtdIIe{QE#LP-p!GH%tJ40UF8* zhW?fZxmfD!6Z4ek8BdnE$r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/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..60cd113 --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + Acme⊗ AudioViz + Acme⊗ + diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..aff4f41 --- /dev/null +++ b/build.gradle @@ -0,0 +1,23 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.1.2' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + jcenter() + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..1d3591c --- /dev/null +++ b/gradle.properties @@ -0,0 +1,18 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true \ No newline at end of file diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..e7b4def --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +include ':app' -- 2.50.1