This commit is contained in:
Carl 2021-12-23 02:17:38 +00:00
parent efaaf39f79
commit 6d7d8079da
19 changed files with 0 additions and 4707 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

View File

@ -1,675 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is 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. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
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.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
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 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. Use with the GNU Affero General Public License.
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 Affero 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 special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 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 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 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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
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 GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -1,94 +0,0 @@
# Kraken SDR DoA DSP
This software is intended to demonstrate the direction of arrival (DoA) estimation capabilities of the KrakenSDR and other RTL-SDR based coherent receiver systems which use the compatible data acquisition system - HeIMDALL DAQ Firmware.
<br>
<br>
The complete application is broken down into two main modules in terms of implementation, into the DAQ Subsystem and to the DSP Subsystem. These two modules can operate together either remotely through Ethernet connection or locally on the same host using shared-memory.
Running these two subsystems on separate processing units can grant higher throughput and stability, while running on the same processing unit makes the entire system more compact.
## Installation
1. Install the prerequisites
``` bash
sudo apt update
sudo apt install php-cli
```
2. Install Heimdall DAQ
If not done already, first, follow the instructions at https://github.com/krakenrf/heimdall_daq_fw/tree/development to install the Heimdall DAQ Firmware.
3. Set up Miniconda environment
You will have created a Miniconda environment during the Heimdall DAQ install phase.
Please run the installs in this order as we need to ensure a specific version of dash is installed.
``` bash
conda activate kraken
conda install quart
conda install pandas
conda install orjson
conda install matplotlib
pip3 install dash_bootstrap_components
pip3 install quart_compress
pip3 install dash_devices
pip3 install pyargus
conda install dash==1.20.0
```
4. Install the krakensdr_doa software
```bash
cd ~/krakensdr
git clone https://github.com/krakenrf/krakensdr_doa
cd krakensdr_doa
git checkout clientside_graphs
```
Copy the the *krakensdr_doa/util/kraken_doa_start.sh* and the *krakensdr_doa/util/kraken_doa_stop.sh* scripts into the krakensdr root folder of the project.
```bash
cd ~/krakensdr
cp krakensdr_doa/util/kraken_doa_start.sh .
cp krakensdr_doa/util/kraken_doa_stop.sh .
```
## Running
### Local operation (Recommended)
```bash
./kraken_doa_start.sh
```
Please be patient on the first run, at it can take 1-2 minutes for the JIT numba compiler to compile the numba optimized functions, and during this compilation time it may appear that the software has gotten stuck. On subsqeuent runs this loading time will be much faster as it will read from cache.
### Remote operation
1. Start the DAQ Subsystem either remotely. (Make sure that the *daq_chain_config.ini* contains the proper configuration)
(See:https://github.com/krakenrf/heimdall_daq_fw/Documentation)
2. Set the IP address of the DAQ Subsystem in the settings.json, *default_ip* field.
3. Start the DoA DSP software by typing:
`./gui_run.sh`
4. To stop the server and the DSP processing chain run the following script:
`./kill.sh`
<p1> After starting the script a web based server opens at port number 8051, which then can be accessed by typing "KRAKEN_IP:8050/" in the address bar of any web browser. You can find the IP address of the KrakenSDR Pi4 wither via your routers WiFi management page, or by typing "ip addr" into the terminal. You can also use the hostname of the Pi4 in place of the IP address, but this only works on local networks, and not the internet, or mobile hotspot networks. </p1>
![image info](./doc/kraken_doadsp_main.png)
## Upcoming Features and Known Bugs
1. [FEATURE] Currently squelch works by selecting the strongest signal that is active and above the set threshold within the active bandwidth. The next steps will be to allow users to create multiple channels within the active bandwidth, each with their own squelch. This will allow users to track multiple signals at once, and ignore unwated signals within the bandwidth at the same time.
2. [FEATURE] It would be better if the KrakenSDR controls, spectrum and/or DOA graphs could be accessible from the same page. Future work will look to integrate the controls in a sidebar.
3. [FEATURE] Some users would like to monitor the spectrum, and manually click on an active signal to DF that particular signal. We will be looking at a way to implement this.
4. [BUG] Sometimes the DOA graphs will not load properly and refreshing the page is required. A fix is being investigated.
This software was 95% developed by Tamas Peto, and makes use of his pyAPRIL and pyARGUS libraries. See his website at www.tamaspeto.com

View File

@ -1,215 +0,0 @@
/*Globlal Properties*/
/*Tags*/
body {
background-color: #000000;
color:#ffffff;
margin: 0px;
padding: 0px;
}
*{
font-size:18px;
font-family: 'Montserrat', sans-serif;
}
h1{
font-size:22px;
}
a{
font-size: 22px;
}
input[type="checkbox"]{
width:20px;
height:20px;
background:white;
border-radius:5px;
border:2px solid #555;
vertical-align: text-bottom;
}
.Select-control {
background-color:#000000;
}
.Select-value {
background-color: rgb(255, 102, 0);
color:#000000;
}
.Select-menu-outer {
background-color: rgb(0, 0, 0);
}
input, select{
width: 100%;
}
iframe{
background-color: transparent;
border: 0px none transparent;
padding: 0px;
overflow: hidden;
}
/*Classes*/
.header{
background-color: #000000;
width: 100%;
text-align: center;
padding: 10px;
}
.header a{
color: white;
text-transform: uppercase;
text-decoration: none;
padding: 5px;
line-height: 40px;
border: 0.1em solid #ffffff;
border-radius:0.05em;
margin: 5px;
}
.header_active, .header a:hover{
background-color: #ff6600c0;
}
.ctr_toolbar{
background-color: #000000;
height: 50px;
width: 100%;
text-align: center;
}
.ctr_toolbar_item {
text-align: center;
display : inline-block;
position : relative;
margin : 0 auto;
padding : 0px;
float : center;
}
.doa_check{
text-align: left;
}
.btn{
height: 40px;
cursor: pointer;
background-color: #141414;
border: 0.1em solid #000000;
border-radius:0.12em;
color: white;
font-size:20px;
text-decoration: none;
text-align: center;
width: 100%;
transition: all 0.2s;
}
.btn:hover{
color: rgb(0, 0, 0);
background-color: #ff6600;
}
.btn a{
color: white;
text-decoration: none;
position: relative;
top: 15%;
}
.btn_start{
height: 40px;
cursor: pointer;
background-color: #02c93d;
border: 0.1em solid #000000;
border-radius:0.12em;
color: rgb(0, 0, 0);
font-size:20px;
text-decoration: none;
text-align: center;
width: 100%;
transition: all 0.2s;
}
.btn_start:hover{
color: rgb(0, 0, 0);
background-color: #ff6600;
}
.btn_stop{
height: 40px;
cursor: pointer;
background-color: #c40404;
border: 0.1em solid #000000;
border-radius:0.12em;
color: rgb(0, 0, 0);
font-size:20px;
text-decoration: none;
text-align: center;
width: 100%;
}
.btn_stop:hover{
color: rgb(0, 0, 0);
background-color: #ff6600;
}
.btn_save_cfg{
height: 40px;
cursor: pointer;
background-color: #b5aef5;
border: 0.1em solid #000000;
border-radius:0.12em;
color: rgb(0, 0, 0);
font-size:20px;
text-decoration: none;
text-align: center;
width: 100%;
}
.btn_save_cfg:hover{
color: rgb(154, 233, 102);
background-color: #ff6600;
}
.tooltip{
color: rgb(0, 0, 0);
background-color: #ffffff;
opacity: 0.95;
border-radius:0.2em;
width: 300px;
}
.card{
background-color: #000000;
border: 0.1em solid #ffffff;
border-radius:0.2em;
width: 400px;
max-width: 500px;
padding: 20px;
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.46);
margin: 10px;
float: left;
}
.monitor_card{
background-color: #000000;
border: 0.1em solid #ffffff;
border-radius:0.2em;
width: 95%;
height: 800px;
overflow:scroll;
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.46);
margin: auto;
}
.field{
width: 400px;
display: block;
margin: 10px auto;
padding: 0px;
}
.field-label{
width: 250px;
display: inline-block;
vertical-align: top;
}
.field-body{
width: 144px;
display: inline-block;
}
/*Mobile Properties*/
@media screen and (max-width: 1072px) {
.card{
width: calc( 100% - 30px );
padding: 5px;
margin: 20px auto;
float: none;
}
}
@media screen and (max-width: 500px) {
.field, .field-label, .field-body, input{
width: calc( 100% - 15px );
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,210 +0,0 @@
import dash_html_components as html
import dash_bootstrap_components as dbc
dsp_config_tooltips = html.Div([
# Antenna arrangement selection
dbc.Tooltip([
html.P("ULA - Uniform Linear Array"),
html.P("Antenna elements placed on a line with having equal distances between each other"),
html.P("UCA - Uniform Circular Array"),
html.P("Antenna elements are placed on circle equaly distributed on 360°")],
target="label_ant_arrangement",
placement="bottom",
className="tooltip"
),
# Antenna Spacing
# dbc.Tooltip([
# html.P("When ULA is selected: Spacing between antenna elements"),
# html.P("When UCA is selected: Radius of the circle on which the elements are placed")],
# target="label_ant_spacing",
# placement="bottom",
# className="tooltip"
# ),
# Enable F-B averaging
dbc.Tooltip([
html.P("Forward-backward averegaing improves the performance of DoA estimation in multipath environment"),
html.P("(Available only for ULA antenna systems)")],
target="label_en_fb_avg",
placement="bottom",
className="tooltip"
),
])
daq_ini_config_tooltips = html.Div([
# DAQ buffer size
dbc.Tooltip([
html.P("Buffer size of the realtek driver")],
target="label_daq_buffer_size",
placement="bottom",
className="tooltip"
),
# Sampling frequency
dbc.Tooltip([
html.P("Raw - ADC sampling frequency of the realtek chip")],
target="label_sample_rate",
placement="bottom",
className="tooltip"
),
# Enable noise source control
dbc.Tooltip([
html.P("Enables the utilization of the built-in noise source for calibration")],
target="label_en_noise_source_ctr",
placement="bottom",
className="tooltip"
),
# Enable squelch mode
dbc.Tooltip([
html.P("Enable DAQ-side squelch to capture burst like signals - NOTE DISABLED IN THIS VERSION, THIS VERSION USES DSP SIDE SQUELCH ONLY")],
target="label_en_squelch",
placement="bottom",
className="tooltip"
),
# Squelch threshold
dbc.Tooltip([
html.P("Amplitude threshold used for the squelch feature."),
html.P("Should take values on range: 0...1"),
html.P("When set to zero the squelch is bypassed")],
target="label_squelch_init_threshold",
placement="bottom",
className="tooltip"
),
# CPI size
dbc.Tooltip([
html.P("Length of the Coherent Processing Interval (CPI) after decimation")],
target="label_cpi_size",
placement="bottom",
className="tooltip"
),
# Decimation raito
dbc.Tooltip([
html.P("Decimation factor")],
target="label_decimation_ratio",
placement="bottom",
className="tooltip"
),
# FIR relative bandwidth
dbc.Tooltip([
html.P("Anti-aliasing filter bandwith after decimation"),
html.P("Should take values on range: (0, 1]"),
html.P("E.g.: ADC sampling frequency: 1 MHz (IQ!) , Decimation ratio: 2, FIR relative bandwith:0.25"),
html.P("Resulting passband bandwidth: 125 kHz ")],
target="label_fir_relative_bw",
placement="bottom",
className="tooltip"
),
# FIR tap size
dbc.Tooltip([
html.P("Anti-aliasing FIR filter tap size - Do not set too large, or CPU utilization will be 100%"),
html.P("Should be greater than the decimation ratio")],
target="label_fir_tap_size",
placement="bottom",
className="tooltip"
),
# FIR tap size
dbc.Tooltip([
html.P("Window function type for designing the anti-aliasing FIR filter"),
html.P("https://en.wikipedia.org/wiki/Window_function")],
target="label_fir_window",
placement="bottom",
className="tooltip"
),
# Enable filter reset
dbc.Tooltip([
html.P("If enabled, the memory of the anti-aliasing FIR filter is reseted at the begining of every new CPI")],
target="label_en_filter_reset",
placement="bottom",
className="tooltip"
),
# Correlation size
dbc.Tooltip([
html.P("Number of samples used for the calibration procedure (sample delay and IQ compensation)")],
target="label_correlation_size",
placement="bottom",
className="tooltip"
),
# Standard channel index
dbc.Tooltip([
html.P("The selected channel is used as a reference for the IQ compensation")],
target="label_std_ch_index",
placement="bottom",
className="tooltip"
),
# Enable IQ calibration
dbc.Tooltip([
html.P("Enables to compensate the amplitude and phase differences of the receiver channels")],
target="label_en_iq_calibration",
placement="bottom",
className="tooltip"
),
# Gain lock interval
dbc.Tooltip([
html.P("Minimum number of stable frames before terminating the gain tuning procedure")],
target="label_gain_lock_interval",
placement="bottom",
className="tooltip"
),
# Require track lock intervention
dbc.Tooltip([
html.P("When enabled the DAQ firmware waits for manual intervention during the calibraiton procedure"),
html.P("Should be used only for hardave version 1.0")],
target="label_require_track_lock",
placement="bottom",
className="tooltip"
),
# Amplitude calibraiton mode
dbc.Tooltip([
html.P("Amplitude difference compensation method applied as part of the IQ compensation"),
html.P("default: Amplitude differences are estimated by calculating the cross-correlations of the channels"),
html.P("disabled: Amplitude differences are not compensated"),
html.P("channel_power: Ampltiude compensation is set in a way to achieve equal channel powers")],
target="label_amplitude_calibration_mode",
placement="bottom",
className="tooltip"
),
dbc.Tooltip([
html.P("When periodic calibration track mode is selected the firmware regularly turn on the noise source for a short burst to\
check whether the IQ calibration is still valid or not. In case the calibrated state is lost, the firmware automatically\
initiates a reclaibration procedure")],
target="label_calibration_track_mode",
placement="bottom",
className="tooltip"
),
# Calibration frame interval
dbc.Tooltip([
html.P("Number of data frames between two consecutive calibration burst. Used when periodic calibration mode is selected")],
target="label_calibration_frame_interval",
placement="bottom",
className="tooltip"
),
# Calibration frame burst size
dbc.Tooltip([
html.P("Number of calibration frames generated in the periodic calibration mode")],
target="label_calibration_frame_burst_size",
placement="bottom",
className="tooltip"
),
# Amplitude tolerance
dbc.Tooltip([
html.P("Maximum allowed amplitude difference between the receiver channels")],
target="label_amplitude_tolerance",
placement="bottom",
className="tooltip"
),
# Phase tolerance
dbc.Tooltip([
html.P("Maximum allowed phase difference between the receiver channels")],
target="label_phase_tolerance",
placement="bottom",
className="tooltip"
),
# Maximum sync fails
dbc.Tooltip([
html.P("Maximum allowed consecutive IQ difference check failures before initiating a recalibration")],
target="label_max_sync_fails",
placement="bottom",
className="tooltip"
),
])

View File

@ -1,102 +0,0 @@
import json
import os
"""
Handles the DoA DSP settings
Project: Kraken DoA DSP
Author : Tamas Peto
"""
root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
settings_file_path = os.path.join(root_path,"settings.json")
settings_found =False
if os.path.exists(settings_file_path):
settings_found = True
with open(settings_file_path, 'r') as myfile:
settings=json.loads(myfile.read())
# DAQ Configuration
center_freq = settings.get("center_freq", 100.0)
uniform_gain = settings.get("uniform_gain", 1.4)
data_interface = settings.get("data_interface", "eth")
default_ip = settings.get("default_ip", "0.0.0.0")
# PR Paramaters
en_pr = settings.get("en_pr", 0)
clutter_cancel_algo = settings.get("clutter_cancel_algo", "Wiener MRE")
max_bistatic_range = settings.get("max_bistatic_range", 128)
max_doppler = settings.get("max_doppler", 256)
en_pr_persist = settings.get("en_pr_persist", 1)
pr_persist_decay = settings.get("pr_persist_decay", 0.99)
pr_dynrange_min = settings.get("pr_dynrange_min", -20)
pr_dynrange_max = settings.get("pr_dynrange_max", 100)
#ant_arrangement = settings.get("ant_arrangement", "ULA")
#ant_spacing = settings.get("ant_spacing", 0.5)
#doa_method = settings.get("doa_method", "MUSIC")
#en_fbavg = settings.get("en_fbavg", 0)
#compass_offset = settings.get("compass_offset", 0)
#doa_fig_type = settings.get("doa_fig_type", "Linear plot")
# DSP misc
#en_squelch = settings.get("en_squelch", 0)
#squelch_threshold_dB = settings.get("squelch_threshold_dB", 0.0)
# Web Interface
en_hw_check = settings.get("en_hw_check", 0)
en_advanced_daq_cfg = settings.get("en_advanced_daq_cfg", 0)
logging_level = settings.get("logging_level", 0)
disable_tooltips = settings.get("disable_tooltips", 0)
# Check and correct if needed
#if not ant_arrangement in ["ULA", "UCA"]:
# ant_arrangement="ULA"
#doa_method_dict = {"Bartlett":0, "Capon":1, "MEM":2, "MUSIC":3}
#if not doa_method in doa_method_dict:
# doa_method = "MUSIC"
#doa_fig_type_dict = {"Linear plot":0, "Polar plot":1, "Compass":2}
#if not doa_fig_type in doa_fig_type_dict:
# doa_gfig_type="Linear plot"
def write(data = None):
if data is None:
data = {}
# DAQ Configuration
data["center_freq"] = center_freq
data["uniform_gain"] = uniform_gain
data["data_interface"] = data_interface
data["default_ip"] = default_ip
# DOA Estimation
data["en_pr"] = en_pr
data["clutter_cancel_algo"] = clutter_cancel_algo
data["max_bistatic_range"] = max_bistatic_range
data["max_doppler"] = max_doppler
data["en_pr_persist"] = en_pr_persist
data["pr_persist_decay"] = pr_persist_decay
data["pr_dynrange_min"] = pr_dynrange_min
data["pr_dynrange_max"] = pr_dynrange_max
#data["ant_arrangement"] = ant_arrangement
#data["ant_spacing"] = ant_spacing
#data["doa_method"] = doa_method
#data["en_fbavg"] = en_fbavg
#data["compass_offset"] = compass_offset
#data["doa_fig_tpye"] = doa_fig_type
# DSP misc
#data["en_squelch"] = en_squelch
#data["squelch_threshold_dB"] = squelch_threshold_dB
# Web Interface
data["en_hw_check"] = en_hw_check
data["en_advanced_daq_cfg"] = en_advanced_daq_cfg
data["logging_level"] = logging_level
data["disable_tooltips"] = disable_tooltips
with open(settings_file_path, 'w') as outfile:
json.dump(data, outfile)

View File

@ -1,152 +0,0 @@
from struct import pack,unpack
import logging
import sys
"""
Desctiption: IQ Frame header definition
For header field description check the corresponding documentation
Total length: 1024 byte
Project: HeIMDALL RTL
Author: Tamás Pető
Status: Finished
Version history:
1 : Initial version (2019 04 23)
2 : Fixed 1024 byte length (2019 07 25)
3 : Noise source state (2019 10 01)
4 : IQ sync flag (2019 10 21)
5 : Sync state (2019 11 10)
6 : Unix Epoch timestamp (2019 12 17)
6a: Frame type defines (2020 03 19)
7 : Sync word (2020 05 03)
"""
class IQHeader():
FRAME_TYPE_DATA = 0
FRAME_TYPE_DUMMY = 1
FRAME_TYPE_RAMP = 2
FRAME_TYPE_CAL = 3
FRAME_TYPE_TRIGW = 4
SYNC_WORD = 0x2bf7b95a
def __init__(self):
self.logger = logging.getLogger(__name__)
self.header_size = 1024 # size in bytes
self.reserved_bytes = 192
self.sync_word=self.SYNC_WORD # uint32_t
self.frame_type=0 # uint32_t
self.hardware_id="" # char [16]
self.unit_id=0 # uint32_t
self.active_ant_chs=0 # uint32_t
self.ioo_type=0 # uint32_t
self.rf_center_freq=0 # uint64_t
self.adc_sampling_freq=0 # uint64_t
self.sampling_freq=0 # uint64_t
self.cpi_length=0 # uint32_t
self.time_stamp=0 # uint64_t
self.daq_block_index=0 # uint32_t
self.cpi_index=0 # uint32_t
self.ext_integration_cntr=0 # uint64_t
self.data_type=0 # uint32_t
self.sample_bit_depth=0 # uint32_t
self.adc_overdrive_flags=0 # uint32_t
self.if_gains=[0]*32 # uint32_t x 32
self.delay_sync_flag=0 # uint32_t
self.iq_sync_flag=0 # uint32_t
self.sync_state=0 # uint32_t
self.noise_source_state=0 # uint32_t
self.reserved=[0]*self.reserved_bytes# uint32_t x reserverd_bytes
self.header_version=0 # uint32_t
def decode_header(self, iq_header_byte_array):
"""
Unpack,decode and store the content of the iq header
"""
iq_header_list = unpack("II16sIIIQQQIQIIQIII"+"I"*32+"IIII"+"I"*self.reserved_bytes+"I", iq_header_byte_array)
self.sync_word = iq_header_list[0]
self.frame_type = iq_header_list[1]
self.hardware_id = iq_header_list[2].decode()
self.unit_id = iq_header_list[3]
self.active_ant_chs = iq_header_list[4]
self.ioo_type = iq_header_list[5]
self.rf_center_freq = iq_header_list[6]
self.adc_sampling_freq = iq_header_list[7]
self.sampling_freq = iq_header_list[8]
self.cpi_length = iq_header_list[9]
self.time_stamp = iq_header_list[10]
self.daq_block_index = iq_header_list[11]
self.cpi_index = iq_header_list[12]
self.ext_integration_cntr = iq_header_list[13]
self.data_type = iq_header_list[14]
self.sample_bit_depth = iq_header_list[15]
self.adc_overdrive_flags = iq_header_list[16]
self.if_gains = iq_header_list[17:49]
self.delay_sync_flag = iq_header_list[49]
self.iq_sync_flag = iq_header_list[50]
self.sync_state = iq_header_list[51]
self.noise_source_state = iq_header_list[52]
self.header_version = iq_header_list[52+self.reserved_bytes+1]
def encode_header(self):
"""
Pack the iq header information into a byte array
"""
iq_header_byte_array=pack("II", self.sync_word, self.frame_type)
iq_header_byte_array+=self.hardware_id.encode()+bytearray(16-len(self.hardware_id.encode()))
iq_header_byte_array+=pack("IIIQQQIQIIQIII",
self.unit_id, self.active_ant_chs, self.ioo_type, self.rf_center_freq, self.adc_sampling_freq,
self.sampling_freq, self.cpi_length, self.time_stamp, self.daq_block_index, self.cpi_index,
self.ext_integration_cntr, self.data_type, self.sample_bit_depth, self.adc_overdrive_flags)
for m in range(32):
iq_header_byte_array+=pack("I", self.if_gains[m])
iq_header_byte_array+=pack("I", self.delay_sync_flag)
iq_header_byte_array+=pack("I", self.iq_sync_flag)
iq_header_byte_array+=pack("I", self.sync_state)
iq_header_byte_array+=pack("I", self.noise_source_state)
for m in range(self.reserved_bytes):
iq_header_byte_array+=pack("I",0)
iq_header_byte_array+=pack("I", self.header_version)
return iq_header_byte_array
def dump_header(self):
"""
Prints out the content of the header in human readable format
"""
self.logger.info("Sync word: {:d}".format(self.sync_word))
self.logger.info("Header version: {:d}".format(self.header_version))
self.logger.info("Frame type: {:d}".format(self.frame_type))
self.logger.info("Hardware ID: {:16}".format(self.hardware_id))
self.logger.info("Unit ID: {:d}".format(self.unit_id))
self.logger.info("Active antenna channels: {:d}".format(self.active_ant_chs))
self.logger.info("Illuminator type: {:d}".format(self.ioo_type))
self.logger.info("RF center frequency: {:.2f} MHz".format(self.rf_center_freq/10**6))
self.logger.info("ADC sampling frequency: {:.2f} MHz".format(self.adc_sampling_freq/10**6))
self.logger.info("IQ sampling frequency {:.2f} MHz".format(self.sampling_freq/10**6))
self.logger.info("CPI length: {:d}".format(self.cpi_length))
self.logger.info("Unix Epoch timestamp: {:d}".format(self.time_stamp))
self.logger.info("DAQ block index: {:d}".format(self.daq_block_index))
self.logger.info("CPI index: {:d}".format(self.cpi_index))
self.logger.info("Extended integration counter {:d}".format(self.ext_integration_cntr))
self.logger.info("Data type: {:d}".format(self.data_type))
self.logger.info("Sample bit depth: {:d}".format(self.sample_bit_depth))
self.logger.info("ADC overdrive flags: {:d}".format(self.adc_overdrive_flags))
for m in range(32):
self.logger.info("Ch: {:d} IF gain: {:.1f} dB".format(m, self.if_gains[m]/10))
self.logger.info("Delay sync flag: {:d}".format(self.delay_sync_flag))
self.logger.info("IQ sync flag: {:d}".format(self.iq_sync_flag))
self.logger.info("Sync state: {:d}".format(self.sync_state))
self.logger.info("Noise source state: {:d}".format(self.noise_source_state))
def check_sync_word(self):
"""
Check the sync word of the header
"""
if self.sync_word != self.SYNC_WORD:
return -1
else:
return 0

View File

@ -1,375 +0,0 @@
# KrakenSDR Receiver
# Copyright (C) 2018-2021 Carl Laufer, Tamás Pető
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# -*- coding: utf-8 -*-
# Import built-in modules
import sys
import os
import time
from struct import pack, unpack
import socket
import _thread
from threading import Lock
import queue
import logging
#import copy
# Import third party modules
import numpy as np
from scipy import signal
from iq_header import IQHeader
from shmemIface import inShmemIface
class ReceiverRTLSDR():
def __init__(self, data_que, data_interface = "eth", logging_level=10):
"""
Parameter:
----------
:param: data_que: Que to communicate with the UI (web iface/Qt GUI)
:param: data_interface: This field is configured by the GUI during instantiation.
Valid values are the followings:
"eth" : The module will receiver IQ frames through an Ethernet connection
"shmem": The module will receiver IQ frames through a shared memory interface
:type : data_interface: string
"""
self.logger = logging.getLogger(__name__)
self.logger.setLevel(logging_level)
# DAQ parameters
# These values are used by default to configure the DAQ through the configuration interface
# Values are configured externally upon configuration request
self.daq_center_freq = 100 # MHz
self.daq_rx_gain = 0 # [dB]
self.daq_squelch_th_dB = 0
# UI interface
self.data_que = data_que
# IQ data interface
self.data_interface = data_interface
# -> Ethernet
self.receiver_connection_status = False
self.port = 5000
self.rec_ip_addr = "127.0.0.1" # Configured by the GUI prior to connection request
self.socket_inst = socket.socket()
self.receiverBufferSize = 2 ** 18 # Size of the Ethernet receiver buffer measured in bytes
# -> Shared memory
root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
daq_path = os.path.join(os.path.dirname(root_path),"heimdall_daq_fw")
self.daq_shmem_control_path = os.path.join(os.path.join(daq_path,"Firmware"),"_data_control/")
self.init_data_iface()
# Control interface
self.ctr_iface_socket = socket.socket()
self.ctr_iface_port = 5001
self.ctr_iface_thread_lock = Lock() # Used to synchronize the operation of the ctr_iface thread
self.iq_frame_bytes = None
self.iq_samples = None
self.iq_header = IQHeader()
self.M = 0 # Number of receiver channels, updated after establishing connection
def init_data_iface(self):
if self.data_interface == "shmem":
# Open shared memory interface to capture the DAQ firmware output
self.in_shmem_iface = inShmemIface("delay_sync_iq", self.daq_shmem_control_path)
if not self.in_shmem_iface.init_ok:
self.logger.critical("Shared memory initialization failed")
self.in_shmem_iface.destory_sm_buffer()
return -1
return 0
def eth_connect(self):
"""
Compatible only with DAQ firmwares that has the IQ streaming mode.
HeIMDALL DAQ Firmware version: 1.0 or later
"""
try:
if not self.receiver_connection_status:
if self.data_interface == "eth":
# Establlish IQ data interface connection
self.socket_inst.connect((self.rec_ip_addr, self.port))
self.socket_inst.sendall(str.encode('streaming'))
test_iq = self.receive_iq_frame()
self.M = self.iq_header.active_ant_chs
# Establish control interface connection
self.ctr_iface_socket.connect((self.rec_ip_addr, self.ctr_iface_port))
self.receiver_connection_status = True
self.ctr_iface_init()
self.logger.info("CTR INIT Center freq: {0}".format(self.daq_center_freq))
self.set_center_freq(self.daq_center_freq)
self.set_if_gain(self.daq_rx_gain)
self.set_squelch_threshold(self.daq_squelch_th_dB)
except:
errorMsg = sys.exc_info()[0]
self.logger.error("Error message: "+str(errorMsg))
self.receiver_connection_status = False
self.logger.error("Unexpected error: {0}".format(sys.exc_info()[0]))
# Re-instantiating sockets
self.socket_inst = socket.socket()
self.ctr_iface_socket = socket.socket()
return -1
self.logger.info("Connection established")
que_data_packet = []
que_data_packet.append(['conn-ok',])
self.data_que.put(que_data_packet)
def eth_close(self):
"""
Close Ethernet conenctions including the IQ data and the control interfaces
"""
try:
if self.receiver_connection_status:
if self.data_interface == "eth":
self.socket_inst.sendall(str.encode('q')) # Send exit message
self.socket_inst.close()
self.socket_inst = socket.socket() # Re-instantiating socket
# Close control interface connection
exit_message_bytes=("EXIT".encode()+bytearray(124))
self.ctr_iface_socket.send(exit_message_bytes)
self.ctr_iface_socket.close()
self.ctr_iface_socket = socket.socket()
self.receiver_connection_status = False
que_data_packet = []
que_data_packet.append(['disconn-ok',])
self.data_que.put(que_data_packet)
except:
errorMsg = sys.exc_info()[0]
self.logger.error("Error message: {0}".format(errorMsg))
return -1
if self.data_interface == "shmem":
self.in_shmem_iface.destory_sm_buffer()
return 0
def get_iq_online(self):
"""
This function obtains a new IQ data frame through the Ethernet IQ data or the shared memory interface
"""
# Check connection
if not self.receiver_connection_status:
fail = self.eth_connect()
if fail:
return -1
if self.data_interface == "eth":
self.socket_inst.sendall(str.encode("IQDownload")) # Send iq request command
self.iq_samples = self.receive_iq_frame()
elif self.data_interface == "shmem":
active_buff_index = self.in_shmem_iface.wait_buff_free()
if active_buff_index < 0 or active_buff_index > 1:
self.logger.info("Terminating.., signal: {:d}".format(active_buff_index))
return -1
buffer = self.in_shmem_iface.buffers[active_buff_index]
iq_header_bytes = buffer[0:1024].tobytes()
self.iq_header.decode_header(iq_header_bytes)
# Inititalization from header - Set channel numbers
if self.M == 0:
self.M = self.iq_header.active_ant_chs
incoming_payload_size = self.iq_header.cpi_length*self.iq_header.active_ant_chs*2*int(self.iq_header.sample_bit_depth/8)
if incoming_payload_size > 0:
iq_samples_in = (buffer[1024:1024 + incoming_payload_size].view(dtype=np.complex64))\
.reshape(self.iq_header.active_ant_chs, self.iq_header.cpi_length)
self.iq_samples = iq_samples_in.copy() # Must be .copy
self.in_shmem_iface.send_ctr_buff_ready(active_buff_index)
def receive_iq_frame(self):
"""
Called by the get_iq_online function. Receives IQ samples over the establed Ethernet connection
"""
total_received_bytes = 0
recv_bytes_count = 0
iq_header_bytes = bytearray(self.iq_header.header_size) # allocate array
view = memoryview(iq_header_bytes) # Get buffer
self.logger.debug("Starting IQ header reception")
while total_received_bytes < self.iq_header.header_size:
# Receive into buffer
recv_bytes_count = self.socket_inst.recv_into(view, self.iq_header.header_size-total_received_bytes)
view = view[recv_bytes_count:] # reset memory region
total_received_bytes += recv_bytes_count
self.iq_header.decode_header(iq_header_bytes)
# Uncomment to check the content of the IQ header
#self.iq_header.dump_header()
incoming_payload_size = self.iq_header.cpi_length*self.iq_header.active_ant_chs*2*int(self.iq_header.sample_bit_depth/8)
if incoming_payload_size > 0:
# Calculate total bytes to receive from the iq header data
total_bytes_to_receive = incoming_payload_size
receiver_buffer_size = 2**18
self.logger.debug("Total bytes to receive: {:d}".format(total_bytes_to_receive))
total_received_bytes = 0
recv_bytes_count = 0
iq_data_bytes = bytearray(total_bytes_to_receive + receiver_buffer_size) # allocate array
view = memoryview(iq_data_bytes) # Get buffer
while total_received_bytes < total_bytes_to_receive:
# Receive into buffer
recv_bytes_count = self.socket_inst.recv_into(view, receiver_buffer_size)
view = view[recv_bytes_count:] # reset memory region
total_received_bytes += recv_bytes_count
self.logger.debug(" IQ data succesfully received")
# Convert raw bytes to Complex float64 IQ samples
self.iq_samples = np.frombuffer(iq_data_bytes[0:total_bytes_to_receive], dtype=np.complex64).reshape(self.iq_header.active_ant_chs, self.iq_header.cpi_length)
self.iq_frame_bytes = bytearray()+iq_header_bytes+iq_data_bytes
return self.iq_samples
else:
return 0
def set_squelch_threshold(self, threshold_dB):
"""
Configures the threshold level of the squelch module in the DAQ FW through the control interface
"""
if self.receiver_connection_status: # Check connection
self.daq_squelch_th_dB = threshold_dB
if threshold_dB == -80: threshold = 0
else: threshold = 10**(threshold_dB/20)
# Assembling message
cmd="STHU"
th_bytes=pack("f",threshold)
msg_bytes=(cmd.encode()+th_bytes+bytearray(120))
try:
_thread.start_new_thread(self.ctr_iface_communication, (msg_bytes,))
except:
errorMsg = sys.exc_info()[0]
self.logger.error("Unable to start communication thread")
self.logger.error("Error message: {:s}".format(errorMsg))
def ctr_iface_init(self):
"""
Initialize connection with the DAQ FW through the control interface
"""
if self.receiver_connection_status: # Check connection
# Assembling message
cmd="INIT"
msg_bytes=(cmd.encode()+bytearray(124))
try:
_thread.start_new_thread(self.ctr_iface_communication, (msg_bytes,))
except:
errorMsg = sys.exc_info()[0]
self.logger.error("Unable to start communication thread")
self.logger.error("Error message: {:s}".format(errorMsg))
def ctr_iface_communication(self, msg_bytes):
"""
Handles communication on the control interface with the DAQ FW
Parameters:
-----------
:param: msg: Message bytes, that will be sent ont the control interface
:type: msg: Byte array
"""
self.ctr_iface_thread_lock.acquire()
self.logger.debug("Sending control message")
self.ctr_iface_socket.send(msg_bytes)
# Waiting for the command to take effect
reply_msg_bytes = self.ctr_iface_socket.recv(128)
self.logger.debug("Control interface communication finished")
self.ctr_iface_thread_lock.release()
status = reply_msg_bytes[0:4].decode()
if status == "FNSD":
self.logger.info("Reconfiguration succesfully finished")
que_data_packet = []
que_data_packet.append(['config-ok',])
self.data_que.put(que_data_packet)
else:
self.logger.error("Failed to set the requested parameter, reply: {0}".format(status))
def set_center_freq(self, center_freq):
"""
Configures the RF center frequency of the receiver through the control interface
Paramters:
----------
:param: center_freq: Required center frequency to set [Hz]
:type: center_freq: float
"""
if self.receiver_connection_status: # Check connection
self.daq_center_freq = int(center_freq)
# Set center frequency
cmd="FREQ"
freq_bytes=pack("Q",int(center_freq))
msg_bytes=(cmd.encode()+freq_bytes+bytearray(116))
try:
_thread.start_new_thread(self.ctr_iface_communication, (msg_bytes,))
except:
errorMsg = sys.exc_info()[0]
self.logger.error("Unable to start communication thread")
self.logger.error("Error message: {:s}".format(errorMsg))
def set_if_gain(self, gain):
"""
Configures the IF gain of the receiver through the control interface
Paramters:
----------
:param: gain: IF gain value [dB]
:type: gain: int
"""
if self.receiver_connection_status: # Check connection
self.daq_rx_gain = gain
# Set center frequency
cmd="GAIN"
gain_list=[297, 37] #[int(gain*10)]*self.M
gain_bytes=pack("I"*self.M, *gain_list)
msg_bytes=(cmd.encode()+gain_bytes+bytearray(128-(self.M+1)*4))
try:
_thread.start_new_thread(self.ctr_iface_communication, (msg_bytes,))
except:
errorMsg = sys.exc_info()[0]
self.logger.error("Unable to start communication thread")
self.logger.error("Error message: {:s}".format(errorMsg))
def close(self):
"""
Disconnet the receiver module and the DAQ FW
"""
self.eth_close()

View File

@ -1,195 +0,0 @@
"""
HeIMDALL DAQ Firmware
Python based shared memory interface implementations
Author: Tamás Pető
License: GNU GPL V3
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
import logging
from struct import pack, unpack
from multiprocessing import shared_memory
import numpy as np
import os
A_BUFF_READY = 1
B_BUFF_READY = 2
INIT_READY = 10
TERMINATE = 255
class outShmemIface():
def __init__(self, shmem_name, shmem_size, drop_mode = False):
self.init_ok = True
logging.basicConfig(level=logging.INFO)
self.logger = logging.getLogger(__name__)
self.drop_mode = drop_mode
self.dropped_frame_cntr = 0
self.shmem_name = shmem_name
self.buffer_free = [True, True]
self.memories = []
self.buffers = []
# Try to remove shared memories if already exist
try:
shmem_A = shared_memory.SharedMemory(name=shmem_name+'_A',create=False, size=shmem_size)
shmem_A.close()
#shmem_A.unkink()
except FileNotFoundError as err:
self.logger.warning("Shared memory not exist")
try:
shmem_B = shared_memory.SharedMemory(name=shmem_name+'_B',create=False, size=shmem_size)
shmem_B.close()
#shmem_B.unkink()
except FileNotFoundError as err:
self.logger.warning("Shared memory not exist")
# Create the shared memories
self.memories.append(shared_memory.SharedMemory(name=shmem_name+'_A',create=True, size=shmem_size))
self.memories.append(shared_memory.SharedMemory(name=shmem_name+'_B',create=True, size=shmem_size))
self.buffers.append(np.ndarray((shmem_size,), dtype=np.uint8, buffer=self.memories[0].buf))
self.buffers.append(np.ndarray((shmem_size,), dtype=np.uint8, buffer=self.memories[1].buf))
# Opening control FIFOs
if self.drop_mode:
bw_fifo_flags = os.O_RDONLY | os.O_NONBLOCK
else:
bw_fifo_flags = os.O_RDONLY
try:
self.fw_ctr_fifo = os.open('_data_control/'+'fw_'+shmem_name, os.O_WRONLY)
self.bw_ctr_fifo = os.open('_data_control/'+'bw_'+shmem_name, bw_fifo_flags)
except OSError as err:
self.logger.critical("OS error: {0}".format(err))
self.logger.critical("Failed to open control fifos")
self.bw_ctr_fifo = None
self.fw_ctr_fifo = None
self.init_ok = False
# Send init ready signal
if self.init_ok:
os.write(self.fw_ctr_fifo, pack('B',INIT_READY))
def send_ctr_buff_ready(self, active_buffer_index):
# Send buffer ready signal on the forward FIFO
if active_buffer_index == 0:
os.write(self.fw_ctr_fifo, pack('B',A_BUFF_READY))
elif active_buffer_index == 1:
os.write(self.fw_ctr_fifo, pack('B',B_BUFF_READY))
# Deassert buffer free flag
self.buffer_free[active_buffer_index] = False
def send_ctr_terminate(self):
os.write(self.fw_ctr_fifo, pack('B',TERMINATE))
self.logger.info("Terminate signal sent")
def destory_sm_buffer(self):
for memory in self.memories:
memory.close()
memory.unlink()
if self.fw_ctr_fifo is not None:
os.close(self.fw_ctr_fifo)
if self.bw_ctr_fifo is not None:
os.close(self.bw_ctr_fifo)
def wait_buff_free(self):
if self.buffer_free[0]:
return 0
elif self.buffer_free[1]:
return 1
else:
try:
buffer = os.read(self.bw_ctr_fifo, 1)
signal = unpack('B', buffer )[0]
if signal == A_BUFF_READY:
self.buffer_free[0] = True
return 0
if signal == B_BUFF_READY:
self.buffer_free[1] = True
return 1
except BlockingIOError as err:
self.dropped_frame_cntr +=1
self.logger.warning("Dropping frame.. Total: [{:d}] ".format(self.dropped_frame_cntr))
return 3
return -1
class inShmemIface():
def __init__(self, shmem_name, ctr_fifo_path="_data_control/"):
self.init_ok = True
logging.basicConfig(level=logging.INFO)
self.logger = logging.getLogger(__name__)
self.drop_mode = False
self.shmem_name = shmem_name
self.memories = []
self.buffers = []
try:
self.fw_ctr_fifo = os.open(ctr_fifo_path+'fw_'+shmem_name, os.O_RDONLY)
self.bw_ctr_fifo = os.open(ctr_fifo_path+'bw_'+shmem_name, os.O_WRONLY)
except OSError as err:
self.logger.critical("OS error: {0}".format(err))
self.logger.critical("Failed to open control fifos")
self.bw_ctr_fifo = None
self.fw_ctr_fifo = None
self.init_ok = False
if self.fw_ctr_fifo is not None:
if unpack('B', os.read(self.fw_ctr_fifo, 1))[0] == INIT_READY:
self.memories.append(shared_memory.SharedMemory(name=shmem_name+'_A'))
self.memories.append(shared_memory.SharedMemory(name=shmem_name+'_B'))
self.buffers.append(np.ndarray((self.memories[0].size,),
dtype=np.uint8,
buffer=self.memories[0].buf))
self.buffers.append(np.ndarray((self.memories[1].size,),
dtype=np.uint8,
buffer=self.memories[1].buf))
else:
self.init_ok = False
def send_ctr_buff_ready(self, active_buffer_index):
if active_buffer_index == 0:
os.write(self.bw_ctr_fifo, pack('B',A_BUFF_READY))
elif active_buffer_index == 1:
os.write(self.bw_ctr_fifo, pack('B',B_BUFF_READY))
def destory_sm_buffer(self):
for memory in self.memories:
memory.close()
if self.fw_ctr_fifo is not None:
os.close(self.fw_ctr_fifo)
if self.bw_ctr_fifo is not None:
os.close(self.bw_ctr_fifo)
def wait_buff_free(self):
signal = unpack('B', os.read(self.fw_ctr_fifo, 1))[0]
if signal == A_BUFF_READY:
return 0
elif signal == B_BUFF_READY:
return 1
elif signal == TERMINATE:
return TERMINATE
return -1

View File

@ -1,713 +0,0 @@
# KrakenSDR Signal Processor
#
# Copyright (C) 2018-2021 Carl Laufer, Tamás Pető
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
#
# - coding: utf-8 -*-
# Import built-in modules
import sys
import os
import time
import logging
import threading
import queue
import math
# Import optimization modules
import numba as nb
from numba import jit, njit
from functools import lru_cache
# Math support
import numpy as np
import numpy.linalg as lin
#from numba import jit
import pyfftw
# Signal processing support
import scipy
from scipy import fft
from scipy import signal
from scipy.signal import correlate
from scipy.signal import convolve
from pyapril import channelPreparation as cp
from pyapril import clutterCancellation as cc
from pyapril import detector as det
c_dtype = np.complex64
#import socket
# UDP is useless to us because it cannot work over mobile internet
# Init UDP
#server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
#server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
# Enable broadcasting mode
#server.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
# Set a timeout so the socket does not block
# indefinitely when trying to receive data.
#server.settimeout(0.2)
class SignalProcessor(threading.Thread):
def __init__(self, data_que, module_receiver, logging_level=10):
"""
Parameters:
-----------
:param: data_que: Que to communicate with the UI (web iface/Qt GUI)
:param: module_receiver: Kraken SDR DoA DSP receiver modules
"""
super(SignalProcessor, self).__init__()
self.logger = logging.getLogger(__name__)
self.logger.setLevel(logging_level)
root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
doa_res_file_path = os.path.join(os.path.join(root_path,"_android_web","DOA_value.html"))
self.DOA_res_fd = open(doa_res_file_path,"w+")
self.module_receiver = module_receiver
self.data_que = data_que
self.en_spectrum = False
self.en_record = False
self.en_DOA_estimation = True
self.first_frame = 1 # Used to configure local variables from the header fields
self.processed_signal = np.empty(0)
# Squelch feature
self.data_ready = False
self.en_squelch = False
self.squelch_threshold = 0.1
self.squelch_trigger_channel = 0
self.raw_signal_amplitude = np.empty(0)
self.filt_signal = np.empty(0)
self.squelch_mask = np.empty(0)
# DOA processing options
self.en_DOA_Bartlett = False
self.en_DOA_Capon = False
self.en_DOA_MEM = False
self.en_DOA_MUSIC = False
self.en_DOA_FB_avg = False
self.DOA_offset = 0
self.DOA_inter_elem_space = 0.5
self.DOA_ant_alignment = "ULA"
self.DOA_theta = np.linspace(0,359,360)
# PR processing options
self.PR_clutter_cancellation = "Wiener MRE"
self.max_bistatic_range = 128
self.max_doppler = 256
self.en_PR = True
# Processing parameters
self.spectrum_window_size = 2048 #1024
self.spectrum_window = "hann"
self.run_processing = False
self.is_running = False
self.channel_number = 4 # Update from header
# Result vectors
self.DOA_Bartlett_res = np.ones(181)
self.DOA_Capon_res = np.ones(181)
self.DOA_MEM_res = np.ones(181)
self.DOA_MUSIC_res = np.ones(181)
self.DOA_theta = np.arange(0,181,1)
self.max_index = 0
self.max_frequency = 0
self.fft_signal_width = 0
self.DOA_theta = np.linspace(0,359,360)
self.spectrum = None #np.ones((self.channel_number+2,N), dtype=np.float32)
self.spectrum_upd_counter = 0
def run(self):
"""
Main processing thread
"""
pyfftw.config.NUM_THREADS = 4
scipy.fft.set_backend(pyfftw.interfaces.scipy_fft)
pyfftw.interfaces.cache.enable()
while True:
self.is_running = False
time.sleep(1)
while self.run_processing:
self.is_running = True
que_data_packet = []
start_time = time.time()
#-----> ACQUIRE NEW DATA FRAME <-----
self.module_receiver.get_iq_online()
# Check frame type for processing
en_proc = (self.module_receiver.iq_header.frame_type == self.module_receiver.iq_header.FRAME_TYPE_DATA)# or \
#(self.module_receiver.iq_header.frame_type == self.module_receiver.iq_header.FRAME_TYPE_CAL)# For debug purposes
"""
You can enable here to process other frame types (such as call type frames)
"""
que_data_packet.append(['iq_header',self.module_receiver.iq_header])
self.logger.debug("IQ header has been put into the data que entity")
# Configure processing parameteres based on the settings of the DAQ chain
if self.first_frame:
self.channel_number = self.module_receiver.iq_header.active_ant_chs
self.spectrum_upd_counter = 0
self.spectrum = np.ones((self.channel_number+2, self.spectrum_window_size), dtype=np.float32)
self.first_frame = 0
decimation_factor = 1
self.data_ready = False
if en_proc:
self.processed_signal = self.module_receiver.iq_samples
self.data_ready = True
first_decimation_factor = 1 #480
# TESTING: DSP side main decimation - significantly slower than NE10 but it works ok-ish
#decimated_signal = signal.decimate(self.processed_signal, first_decimation_factor, n = 584, ftype='fir', zero_phase=True) #first_decimation_factor * 2, ftype='fir')
#self.processed_signal = decimated_signal #.copy()
#spectrum_signal = decimated_signal.copy()
max_amplitude = -100
#max_ch = np.argmax(np.max(self.spectrum[1:self.module_receiver.iq_header.active_ant_chs+1,:], axis=1)) # Find the channel that had the max amplitude
max_amplitude = 0 #np.max(self.spectrum[1+max_ch, :]) #Max amplitude out of all 5 channels
#max_spectrum = self.spectrum[1+max_ch, :] #Send max ch to channel centering
que_data_packet.append(['max_amplitude',max_amplitude])
#-----> SQUELCH PROCESSING <-----
if self.en_squelch:
self.data_ready = False
self.processed_signal, decimation_factor, self.fft_signal_width, self.max_index = \
center_max_signal(self.processed_signal, self.spectrum[0,:], max_spectrum, self.module_receiver.daq_squelch_th_dB, self.module_receiver.iq_header.sampling_freq)
#decimated_signal = []
#if(decimation_factor > 1):
# decimated_signal = signal.decimate(self.processed_signal, decimation_factor, n = decimation_factor * 2, ftype='fir')
# self.processed_signal = decimated_signal #.copy()
#Only update if we're above the threshold
if max_amplitude > self.module_receiver.daq_squelch_th_dB:
self.data_ready = True
#-----> SPECTRUM PROCESSING <-----
if self.en_spectrum and self.data_ready:
spectrum_samples = self.module_receiver.iq_samples #spectrum_signal #self.processed_signal #self.module_receiver.iq_samples #self.processed_signal
N = self.spectrum_window_size
N_perseg = 0
N_perseg = min(N, len(self.processed_signal[0,:])//25)
N_perseg = N_perseg // 1
# Get power spectrum
f, Pxx_den = signal.welch(self.processed_signal, self.module_receiver.iq_header.sampling_freq//first_decimation_factor,
nperseg=N_perseg,
nfft=N,
noverlap=int(N_perseg*0.25),
detrend=False,
return_onesided=False,
window= ('tukey', 0.25), #tukey window gives better time resolution for squelching #self.spectrum_window, #('tukey', 0.25), #self.spectrum_window,
#window=self.spectrum_window,
scaling="spectrum")
self.spectrum[1:self.module_receiver.iq_header.active_ant_chs+1,:] = np.fft.fftshift(10*np.log10(Pxx_den))
self.spectrum[0,:] = np.fft.fftshift(f)
# Create signal window for plot
# signal_window = np.ones(len(self.spectrum[1,:])) * -100
# signal_window[max(self.max_index - self.fft_signal_width//2, 0) : min(self.max_index + self.fft_signal_width//2, len(self.spectrum[1,:]))] = max(self.spectrum[1,:])
#signal_window = np.ones(len(max_spectrum)) * -100
#signal_window[max(self.max_index - self.fft_signal_width//2, 0) : min(self.max_index + self.fft_signal_width//2, len(max_spectrum))] = max(max_spectrum)
#self.spectrum[self.channel_number+1, :] = signal_window #np.ones(len(spectrum[1,:])) * self.module_receiver.daq_squelch_th_dB # Plot threshold line
que_data_packet.append(['spectrum', self.spectrum])
#-----> Passive Radar <-----
conf_val = 0
theta_0 = 0
if self.en_PR and self.data_ready and self.channel_number > 1:
ref_ch = self.module_receiver.iq_samples[0,:]
surv_ch = self.module_receiver.iq_samples[1,:]
td_filter_dimension = self.max_bistatic_range
start = time.time()
if self.PR_clutter_cancellation == "Wiener MRE":
surv_ch, w = Wiener_SMI_MRE(ref_ch, surv_ch, td_filter_dimension)
#surv_ch, w = cc.Wiener_SMI_MRE(ref_ch, surv_ch, td_filter_dimension)
surv_ch = det.windowing(surv_ch, "Hamming") #surv_ch * signal.tukey(surv_ch.size, alpha=0.25) #det.windowing(surv_ch, "hamming")
max_Doppler = self.max_doppler #256
max_range = self.max_bistatic_range
#RD_matrix = det.cc_detector_ons(ref_ch, surv_ch, self.module_receiver.iq_header.sampling_freq, max_Doppler, max_range, verbose=0, Qt_obj=None)
RD_matrix = cc_detector_ons(ref_ch, surv_ch, self.module_receiver.iq_header.sampling_freq, max_Doppler, max_range)
end = time.time()
print("Time: " + str((end-start) * 1000))
que_data_packet.append(['RD_matrix', RD_matrix])
# Record IQ samples
if self.en_record:
# TODO: Implement IQ frame recording
self.logger.error("Saving IQ samples to npy is obsolete, IQ Frame saving is currently not implemented")
stop_time = time.time()
que_data_packet.append(['update_rate', stop_time-start_time])
que_data_packet.append(['latency', int(stop_time*10**3)-self.module_receiver.iq_header.time_stamp])
# If the que is full, and data is ready (from squelching), clear the buffer immediately so that useful data has the priority
if self.data_que.full() and self.data_ready:
try:
#self.logger.info("BUFFER WAS NOT EMPTY, EMPTYING NOW")
self.data_que.get(False) #empty que if not taken yet so fresh data is put in
except queue.Empty:
#self.logger.info("DIDNT EMPTY")
pass
# Put data into buffer, but if there is no data because its a cal/trig wait frame etc, then only write if the buffer is empty
# Otherwise just discard the data so that we don't overwrite good DATA frames.
try:
self.data_que.put(que_data_packet, False) # Must be non-blocking so DOA can update when dash browser window is closed
except:
# Discard data, UI couldn't consume fast enough
pass
"""
start = time.time()
end = time.time()
thetime = ((end - start) * 1000)
print ("Time elapsed: ", thetime)
"""
@jit(fastmath=True)
def Wiener_SMI_MRE(ref_ch, surv_ch, K):
"""
Description:
------------
Performs Wiener filtering with applying the Minimum Redundance Estimation (MRE) technique.
When using MRE, the autocorrelation matrix is not fully estimated, but only the first column.
With this modification the required calculations can be reduced from KxK to K element.
Parameters:
-----------
:param K : Filter tap number
:param ref_ch : Reference signal array
:param surv_ch: Surveillance signal array
:type K : int
:type ref_ch : 1 x N complex numpy array
:type surv_ch: 1 x N complex numpy array
Return values:
--------------
:return filt: Filtered surveillance channel
:rtype filt: 1 x N complex numpy array
:return None: Input parameters are not consistent
"""
N = ref_ch.shape[0] # Number of time samples
R, r = pruned_correlation(ref_ch, surv_ch, K, N)
R_mult = R_eye_memoize(K)
w = fast_w(R, r, K, R_mult)
#return surv_ch - np.convolve(ref_ch, w)[0:N], w # subtract the zero doppler clutter
return surv_ch - signal.oaconvolve(ref_ch, w)[0:N], w # subtract the zero doppler clutter #oaconvolve saves us about 100-200 ms
@njit(fastmath=True, parallel=True, cache=True)
def fast_w(R, r, K, R_mult):
# Complete the R matrix based on its Hermitian and Toeplitz property
for k in range(1, K):
R[:, k] = shift(R[:, 0], k)
#R[:, K] = shift(R[:,0], K)
R += np.transpose(np.conjugate(R))
R *= R_mult #(np.ones(K) - np.eye(K) * 0.5)
#w = np.dot(lin.inv(R), r) # weight vector
w = lin.inv(R) @ r #np.dot(lin.inv(R), r) # weight vector #matmul (@) may be slightly faster that np.dot for 1D, 2D arrays.
# inverse and dot product run time : 1.1s for 2048*2048 matrix
return w
#Memoize ~50ms speedup?
@lru_cache(maxsize=2)
def R_eye_memoize(K):
return (np.ones(K) - np.eye(K) * 0.5)
#Modified pruned correlation, returns R and r directly and saves one FFT
@jit(fastmath=True, cache=True)
def pruned_correlation(ref_ch, surv_ch, clen, N):
"""
Description:
-----------
Calculates the part of the correlation function of arrays with same size
The total length of the cross-correlation function is 2*N-1, but this
function calculates the values of the cross-correlation between [N-1 : N+clen-1]
Parameters:
-----------
:param x : input array
:param y : input array
:param clen: correlation length
:type x: 1 x N complex numpy array
:type y: 1 x N complex numpy array
:type clen: int
Return values:
--------------
:return corr : part of the cross-correlation function
:rtype corr : 1 x clen complex numpy array
:return None : inconsistent array size
"""
R = np.zeros((clen, clen), dtype=c_dtype) # Autocorrelation mtx.
# --calculation--
# set up input matrices pad zeros if not multiply of the correlation length
cols = clen - 1 #(clen = Filter drowsimension)
rows = np.int32(N / (cols)) + 1
zeropads = cols * rows - N
x = np.pad(ref_ch, (0, zeropads))
# shaping inputs into matrices
xp = np.reshape(x, (rows, cols))
# padding matrices for FFT
ypp = np.vstack([xp[1:, :], np.zeros(cols, dtype=c_dtype)]) #vstack appears to be faster than pad
yp = np.concatenate([xp, ypp], axis=1)
# execute FFT on the matrices
xpw = fft.fft(xp, n = 2*cols, axis=1, workers=4, overwrite_x=True)
bpw = fft.fft(yp, axis=1, workers=4, overwrite_x=True)
# magic formula which describes the unified equation of the universe
# corr_batches = np.fliplr(fft.fftshift(fft.ifft(corr_mult(xpw, bpw), axis=1, workers=4, overwrite_x=True)).conj()[:, 0:clen])
corr_batches = fft.fftshift(fft.ifft(corr_mult(xpw, bpw), axis=1, workers=4, overwrite_x=True)).conj()[:, 0:clen]
# sum each value in a column of the batched correlation matrix
R[:,0] = np.fliplr([np.sum(corr_batches, axis=0)])[0]
#calc r
y = np.pad(surv_ch, (0, zeropads))
yp = np.reshape(y, (rows, cols))
ypp = np.vstack([yp[1:, :], np.zeros(cols, dtype=c_dtype)]) #vstack appears to be faster than pad
yp = np.concatenate([yp, ypp], axis=1)
bpw = fft.fft(yp, axis=1, workers=4, overwrite_x=True)
#corr_batches = np.fliplr(fft.fftshift(fft.ifft(corr_mult(xpw, bpw), axis=1, workers=4, overwrite_x=True)).conj()[:, 0:clen])
corr_batches = fft.fftshift(fft.ifft(corr_mult(xpw, bpw), axis=1, workers=4, overwrite_x=True)).conj()[:, 0:clen]
#r = np.sum(corr_batches, axis=0)
r = np.fliplr([np.sum(corr_batches, axis=0)])[0]
return R, r
@njit(fastmath=True, cache=True)
def shift(x, i):
"""
Description:
-----------
Similar to np.roll function, but not circularly shift values
Example:
x = |x0|x1|...|xN-1|
y = shift(x,2)
x --> y: |0|0|x0|x1|...|xN-3|
Parameters:
-----------
:param:x : input array on which the roll will be performed
:param i : delay value [sample]
:type i :int
:type x: N x 1 complex numpy array
Return values:
--------------
:return shifted : shifted version of x
:rtype shifted: N x 1 complex numpy array
"""
N = x.shape[0]
if np.abs(i) >= N:
return np.zeros(N, dtype=c_dtype)
if i == 0:
return x
shifted = np.roll(x, i)
if i < 0:
shifted[np.mod(N + i, N):] = np.zeros(np.abs(i), dtype=c_dtype)
if i > 0:
shifted[0:i] = np.zeros(np.abs(i), dtype=c_dtype)
return shifted
@njit(fastmath=True, parallel=True, cache=True)
def resize_and_align(no_sub_tasks, ref_ch, surv_ch, fs, fD_max, r_max):
surv_ch_align = np.reshape(surv_ch,(no_sub_tasks, r_max)) # shaping surveillance signal array into a matrix
pad_zeros = np.expand_dims(np.zeros(r_max, dtype=c_dtype), axis=0)
surv_ch_align = np.vstack((surv_ch_align, pad_zeros)) # padding one row of zeros into the surv matrix
surv_ch_align = np.concatenate((surv_ch_align[0 : no_sub_tasks,:], surv_ch_align[1 : no_sub_tasks +1, :]), axis = 1)
ref_ch_align = np.reshape(ref_ch, (no_sub_tasks, r_max)) # shaping reference signal array into a matrix
pad_zeros = np.zeros((no_sub_tasks, r_max),dtype = c_dtype)
ref_ch_align = np.concatenate((ref_ch_align, pad_zeros),axis = 1) # shaping
return ref_ch_align, surv_ch_align
@njit(fastmath=True, cache=True)
def corr_mult(surv_fft, ref_fft):
return np.multiply(surv_fft, ref_fft.conj())
@jit(fastmath=True, cache=True)
def cc_detector_ons(ref_ch, surv_ch, fs, fD_max, r_max):
"""
Parameters:
-----------
:param N: Range resolution - N must be a divisor of the input length
:param F: Doppler resolution, F has a theoretical limit. If you break the limit, the output may repeat
itself and get wrong results. F should be less than length/N otherwise use other method!
Return values:
--------------
:return None: Improper input parameters
"""
N = ref_ch.size
# --> Set processing parameters
fD_step = fs / (2 * N) # Doppler frequency step size (with zero padding)
Doppler_freqs_size = int(fD_max / fD_step)
no_sub_tasks = N // r_max
# Allocate range-Doppler maxtrix
mx = np.zeros((2*Doppler_freqs_size+1, r_max),dtype = c_dtype) #memoize_zeros((2*Doppler_freqs_size+1, r_max), c_dtype) #np.zeros((2*Doppler_freqs_size+1, r_max),dtype = nb.c8)
ref_ch_align, surv_ch_align = resize_and_align(no_sub_tasks, ref_ch, surv_ch, fs, fD_max, r_max)
# row wise fft on both channels
ref_fft = fft.fft(ref_ch_align, axis = 1, overwrite_x=True, workers=4) #pyfftw.interfaces.numpy_fft.fft(ref_ch_align_a, axis = 1, overwrite_input=True, threads=4) #fft.fft(ref_ch_align_a, axis = 1, overwrite_x=True, workers=4)
surv_fft = fft.fft(surv_ch_align, axis = 1, overwrite_x=True, workers=4) #pyfftw.interfaces.numpy_fft.fft(surv_ch_align_a, axis = 1, overwrite_input=True, threads=4) #fft.fft(surv_ch_align_a, axis = 1, overwrite_x=True, workers=4)
corr = corr_mult(surv_fft, ref_fft) #np.multiply(surv_fft, ref_fft.conj())
corr = fft.ifft(corr,axis = 1, workers=4, overwrite_x=True)
corr_a = pyfftw.empty_aligned(np.shape(corr), dtype=c_dtype)
corr_a[:] = corr #.copy()
# This is the most computationally intensive part ~120ms, overwrite_x=True gives a big speedup, not sure if it changes the result though...
corr = fft.fft(corr_a, n=2* no_sub_tasks, axis = 0, workers=4, overwrite_x=True) # Setting the output size with "n=.." is faster than doing a concat first.
# crop and fft shift
mx[ 0 : Doppler_freqs_size, 0 : r_max] = corr[2*no_sub_tasks - Doppler_freqs_size : 2*no_sub_tasks, 0 : r_max]
mx[Doppler_freqs_size : 2 * Doppler_freqs_size+1, 0 : r_max] = corr[ 0 : Doppler_freqs_size+1 , 0 : r_max]
return mx
#NUMBA optimized center tracking. Gives a mild speed boost ~25% faster.
@njit(fastmath=True, cache=True, parallel=True)
def center_max_signal(processed_signal, frequency, fft_spectrum, threshold, sample_freq):
# Where is the max frequency? e.g. where is the signal?
max_index = np.argmax(fft_spectrum)
max_frequency = frequency[max_index]
# Auto decimate down to exactly the max signal width
fft_signal_width = np.sum(fft_spectrum > threshold) + 25
decimation_factor = max((sample_freq // fft_signal_width) // 2, 1)
# Auto shift peak frequency center of spectrum, this frequency will be decimated:
# https://pysdr.org/content/filters.html
f0 = -max_frequency #+10
Ts = 1.0/sample_freq
t = np.arange(0.0, Ts*len(processed_signal[0, :]), Ts)
exponential = np.exp(2j*np.pi*f0*t) # this is essentially a complex sine wave
return processed_signal * exponential, decimation_factor, fft_signal_width, max_index
# NUMBA optimized MUSIC function. About 100x faster on the Pi 4
@njit(fastmath=True, cache=True)
def DOA_MUSIC(R, scanning_vectors, signal_dimension, angle_resolution=1):
# --> Input check
if R[:,0].size != R[0,:].size:
print("ERROR: Correlation matrix is not quadratic")
return np.ones(1, dtype=nb.c16)*-1 #[(-1, -1j)]
if R[:,0].size != scanning_vectors[:,0].size:
print("ERROR: Correlation matrix dimension does not match with the antenna array dimension")
return np.ones(1, dtype=nb.c16)*-2
#ADORT = np.zeros(scanning_vectors[0,:].size, dtype=np.complex) #CHANGE TO nb.c16 for NUMBA
ADORT = np.zeros(scanning_vectors[0,:].size, dtype=nb.c16)
M = R[:,0].size #np.size(R, 0)
# --- Calculation ---
# Determine eigenvectors and eigenvalues
sigmai, vi = lin.eig(R)
sigmai = np.abs(sigmai)
idx = sigmai.argsort()[::1] # Sort eigenvectors by eigenvalues, smallest to largest
#sigmai = sigmai[idx] # Eigenvalues not used again
vi = vi[:,idx]
# Generate noise subspace matrix
noise_dimension = M - signal_dimension
#E = np.zeros((M, noise_dimension),dtype=np.complex)
E = np.zeros((M, noise_dimension),dtype=nb.c16)
for i in range(noise_dimension):
E[:,i] = vi[:,i]
theta_index=0
for i in range(scanning_vectors[0,:].size):
S_theta_ = scanning_vectors[:, i]
S_theta_ = S_theta_.T
ADORT[theta_index] = 1/np.abs(S_theta_.conj().T @ (E @ E.conj().T) @ S_theta_)
theta_index += 1
return ADORT
# Numba optimized version of pyArgus corr_matrix_estimate with "fast". About 2x faster on Pi4
@njit(fastmath=True, cache=True) #(nb.c8[:,:](nb.c16[:,:]))
def corr_matrix(X):
M = X[:,0].size
N = X[0,:].size
#R = np.zeros((M, M), dtype=nb.c8)
R = np.dot(X, X.conj().T)
R = np.divide(R, N)
return R
# Numba optimized scanning vectors generation for UCA arrays. About 10x faster on Pi4
# LRU cache memoize about 1000x faster.
@lru_cache(maxsize=8)
def uca_scanning_vectors(M, DOA_inter_elem_space):
thetas = np.linspace(0,359,360) # Remember to change self.DOA_thetas too, we didn't include that in this function due to memoization cannot work with arrays
x = DOA_inter_elem_space * np.cos(2*np.pi/M * np.arange(M))
y = -DOA_inter_elem_space * np.sin(2*np.pi/M * np.arange(M)) # For this specific array only
scanning_vectors = np.zeros((M, thetas.size), dtype=np.complex)
for i in range(thetas.size):
scanning_vectors[:,i] = np.exp(1j*2*np.pi* (x*np.cos(np.deg2rad(thetas[i])) + y*np.sin(np.deg2rad(thetas[i]))))
return scanning_vectors
# scanning_vectors = de.gen_scanning_vectors(M, x, y, self.DOA_theta)
@njit(fastmath=True, cache=True)
def DOA_plot_util(DOA_data, log_scale_min=-100):
"""
This function prepares the calulcated DoA estimation results for plotting.
- Noramlize DoA estimation results
- Changes to log scale
"""
DOA_data = np.divide(np.abs(DOA_data), np.max(np.abs(DOA_data))) # Normalization
DOA_data = 10*np.log10(DOA_data) # Change to logscale
for i in range(len(DOA_data)): # Remove extremely low values
if DOA_data[i] < log_scale_min:
DOA_data[i] = log_scale_min
return DOA_data
@njit(fastmath=True, cache=True)
def calculate_doa_papr(DOA_data):
return 10*np.log10(np.max(np.abs(DOA_data))/np.mean(np.abs(DOA_data)))
# Old time-domain squelch algorithm (Unused as freq domain FFT with overlaps gives significantly better sensitivity with acceptable time resolution expense
"""
K = 10
self.filtered_signal = self.raw_signal_amplitude #convolve(np.abs(self.raw_signal_amplitude),np.ones(K), mode = 'same')/K
# Burst is always started at the begining of the processed block, ensured by the squelch module in the DAQ FW
burst_stop_index = len(self.filtered_signal) # CARL FIX: Initialize this to the length of the signal, incase the signal is active the entire time
self.logger.info("Original burst stop index: {:d}".format(burst_stop_index))
min_burst_size = K
burst_stop_amp_val = 0
for n in np.arange(K, len(self.filtered_signal), 1):
if self.filtered_signal[n] < self.squelch_threshold:
burst_stop_amp_val = self.filtered_signal[n]
burst_stop_index = n
burst_stop_index-=K # Correction with the length of filter
break
#burst_stop_index-=K # Correction with the length of filter
self.logger.info("Burst stop index: {:d}".format(burst_stop_index))
self.logger.info("Burst stop ampl val: {:f}".format(burst_stop_amp_val))
self.logger.info("Processed signal length: {:d}".format(len(self.processed_signal[0,:])))
# If sign
if burst_stop_index < min_burst_size:
self.logger.debug("The length of the captured burst size is under the minimum: {:d}".format(burst_stop_index))
burst_stop_index = 0
if burst_stop_index !=0:
self.logger.info("INSIDE burst_stop_index != 0")
self.logger.debug("Burst stop index: {:d}".format(burst_stop_index))
self.logger.debug("Burst stop ampl val: {:f}".format(burst_stop_amp_val))
self.squelch_mask = np.zeros(len(self.filtered_signal))
self.squelch_mask[0 : burst_stop_index] = np.ones(burst_stop_index)*self.squelch_threshold
# Next line removes the end parts of the samples after where the signal ended, truncating the array
self.processed_signal = self.module_receiver.iq_samples[: burst_stop_index, self.squelch_mask == self.squelch_threshold]
self.logger.info("Raw signal length when burst_stop_index!=0: {:d}".format(len(self.module_receiver.iq_samples[0,:])))
self.logger.info("Processed signal length when burst_stop_index!=0: {:d}".format(len(self.processed_signal[0,:])))
#self.logger.info(' '.join(map(str, self.processed_signal)))
self.data_ready=True
else:
self.logger.info("Signal burst is not found, try to adjust the threshold levels")
#self.data_ready=True
self.squelch_mask = np.ones(len(self.filtered_signal))*self.squelch_threshold
self.processed_signal = np.zeros([self.channel_number, len(self.filtered_signal)])
"""

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

View File

@ -1,19 +0,0 @@
#!/bin/bash
IPADDR="0.0.0.0"
IPPORT="8081"
echo "Starting KrakenSDR Passive Radar"
# Use only for debugging
#sudo python3 _UI/_web_interface/kraken_web_interface.py 2> ui.log &
#sudo gunicorn -w 1 --threads 12 -b $IPADDR:8050 --chdir _UI/_web_interface kraken_web_interface:server 2> ui.log &
#sudo gunicorn -w 1 --threads 2 -b $IPADDR:8050 --chdir _UI/_web_interface kraken_web_interface:server 2> ui.log &
python3 _UI/_web_interface/kraken_web_interface.py 2> ui.log &
# Start PHP webserver to interface with Android devices
#echo "Python Server running at $IPADDR:8050"
#echo "PHP Server running at $IPADDR:$IPPORT"
#sudo php -S $IPADDR:$IPPORT -t _android_web 2> /dev/null &

View File

@ -1,5 +0,0 @@
#/bin/sh!
sudo kill $(ps ax | grep "[p]ython3 _UI/_web_interface/kraken_web_interface.py" | awk '{print $1}') 2> /dev/null
sudo kill $(ps ax | grep "[p]hp" | awk '{print $1}') 2> /dev/null
sudo pkill -f gunicorn

View File

@ -1,11 +0,0 @@
eval "$(conda shell.bash hook)"
conda activate kraken
./kraken_doa_stop.sh
cd heimdall_daq_fw/Firmware
#sudo ./daq_synthetic_start.sh
sudo env "PATH=$PATH" ./daq_start_sm.sh
sleep 2
cd ../../krakensdr_doa
sudo env "PATH=$PATH" ./gui_run.sh

View File

@ -1,5 +0,0 @@
cd heimdall_daq_fw/Firmware
./daq_stop.sh
cd ../../krakensdr_doa
./kill.sh

View File

@ -1 +0,0 @@
{"center_freq": 569.0, "uniform_gain": 7.7, "data_interface": "shmem", "default_ip": "0.0.0.0", "en_pr": true, "clutter_cancel_algo": "Wiener MRE", "max_bistatic_range": 128, "max_doppler": 256, "en_pr_persist": true, "pr_persist_decay": 0.99, "pr_dynrange_min": -20, "pr_dynrange_max": 10, "en_hw_check": 0, "en_advanced_daq_cfg": false, "logging_level": 5, "disable_tooltips": 0}

View File

@ -1 +0,0 @@
{"center_freq": 569.0, "uniform_gain": 7.7, "data_interface": "shmem", "default_ip": "0.0.0.0", "en_pr": true, "ant_arrangement": "UCA", "ant_spacing": 0.40399, "doa_method": "MUSIC", "en_fbavg": false, "compass_offset": 0, "doa_fig_type": "Linear plot", "en_squelch": false, "squelch_threshold_dB": -65, "en_hw_check": 0, "en_advanced_daq_cfg": [], "logging_level": 5, "disable_tooltips": 0}

View File

@ -1,18 +0,0 @@
#/bin/bash!
# PhP for android device support
sudo apt install php7.4-cli
echo "Set execution rights"
sudo chmod +x ../gui_run.sh
sudo chmod +x ../kill.sh
echo "Install dependencies"
python3 -m pip install numpy
python3 -m pip install scipy
python3 -m pip install pyargus
python3 -m pip install matplotlib
# For web interface
python3 -m pip install dash
python3 -m pip install dash-bootstrap-components
python3 -m pip install gunicorn