- Fix: avoid infinite loop on mulitcast read thread if no data to read
Pre-ci test passed git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4000 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -0,0 +1,340 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) 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
|
||||
this service 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 make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. 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.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
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
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the 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 a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE 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.
|
||||
|
||||
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
|
||||
convey 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 2 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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision 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, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This 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 Library General
|
||||
Public License instead of this License.
|
||||
@@ -0,0 +1,340 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) 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
|
||||
this service 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 make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. 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.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
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
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the 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 a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE 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.
|
||||
|
||||
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
|
||||
convey 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 2 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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision 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, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This 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 Library General
|
||||
Public License instead of this License.
|
||||
@@ -0,0 +1,8 @@
|
||||
ifeq ($(cygwin),0)
|
||||
ETHERNET_TRANSPORT_OBJS = $(TOP_DIR)/SIMULATION/ETH_TRANSPORT/netlink_init.o
|
||||
endif
|
||||
ETHERNET_TRANSPORT_OBJS += $(TOP_DIR)/SIMULATION/ETH_TRANSPORT/multicast_link.o
|
||||
ETHERNET_TRANSPORT_OBJS += $(TOP_DIR)/SIMULATION/ETH_TRANSPORT/socket.o
|
||||
ETHERNET_TRANSPORT_OBJS += $(TOP_DIR)/SIMULATION/ETH_TRANSPORT/bypass_session_layer.o
|
||||
ETHERNET_TRANSPORT_OBJS += $(TOP_DIR)/SIMULATION/ETH_TRANSPORT/emu_transport.o
|
||||
|
||||
@@ -0,0 +1,473 @@
|
||||
/*! \file bypass_session_layer.h
|
||||
* \brief implementation of emultor tx and rx
|
||||
* \author Navid Nikaein and Raymond Knopp
|
||||
* \date 2011
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
*/
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "defs.h"
|
||||
#include "extern.h"
|
||||
//#include "mac_extern.h"
|
||||
#include "UTIL/OCG/OCG.h"
|
||||
#include "UTIL/OCG/OCG_extern.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
|
||||
#ifdef USER_MODE
|
||||
#include "multicast_link.h"
|
||||
#endif
|
||||
|
||||
/***************************************************************************/
|
||||
char rx_bufferP[BYPASS_RX_BUFFER_SIZE];
|
||||
static unsigned int num_bytesP=0;
|
||||
int N_P=0,N_R=0;
|
||||
char bypass_tx_buffer[BYPASS_TX_BUFFER_SIZE];
|
||||
unsigned int Master_list_rx, Seq_nb;
|
||||
/***************************************************************************/
|
||||
mapping transport_names[] = {
|
||||
{"WAIT PM TRANSPORT INFO", WAIT_PM_TRANSPORT_INFO},
|
||||
{"WAIT SM TRANSPORT INFO", WAIT_SM_TRANSPORT_INFO},
|
||||
{"SYNC TRANSPORT INFO", SYNC_TRANSPORT_INFO},
|
||||
{"ENB_TRANSPORT INFO", ENB_TRANSPORT_INFO},
|
||||
{"UE TRANSPORT INFO", UE_TRANSPORT_INFO},
|
||||
{"RELEASE TRANSPORT INFO", RELEASE_TRANSPORT_INFO},
|
||||
{NULL, -1}
|
||||
};
|
||||
|
||||
void init_bypass (void){
|
||||
|
||||
msg ("[PHYSIM] INIT BYPASS\n");
|
||||
pthread_mutex_init (&Tx_mutex, NULL);
|
||||
pthread_cond_init (&Tx_cond, NULL);
|
||||
Tx_mutex_var = 1;
|
||||
pthread_mutex_init (&emul_low_mutex, NULL);
|
||||
pthread_cond_init (&emul_low_cond, NULL);
|
||||
emul_low_mutex_var = 1;
|
||||
bypass_init (emul_tx_handler, emul_rx_handler);
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
void bypass_init ( unsigned int (*tx_handlerP) (unsigned char,char*, unsigned int*, unsigned int*),unsigned int (*rx_handlerP) (unsigned char,char*,unsigned int)){
|
||||
/***************************************************************************/
|
||||
#ifdef USER_MODE
|
||||
multicast_link_start (bypass_rx_handler, oai_emulation.info.multicast_group, oai_emulation.info.multicast_ifname);
|
||||
#endif //USER_MODE
|
||||
tx_handler = tx_handlerP;
|
||||
rx_handler = rx_handlerP;
|
||||
Master_list_rx=0;
|
||||
emu_tx_status = WAIT_SYNC_TRANSPORT;
|
||||
emu_rx_status = WAIT_SYNC_TRANSPORT;
|
||||
}
|
||||
/***************************************************************************/
|
||||
int bypass_rx_data (unsigned int frame, unsigned int last_slot, unsigned int next_slot){
|
||||
/***************************************************************************/
|
||||
bypass_msg_header_t *messg;
|
||||
bypass_proto2multicast_header_t *bypass_read_header;
|
||||
eNB_transport_info_t *eNB_info;
|
||||
UE_transport_info_t *UE_info;
|
||||
int ue_info_ix, enb_info_ix;
|
||||
// int tmp_byte_count;
|
||||
int bytes_read = 0;
|
||||
int bytes_data_to_read;
|
||||
// int num_flows;
|
||||
// int current_flow;
|
||||
int m_id, n_enb, n_ue, n_dci, total_tbs=0, total_header=0;
|
||||
|
||||
// printf("in bypass_rx_data ...\n");
|
||||
|
||||
|
||||
pthread_mutex_lock(&emul_low_mutex);
|
||||
if(emul_low_mutex_var){
|
||||
//LOG_T(EMU, " WAIT BYPASS_PHY...\n");
|
||||
pthread_cond_wait(&emul_low_cond, &emul_low_mutex);
|
||||
}
|
||||
|
||||
if(num_bytesP==0){
|
||||
//msg("[BYPASS] IDLE_WAIT\n");
|
||||
//exit(0);
|
||||
pthread_mutex_unlock(&emul_low_mutex);
|
||||
}
|
||||
|
||||
else{
|
||||
//LOG_T(EMU,"BYPASS_RX_DATA: IN, Num_bytesp=%d...\n",num_bytesP);
|
||||
bypass_read_header = (bypass_proto2multicast_header_t *) (&rx_bufferP[bytes_read]);
|
||||
bytes_read += sizeof (bypass_proto2multicast_header_t);
|
||||
bytes_data_to_read = bypass_read_header->size;
|
||||
if(num_bytesP!=bytes_read+bytes_data_to_read) {
|
||||
LOG_W(EMU, "WARNINIG BYTES2READ # DELIVERED BYTES!!!\n");
|
||||
}
|
||||
else{
|
||||
messg = (bypass_msg_header_t *) (&rx_bufferP[bytes_read]);
|
||||
bytes_read += sizeof (bypass_msg_header_t);
|
||||
if ( (messg->frame != frame) || (messg->subframe != next_slot>>1) )
|
||||
LOG_W(EMU, "Received %s from master %d for (frame %d,subframe %d) currently (frame %d,subframe %d)\n",
|
||||
map_int_to_str(transport_names,messg->Message_type), messg->master_id,
|
||||
messg->frame, messg->subframe,
|
||||
frame, next_slot>>1);
|
||||
//chek if MASTER in my List
|
||||
// switch(Emulation_status){
|
||||
switch(messg->Message_type){
|
||||
//case WAIT_SYNC_TRANSPORT:
|
||||
|
||||
case WAIT_PM_TRANSPORT_INFO:
|
||||
if (messg->master_id==0 )
|
||||
Master_list_rx=((Master_list_rx) |(1<< messg->master_id));
|
||||
break;
|
||||
|
||||
case WAIT_SM_TRANSPORT_INFO:
|
||||
Master_list_rx=((Master_list_rx) |(1<< messg->master_id));
|
||||
break;
|
||||
case SYNC_TRANSPORT_INFO:
|
||||
|
||||
// determite the total number of remote enb & ue
|
||||
oai_emulation.info.nb_enb_remote += messg->nb_enb;
|
||||
oai_emulation.info.nb_ue_remote += messg->nb_ue;
|
||||
// determine the index of local enb and ue wrt the remote ones
|
||||
if ( messg->master_id < oai_emulation.info.master_id ){
|
||||
oai_emulation.info.first_enb_local +=messg->nb_enb;
|
||||
oai_emulation.info.first_ue_local +=messg->nb_ue;
|
||||
}
|
||||
|
||||
// store param for enb per master
|
||||
if ((oai_emulation.info.master[messg->master_id].nb_enb = messg->nb_enb) > 0 ){
|
||||
for (m_id=0;m_id < messg->master_id; m_id++ ){
|
||||
oai_emulation.info.master[messg->master_id].first_enb+=oai_emulation.info.master[m_id].nb_enb;
|
||||
}
|
||||
LOG_I(EMU, "[ENB] WAIT_SYNC_TRANSPORT state: for master %d (first enb %d, totan enb %d)\n",
|
||||
messg->master_id,
|
||||
oai_emulation.info.master[messg->master_id].first_enb,
|
||||
oai_emulation.info.master[messg->master_id].nb_enb);
|
||||
}
|
||||
// store param for ue per master
|
||||
if ((oai_emulation.info.master[messg->master_id].nb_ue = messg->nb_ue) > 0){
|
||||
for (m_id=0;m_id < messg->master_id; m_id++ ){
|
||||
oai_emulation.info.master[messg->master_id].first_ue+=oai_emulation.info.master[m_id].nb_ue;
|
||||
}
|
||||
LOG_I(EMU, "[UE]WAIT_SYNC_TRANSPORT state: for master %d (first ue %d, total ue%d)\n",
|
||||
messg->master_id,
|
||||
oai_emulation.info.master[messg->master_id].first_ue,
|
||||
oai_emulation.info.master[messg->master_id].nb_ue );
|
||||
}
|
||||
|
||||
Master_list_rx=((Master_list_rx) |(1<< messg->master_id));
|
||||
if (Master_list_rx == oai_emulation.info.master_list) {
|
||||
emu_rx_status = SYNCED_TRANSPORT;
|
||||
}
|
||||
LOG_I(EMU,"WAIT_SYNC_TRANSPORT state: m_id %d total enb remote %d total ue remote %d \n",
|
||||
messg->master_id,oai_emulation.info.nb_enb_remote, oai_emulation.info.nb_ue_remote );
|
||||
|
||||
break;
|
||||
|
||||
//case WAIT_ENB_TRANSPORT:
|
||||
case ENB_TRANSPORT_INFO:
|
||||
#ifdef DEBUG_EMU
|
||||
LOG_D(EMU," RX ENB_TRANSPORT INFO from master %d \n",messg->master_id);
|
||||
#endif
|
||||
clear_eNB_transport_info(oai_emulation.info.nb_enb_local+oai_emulation.info.nb_enb_remote);
|
||||
|
||||
if (oai_emulation.info.master[messg->master_id].nb_enb > 0 ){
|
||||
enb_info_ix =0;
|
||||
total_header=0;
|
||||
total_header += sizeof(eNB_transport_info_t)-MAX_TRANSPORT_BLOCKS_BUFFER_SIZE;
|
||||
|
||||
eNB_info = (eNB_transport_info_t *) (&rx_bufferP[bytes_read]);
|
||||
for (n_enb = oai_emulation.info.master[messg->master_id].first_enb;
|
||||
n_enb < oai_emulation.info.master[messg->master_id].first_enb+oai_emulation.info.master[messg->master_id].nb_enb ;
|
||||
n_enb ++) {
|
||||
total_tbs=0;
|
||||
for (n_dci = 0 ;
|
||||
n_dci < (eNB_info[enb_info_ix].num_ue_spec_dci+eNB_info[enb_info_ix].num_common_dci);
|
||||
n_dci ++) {
|
||||
total_tbs+=eNB_info[enb_info_ix].tbs[n_dci];
|
||||
}
|
||||
enb_info_ix++;
|
||||
if ( (total_tbs + total_header) > MAX_TRANSPORT_BLOCKS_BUFFER_SIZE ){
|
||||
LOG_W(EMU,"RX eNB Transport buffer total size %d (header%d,tbs %d) \n",
|
||||
total_header+total_tbs, total_header,total_tbs);
|
||||
}
|
||||
memcpy (&eNB_transport_info[n_enb],eNB_info, total_header+total_tbs);
|
||||
eNB_info = (eNB_transport_info_t *)((unsigned int)eNB_info + total_header+total_tbs);
|
||||
bytes_read+=total_header+total_tbs;
|
||||
}
|
||||
|
||||
for (n_enb = oai_emulation.info.master[messg->master_id].first_enb;
|
||||
n_enb < oai_emulation.info.master[messg->master_id].first_enb+oai_emulation.info.master[messg->master_id].nb_enb ;
|
||||
n_enb ++)
|
||||
fill_phy_enb_vars(n_enb,next_slot);
|
||||
}
|
||||
else{
|
||||
LOG_T(EMU,"WAIT_ENB_TRANSPORT state: no enb transport info from master %d \n", messg->master_id);
|
||||
}
|
||||
|
||||
Master_list_rx=((Master_list_rx) |(1<< messg->master_id));
|
||||
if (Master_list_rx == oai_emulation.info.master_list) {
|
||||
emu_rx_status = SYNCED_TRANSPORT;
|
||||
}
|
||||
break;
|
||||
|
||||
case UE_TRANSPORT_INFO:
|
||||
#ifdef DEBUG_EMU
|
||||
LOG_D(EMU," RX UE TRANSPORT INFO from master %d\n",messg->master_id);
|
||||
#endif
|
||||
clear_UE_transport_info(oai_emulation.info.nb_ue_local+oai_emulation.info.nb_ue_remote);
|
||||
|
||||
|
||||
if (oai_emulation.info.master[messg->master_id].nb_ue > 0 ){ //&& oai_emulation.info.nb_enb_local >0 ){
|
||||
// get the header first
|
||||
ue_info_ix =0;
|
||||
total_header=0;
|
||||
total_header += sizeof(UE_transport_info_t)-MAX_TRANSPORT_BLOCKS_BUFFER_SIZE;
|
||||
UE_info = (UE_transport_info_t *) (&rx_bufferP[bytes_read]);
|
||||
// get the total size of the transport blocks
|
||||
for (n_ue = oai_emulation.info.master[messg->master_id].first_ue;
|
||||
n_ue < oai_emulation.info.master[messg->master_id].first_ue+oai_emulation.info.master[messg->master_id].nb_ue ;
|
||||
n_ue ++) {
|
||||
total_tbs=0;
|
||||
for (n_enb = 0;n_enb < UE_info[ue_info_ix].num_eNB; n_enb ++) {
|
||||
total_tbs+=UE_info[ue_info_ix].tbs[n_enb];
|
||||
}
|
||||
ue_info_ix++;
|
||||
if (total_tbs + total_header > MAX_TRANSPORT_BLOCKS_BUFFER_SIZE ){
|
||||
LOG_W(EMU,"RX [UE %d] Total size of buffer is %d (header%d,tbs %d) \n",
|
||||
n_ue, total_header+total_tbs,total_header,total_tbs);
|
||||
}
|
||||
memcpy (&UE_transport_info[n_ue], UE_info, total_header+total_tbs);
|
||||
UE_info = (UE_transport_info_t *)((unsigned int)UE_info + total_header+total_tbs);
|
||||
bytes_read+=total_header+total_tbs;
|
||||
}
|
||||
#ifdef DEBUG_EMU
|
||||
for (n_enb=0; n_enb < UE_info[0].num_eNB; n_enb ++ )
|
||||
LOG_T(EMU,"dump ue transport info rnti %x enb_id %d, harq_id %d tbs %d\n",
|
||||
UE_transport_info[0].rnti[n_enb],
|
||||
UE_transport_info[0].eNB_id[n_enb],
|
||||
UE_transport_info[0].harq_pid[n_enb],
|
||||
UE_transport_info[0].tbs[n_enb]);
|
||||
#endif
|
||||
for (n_ue = oai_emulation.info.master[messg->master_id].first_ue;
|
||||
n_ue < oai_emulation.info.master[messg->master_id].first_ue + oai_emulation.info.master[messg->master_id].nb_ue ;
|
||||
n_ue ++) {
|
||||
fill_phy_ue_vars(n_ue,last_slot);
|
||||
}
|
||||
}
|
||||
else{
|
||||
LOG_T(EMU,"WAIT_UE_TRANSPORT state: no UE transport info from master %d\n", messg->master_id );
|
||||
}
|
||||
|
||||
Master_list_rx=((Master_list_rx) |(1<< messg->master_id));
|
||||
if (Master_list_rx == oai_emulation.info.master_list) {
|
||||
emu_rx_status = SYNCED_TRANSPORT;
|
||||
}
|
||||
break;
|
||||
case RELEASE_TRANSPORT_INFO :
|
||||
Master_list_rx = oai_emulation.info.master_list;
|
||||
LOG_E(EMU, "RX RELEASE_TRANSPORT_INFO\n");
|
||||
break;
|
||||
default:
|
||||
msg("[MAC][BYPASS] ERROR RX UNKNOWN MESSAGE\n");
|
||||
//mac_xface->macphy_exit("");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
num_bytesP=0;
|
||||
emul_low_mutex_var=1;
|
||||
//msg("[BYPASS] CALLING_SIGNAL_HIGH_MAC\n");
|
||||
pthread_cond_signal(&emul_low_cond);
|
||||
pthread_mutex_unlock(&emul_low_mutex);
|
||||
bypass_signal_mac_phy(frame,last_slot, next_slot);
|
||||
|
||||
|
||||
}
|
||||
|
||||
//printf("leaving ...\n");
|
||||
return bytes_read;
|
||||
}
|
||||
|
||||
/******************************************************************************************************/
|
||||
#ifndef USER_MODE
|
||||
int bypass_rx_handler(unsigned int fifo, int rw){
|
||||
/******************************************************************************************************/
|
||||
// if(rw=='w'){
|
||||
int bytes_read;
|
||||
int bytes_processed=0;
|
||||
int header_bytes; //, elapsed_time;
|
||||
//printk("[BYPASS] BYPASS_RX_HANDLER IN...\n");
|
||||
header_bytes= rtf_get(fifo_bypass_phy_user2kern, rx_bufferP,sizeof(bypass_proto2multicast_header_t) );
|
||||
if (header_bytes> 0) {
|
||||
bytes_read = rtf_get(fifo_bypass_phy_user2kern, &rx_bufferP[header_bytes],((bypass_proto2multicast_header_t *) (&rx_bufferP[0]))->size);
|
||||
// printk("BYTES_READ=%d\n",bytes_read);
|
||||
if (bytes_read > 0) {
|
||||
num_bytesP=header_bytes+bytes_read;
|
||||
emul_low_mutex_var=0;
|
||||
//printk("BYPASS_PHY SIGNAL MAC_LOW...\n");
|
||||
pthread_cond_signal(&emul_low_cond);
|
||||
}
|
||||
}
|
||||
// }
|
||||
return 0;
|
||||
}
|
||||
#else //USER_MODE
|
||||
/******************************************************************************************************/
|
||||
void bypass_rx_handler(unsigned int Num_bytes,char *Rx_buffer){
|
||||
/******************************************************************************************************/
|
||||
// msg("[BYPASS] BYPASS RX_HANDLER IN ...\n");
|
||||
if(Num_bytes >0){
|
||||
pthread_mutex_lock(&emul_low_mutex);
|
||||
while(!emul_low_mutex_var){
|
||||
// msg("[BYPASS] BYPASS: WAIT MAC_LOW...\n");
|
||||
pthread_cond_wait(&emul_low_cond, &emul_low_mutex);
|
||||
}
|
||||
num_bytesP=Num_bytes;
|
||||
memcpy(rx_bufferP,Rx_buffer,Num_bytes);
|
||||
emul_low_mutex_var=0;
|
||||
//msg("[BYPASS] RX_HANDLER SIGNAL MAC_LOW\n");
|
||||
pthread_cond_signal(&emul_low_cond); //on ne peut que signaler depuis un context linux (rtf_handler); pas de wait, jamais!!!!!!
|
||||
pthread_mutex_unlock(&emul_low_mutex);
|
||||
}
|
||||
}
|
||||
#endif //USER_MODE
|
||||
|
||||
/******************************************************************************************************/
|
||||
void bypass_signal_mac_phy(unsigned int frame, unsigned int last_slot, unsigned int next_slot){
|
||||
/******************************************************************************************************/
|
||||
// char tt=1;
|
||||
|
||||
if(Master_list_rx != oai_emulation.info.master_list){
|
||||
#ifndef USER_MODE
|
||||
rtf_put(fifo_mac_bypass,&tt,1); // the Rx window is still opened (Re)signal bypass_phy (emulate MAC signal)
|
||||
#endif //USER_MODE
|
||||
bypass_rx_data(frame,last_slot, next_slot);
|
||||
}
|
||||
else Master_list_rx=0;
|
||||
}
|
||||
|
||||
#ifndef USER_MODE
|
||||
/***************************************************************************/
|
||||
int multicast_link_write_sock (int groupP, char *dataP, unsigned int sizeP){
|
||||
/***************************************************************************/
|
||||
int tx_bytes=0;
|
||||
|
||||
pthread_mutex_lock(&Tx_mutex);
|
||||
while(!Tx_mutex_var){
|
||||
//msg("[BYPASS]RG WAIT USER_SPACE FIFO SIGNAL..\n");
|
||||
pthread_cond_wait(&Tx_cond,&Tx_mutex);
|
||||
}
|
||||
Tx_mutex_var=0;
|
||||
N_P=(int)((sizeP-sizeof (bypass_proto2multicast_header_t))/1000)+2;
|
||||
tx_bytes += rtf_put (fifo_bypass_phy_kern2user, &dataP[tx_bytes],sizeof (bypass_proto2multicast_header_t));
|
||||
while(tx_bytes<sizeP){
|
||||
if(sizeP-tx_bytes<=1000)
|
||||
tx_bytes += rtf_put (fifo_bypass_phy_kern2user, &dataP[tx_bytes],sizeP-tx_bytes);
|
||||
else
|
||||
tx_bytes += rtf_put (fifo_bypass_phy_kern2user, &dataP[tx_bytes],1000);
|
||||
}
|
||||
//RG_tx_mutex_var=0;
|
||||
pthread_mutex_unlock(&Tx_mutex);
|
||||
|
||||
return tx_bytes;
|
||||
}
|
||||
#endif
|
||||
|
||||
/***************************************************************************/
|
||||
void bypass_tx_data(char Type, unsigned int frame, unsigned int next_slot){
|
||||
/***************************************************************************/
|
||||
unsigned int num_flows;
|
||||
bypass_msg_header_t *messg;
|
||||
unsigned int byte_tx_count;
|
||||
// eNB_transport_info_t *eNB_info;
|
||||
int n_enb,n_ue, n_dci,total_tbs=0,total_size=0;
|
||||
messg = (bypass_msg_header_t *) (&bypass_tx_buffer[sizeof (bypass_proto2multicast_header_t)]);
|
||||
num_flows = 0;
|
||||
messg->master_id = oai_emulation.info.master_id; //Master_id;
|
||||
// messg->nb_master = oai_emulation.info.nb_master;
|
||||
messg->nb_enb = oai_emulation.info.nb_enb_local; //Master_id;
|
||||
messg->nb_ue = oai_emulation.info.nb_ue_local; //Master_id;
|
||||
messg->nb_flow = num_flows;
|
||||
messg->frame = frame;
|
||||
messg->subframe = next_slot>>1;
|
||||
|
||||
byte_tx_count = sizeof (bypass_msg_header_t) + sizeof (bypass_proto2multicast_header_t);
|
||||
|
||||
if(Type==WAIT_PM_TRANSPORT){
|
||||
messg->Message_type = WAIT_PM_TRANSPORT_INFO;
|
||||
LOG_T(EMU,"[TX_DATA] WAIT SYNC PM TRANSPORT\n");
|
||||
}
|
||||
else if(Type==WAIT_SM_TRANSPORT){
|
||||
messg->Message_type = WAIT_SM_TRANSPORT_INFO;
|
||||
LOG_T(EMU,"[TX_DATA] WAIT SYNC SM TRANSPORT\n");
|
||||
}
|
||||
else if(Type==SYNC_TRANSPORT){
|
||||
messg->Message_type = SYNC_TRANSPORT_INFO;
|
||||
// make sure that sync messages from the masters are received in increasing order of master id
|
||||
sleep(oai_emulation.info.master_id+1);
|
||||
LOG_T(EMU,"[TX_DATA] SYNC TRANSPORT\n");
|
||||
}
|
||||
else if(Type==ENB_TRANSPORT){
|
||||
LOG_D(EMU,"[TX_DATA] ENB TRANSPORT\n");
|
||||
messg->Message_type = ENB_TRANSPORT_INFO;
|
||||
total_size=0;
|
||||
total_tbs=0;
|
||||
for (n_enb=oai_emulation.info.first_enb_local;n_enb<(oai_emulation.info.first_enb_local+oai_emulation.info.nb_enb_local);n_enb++) {
|
||||
total_tbs=0;
|
||||
for (n_dci =0 ;
|
||||
n_dci < (eNB_transport_info[n_enb].num_ue_spec_dci+ eNB_transport_info[n_enb].num_common_dci);
|
||||
n_dci++) {
|
||||
total_tbs +=eNB_transport_info[n_enb].tbs[n_dci];
|
||||
}
|
||||
if (total_tbs <= MAX_TRANSPORT_BLOCKS_BUFFER_SIZE)
|
||||
total_size = sizeof(eNB_transport_info_t)+total_tbs-MAX_TRANSPORT_BLOCKS_BUFFER_SIZE;
|
||||
else
|
||||
LOG_E(EMU,"[eNB]running out of memory for the eNB emulation transport buffer of size %d\n", MAX_TRANSPORT_BLOCKS_BUFFER_SIZE);
|
||||
memcpy(&bypass_tx_buffer[byte_tx_count], (char*)&eNB_transport_info[n_enb], total_size);
|
||||
byte_tx_count +=total_size;
|
||||
}
|
||||
}
|
||||
else if (Type == UE_TRANSPORT){
|
||||
LOG_D(EMU,"[TX_DATA] UE TRANSPORT\n");
|
||||
messg->Message_type = UE_TRANSPORT_INFO;
|
||||
total_size=0;
|
||||
total_tbs=0; // compute the actual size of transport_blocks
|
||||
for (n_ue = oai_emulation.info.first_ue_local; n_ue < (oai_emulation.info.first_ue_local+oai_emulation.info.nb_ue_local);n_ue++){
|
||||
for (n_enb=0;n_enb<UE_transport_info[n_ue].num_eNB;n_enb++) {
|
||||
total_tbs+=UE_transport_info[n_ue].tbs[n_enb];
|
||||
}
|
||||
if (total_tbs <= MAX_TRANSPORT_BLOCKS_BUFFER_SIZE)
|
||||
total_size = sizeof(UE_transport_info_t)+total_tbs-MAX_TRANSPORT_BLOCKS_BUFFER_SIZE;
|
||||
else
|
||||
LOG_E(EMU,"[UE]running out of memory for the UE emulation transport buffer of size %d\n", MAX_TRANSPORT_BLOCKS_BUFFER_SIZE);
|
||||
memcpy(&bypass_tx_buffer[byte_tx_count], (char*)&UE_transport_info[n_ue], total_size);
|
||||
byte_tx_count +=total_size;
|
||||
}
|
||||
}
|
||||
else if (Type == RELEASE_TRANSPORT){
|
||||
messg->Message_type = RELEASE_TRANSPORT_INFO;
|
||||
}else {
|
||||
LOG_T(EMU,"[TX_DATA] UNKNOWN MSG \n");
|
||||
}
|
||||
|
||||
((bypass_proto2multicast_header_t *) bypass_tx_buffer)->size = byte_tx_count - sizeof (bypass_proto2multicast_header_t);
|
||||
//if(mac_xface->frame%1000==0)
|
||||
multicast_link_write_sock (oai_emulation.info.multicast_group, bypass_tx_buffer, byte_tx_count);
|
||||
}
|
||||
|
||||
#ifndef USER_MODE
|
||||
/*********************************************************************************************************************/
|
||||
int bypass_tx_handler(unsigned int fifo, int rw){
|
||||
/***************************************************************************/
|
||||
// if(rw=='r'){
|
||||
if(++N_R==N_P){
|
||||
//msg("[OPENAIR][RG_BYPASS] TX_handler..\n");
|
||||
// pthread_mutex_lock(&RG_tx_mutex);
|
||||
rtf_reset(fifo_bypass_phy_kern2user);
|
||||
// pthread_mutex_lock(&RG_tx_mutex);
|
||||
Tx_mutex_var=1;
|
||||
N_R=0;
|
||||
// pthread_mutex_unlock(&RG_tx_mutex);
|
||||
pthread_cond_signal(&Tx_cond);
|
||||
}
|
||||
// }
|
||||
}
|
||||
#endif
|
||||
|
||||
Executable
+166
@@ -0,0 +1,166 @@
|
||||
/*! \file phy_emulation.h
|
||||
* \brief specifies the data structure and variable for phy emulation
|
||||
* \author Navid Nikaein, Raymomd Knopp and Hicham Anouar
|
||||
* \date 2011
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
*/
|
||||
|
||||
|
||||
//#include "SCHED/defs.h"
|
||||
#include "proto.h"
|
||||
//#include "UTIL/OCG/OCG.h"
|
||||
|
||||
|
||||
#ifndef __BYPASS_SESSION_LAYER_DEFS_H__
|
||||
# define __BYPASS_SESSION_LAYER_DEFS_H__
|
||||
//-----------------------------------------------------------------------------
|
||||
//#include "openair_defs.h"
|
||||
|
||||
#define WAIT_PM_TRANSPORT_INFO 0x1
|
||||
#define WAIT_SM_TRANSPORT_INFO 0x2
|
||||
#define SYNC_TRANSPORT_INFO 0x3
|
||||
#define ENB_TRANSPORT_INFO 0X4
|
||||
#define UE_TRANSPORT_INFO 0X5
|
||||
#define RELEASE_TRANSPORT_INFO 0x6
|
||||
|
||||
#define WAIT_PM_TRANSPORT 1
|
||||
#define WAIT_SM_TRANSPORT 2
|
||||
#define SYNC_TRANSPORT 3
|
||||
#define ENB_TRANSPORT 4
|
||||
#define UE_TRANSPORT 5
|
||||
#define RELEASE_TRANSPORT 6
|
||||
|
||||
#define WAIT_SYNC_TRANSPORT 1
|
||||
#define SYNCED_TRANSPORT 2
|
||||
//#define WAIT_ENB_TRANSPORT 2
|
||||
//#define WAIT_UE_TRANSPORT 3
|
||||
|
||||
|
||||
#define BYPASS_RX_BUFFER_SIZE 64000
|
||||
#define BYPASS_TX_BUFFER_SIZE 64000
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
|
||||
typedef struct {
|
||||
u32 pbch_flag:1;
|
||||
u32 pss:2;
|
||||
u32 sss:8;
|
||||
u32 cfi:2;
|
||||
u32 phich:19; // max 200 bit
|
||||
// u32 pbch_payload:24;
|
||||
u32 pbch_payload;
|
||||
} eNB_cntl;
|
||||
|
||||
typedef struct {
|
||||
u8 pucch_flag:3; // 0,7 = none, 1 = type 1, 2=type 1a, 3=type 1b, 4=type 2, 5=type 2a, 6=type 2b
|
||||
u8 pucch_Ncs1:3; // physical configuration of pucch, for abstraction purposes
|
||||
u32 pucch_payload:21; // ack/nak/cqi information
|
||||
u8 sr:1;
|
||||
u8 pusch_flag:1; // 0=none,1=active
|
||||
u8 pucch_sel:1;
|
||||
//u32 pusch_uci; // uci information on pusch
|
||||
u8 pusch_uci[MAX_CQI_BYTES];
|
||||
u8 uci_format;
|
||||
u8 length_uci;
|
||||
u8 pusch_ri:2; // ri information on pusch
|
||||
u8 pusch_ack:2; // ack/nak on pusch
|
||||
u8 prach_flag:1; // 0=none,1=active
|
||||
u8 prach_id:6; // this is the PHY preamble index for the prach
|
||||
} UE_cntl;
|
||||
#define MAX_TRANSPORT_BLOCKS_BUFFER_SIZE 16384
|
||||
#define MAX_NUM_DCI 5
|
||||
typedef struct {
|
||||
eNB_cntl cntl;
|
||||
u8 num_common_dci;
|
||||
u8 num_ue_spec_dci;
|
||||
DCI_ALLOC_t dci_alloc[MAX_NUM_DCI];
|
||||
u8 dlsch_type[MAX_NUM_DCI];
|
||||
u8 harq_pid[MAX_NUM_DCI];
|
||||
u8 ue_id[MAX_NUM_DCI];
|
||||
u16 tbs[MAX_NUM_DCI*2]; // times 2 for dual-stream MIMO formats
|
||||
u8 transport_blocks[MAX_TRANSPORT_BLOCKS_BUFFER_SIZE];
|
||||
} __attribute__ ((__packed__)) eNB_transport_info_t ;
|
||||
|
||||
/*typedef struct {
|
||||
eNB_cntl cntl;
|
||||
u8 num_common_dci;
|
||||
u8 num_ue_spec_dci;
|
||||
DCI_ALLOC_t dci_alloc;
|
||||
u8 dlsch_info[6*MAX_NUM_DCI + MAX_TRANSPORT_BLOCKS_BUFFER_SIZE];
|
||||
} eNB_transport_info_rx_t ;
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
UE_cntl cntl;
|
||||
u8 num_eNB;
|
||||
u16 rnti[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
u8 eNB_id[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
u8 harq_pid[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
u16 tbs[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
u8 transport_blocks[MAX_TRANSPORT_BLOCKS_BUFFER_SIZE];//*NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
} __attribute__ ((__packed__)) UE_transport_info_t ;
|
||||
|
||||
/*! \brief */
|
||||
typedef struct bypass_msg_header {
|
||||
unsigned char Message_type; /*! \brief control or data*/
|
||||
//unsigned char nb_master; /*! \brief */
|
||||
unsigned char master_id; /*! \brief */
|
||||
unsigned int nb_enb; /*! \brief */
|
||||
unsigned int nb_ue; /*! \brief */
|
||||
unsigned int nb_flow; /*! \brief */
|
||||
unsigned int frame;
|
||||
unsigned int subframe;
|
||||
}__attribute__ ((__packed__)) bypass_msg_header_t;
|
||||
|
||||
typedef struct bypass_proto2multicast_header_t {
|
||||
unsigned int size;
|
||||
} bypass_proto2multicast_header_t;
|
||||
|
||||
|
||||
/* // replaced to OCG.h
|
||||
#define NUMBER_OF_MASTER_MAX 20
|
||||
//#define NUMBER_OF_UE_MAX 32
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned char nb_ue;
|
||||
unsigned char first_ue;
|
||||
unsigned char nb_enb;
|
||||
unsigned char first_enb;
|
||||
}master_info_t;
|
||||
|
||||
typedef struct {
|
||||
master_info_t master[NUMBER_OF_MASTER_MAX];
|
||||
unsigned char nb_ue_local;
|
||||
unsigned char nb_ue_remote;
|
||||
unsigned char nb_enb_local;
|
||||
unsigned char nb_enb_remote;
|
||||
unsigned char first_enb_local;
|
||||
unsigned char first_ue_local;
|
||||
unsigned short master_id;
|
||||
unsigned char nb_master;
|
||||
unsigned int master_list;
|
||||
unsigned int is_primary_master;
|
||||
unsigned int ethernet_flag;
|
||||
char local_server[128]; // for the oaisim -c option : 0 = EURECOM web portal; -1 = local; 1 - N or filename = running a specific XML configuration file
|
||||
unsigned int offset_ue_inst;
|
||||
unsigned char multicast_group;
|
||||
unsigned char ocg_enabled;
|
||||
unsigned char opt_enabled;
|
||||
unsigned char otg_enabled;
|
||||
unsigned char omg_model_enb;
|
||||
unsigned char omg_model_ue;
|
||||
unsigned int seed;
|
||||
double time;
|
||||
|
||||
}emu_info_t;
|
||||
*/
|
||||
|
||||
|
||||
#endif //
|
||||
|
||||
|
||||
@@ -0,0 +1,397 @@
|
||||
/*! \file phy_emulation.c
|
||||
* \brief implements the underlying protocol for emulated data exchange over Ethernet using IP multicast
|
||||
* \author Navid Nikaein
|
||||
* \date 2011
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
*/
|
||||
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "defs.h"
|
||||
#include "extern.h"
|
||||
#include "UTIL/OCG/OCG.h"
|
||||
#include "UTIL/OCG/OCG_extern.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
|
||||
extern unsigned int Master_list_rx;
|
||||
//extern unsigned short NODE_ID[1];
|
||||
extern unsigned char NB_INST;
|
||||
//#define DEBUG_CONTROL 1
|
||||
//#define DEBUG_EMU 1
|
||||
/*
|
||||
char is_node_local_neighbor(unsigned short Node_id){
|
||||
int i;
|
||||
for(i=0;i<NB_INST;i++)
|
||||
if(NODE_ID[i]==Node_id) return 1;
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
void emu_transport_sync(void){
|
||||
|
||||
if (oai_emulation.info.is_primary_master==0){
|
||||
|
||||
bypass_tx_data(WAIT_SM_TRANSPORT,0,0);
|
||||
Master_list_rx=oai_emulation.info.master_list-1; // just wait to recieve the master 0 msg
|
||||
bypass_rx_data(0,0,0);
|
||||
}
|
||||
else {
|
||||
bypass_rx_data(0,0,0);
|
||||
bypass_tx_data(WAIT_PM_TRANSPORT,0,0);
|
||||
}
|
||||
|
||||
if (oai_emulation.info.master_list!=0){
|
||||
|
||||
bypass_tx_data(SYNC_TRANSPORT,0,0);
|
||||
bypass_rx_data(0,0,0);
|
||||
|
||||
if (emu_rx_status == SYNCED_TRANSPORT){ // i received the sync from all secondary masters
|
||||
emu_tx_status = SYNCED_TRANSPORT;
|
||||
}
|
||||
// else emu_transport_sync(last_slot);
|
||||
LOG_D(EMU,"TX secondary master SYNC_TRANSPORT state \n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void emu_transport(unsigned int frame, unsigned int last_slot, unsigned int next_slot,lte_subframe_t direction, unsigned char frame_type, int ethernet_flag ){
|
||||
|
||||
if (ethernet_flag == 0)
|
||||
return;
|
||||
|
||||
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_EMU_TRANSPORT, VCD_FUNCTION_IN);
|
||||
|
||||
if ((frame_type == 1) && (direction == SF_S)){
|
||||
if (next_slot%2==0)
|
||||
emu_transport_DL(frame, last_slot,next_slot);
|
||||
else
|
||||
emu_transport_UL(frame, last_slot , next_slot);
|
||||
//DL
|
||||
}else {
|
||||
if (next_slot%2 == 0 )
|
||||
if ( ((frame_type == 1) && (direction == SF_DL )) || (frame_type == 0) ){
|
||||
emu_transport_DL(frame, last_slot,next_slot);
|
||||
}
|
||||
// UL
|
||||
if ( ((frame_type == 1) && (direction == SF_UL)) || (frame_type == 0) ){
|
||||
emu_transport_UL(frame, last_slot , next_slot);
|
||||
}
|
||||
|
||||
}
|
||||
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_EMU_TRANSPORT, VCD_FUNCTION_OUT);
|
||||
}
|
||||
|
||||
|
||||
void emu_transport_DL(unsigned int frame, unsigned int last_slot, unsigned int next_slot) {
|
||||
|
||||
if (oai_emulation.info.is_primary_master==0){
|
||||
// bypass_rx_data(last_slot);
|
||||
if (oai_emulation.info.nb_enb_local>0) // send in DL if
|
||||
bypass_tx_data(ENB_TRANSPORT,frame, next_slot);
|
||||
else
|
||||
bypass_tx_data(WAIT_SM_TRANSPORT,frame,next_slot);
|
||||
|
||||
bypass_rx_data(frame, last_slot, next_slot);
|
||||
}
|
||||
else { // I am the master
|
||||
// bypass_tx_data(WAIT_TRANSPORT,last_slot);
|
||||
|
||||
if (oai_emulation.info.nb_enb_local>0) // send in DL if
|
||||
bypass_tx_data(ENB_TRANSPORT,frame, next_slot);
|
||||
else
|
||||
bypass_tx_data(WAIT_SM_TRANSPORT,frame, next_slot);
|
||||
|
||||
bypass_rx_data(frame,last_slot, next_slot);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void emu_transport_UL(unsigned int frame, unsigned int last_slot, unsigned int next_slot) {
|
||||
|
||||
|
||||
if (oai_emulation.info.is_primary_master==0){
|
||||
// bypass_rx_data(last_slot, next_slot);
|
||||
if (oai_emulation.info.nb_ue_local>0)
|
||||
bypass_tx_data(UE_TRANSPORT,frame, next_slot);
|
||||
else
|
||||
bypass_tx_data(WAIT_SM_TRANSPORT,frame, next_slot);
|
||||
|
||||
bypass_rx_data(frame,last_slot, next_slot);
|
||||
}
|
||||
else {
|
||||
// bypass_tx_data(WAIT_TRANSPORT,last_slot);
|
||||
if (oai_emulation.info.nb_ue_local>0)
|
||||
bypass_tx_data(UE_TRANSPORT,frame, next_slot);
|
||||
else
|
||||
bypass_tx_data(WAIT_SM_TRANSPORT,frame, next_slot);
|
||||
|
||||
bypass_rx_data(frame,last_slot, next_slot);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void emu_transport_release(void){
|
||||
bypass_tx_data(RELEASE_TRANSPORT,0,0);
|
||||
LOG_E(EMU," tx RELEASE_TRANSPORT \n");
|
||||
}
|
||||
|
||||
unsigned int emul_tx_handler(unsigned char Mode,char *Tx_buffer,unsigned int* Nbytes,unsigned int *Nb_flows){
|
||||
unsigned short k,Mod_id;
|
||||
|
||||
for(k=0;k<NB_INST;k++){//Nb_out_src[Mode];k++){
|
||||
Mod_id=k;//Out_list[Mode][k];
|
||||
}
|
||||
return *Nbytes;
|
||||
}
|
||||
|
||||
unsigned int emul_rx_data(void){
|
||||
return(0);
|
||||
}
|
||||
|
||||
unsigned int emul_rx_handler(unsigned char Mode,char *rx_buffer, unsigned int Nbytes){
|
||||
unsigned short Rx_size=0;
|
||||
return (Rx_size+2);
|
||||
}
|
||||
|
||||
void clear_eNB_transport_info(u8 nb_eNB) {
|
||||
u8 eNB_id;
|
||||
|
||||
for (eNB_id=0;eNB_id<nb_eNB;eNB_id++) {
|
||||
eNB_transport_info_TB_index[eNB_id]=0;
|
||||
memset((void *)&eNB_transport_info[eNB_id].cntl,0,sizeof(eNB_cntl));
|
||||
eNB_transport_info[eNB_id].num_common_dci=0;
|
||||
eNB_transport_info[eNB_id].num_ue_spec_dci=0;
|
||||
}
|
||||
// LOG_T(EMU, "EMUL clear_eNB_transport_info\n");
|
||||
}
|
||||
|
||||
void clear_UE_transport_info(u8 nb_UE) {
|
||||
u8 UE_id;
|
||||
|
||||
for (UE_id=0;UE_id<nb_UE;UE_id++) {
|
||||
UE_transport_info_TB_index[UE_id]=0;
|
||||
memset((void *)&UE_transport_info[UE_id].cntl,0,sizeof(UE_cntl));
|
||||
}
|
||||
// LOG_T(EMU, "EMUL clear_UE_transport_info\n");
|
||||
}
|
||||
|
||||
|
||||
void fill_phy_enb_vars(unsigned int enb_id, unsigned int next_slot) {
|
||||
|
||||
int n_dci=0, n_dci_dl;
|
||||
int payload_offset = 0;
|
||||
unsigned int harq_pid;
|
||||
LTE_eNB_DLSCH_t *dlsch_eNB;
|
||||
unsigned short ue_id;
|
||||
u8 nb_total_dci;
|
||||
|
||||
#ifdef DEBUG_EMU
|
||||
LOG_D(EMU," pbch fill phy eNB %d vars for slot %d \n",enb_id, next_slot);
|
||||
#endif
|
||||
// eNB
|
||||
// PBCH : copy payload
|
||||
|
||||
//if (next_slot == 2){
|
||||
*(u32*)PHY_vars_eNB_g[enb_id]->pbch_pdu = eNB_transport_info[enb_id].cntl.pbch_payload;
|
||||
/* LOG_I(EMU," RX slot %d ENB TRANSPORT pbch payload %d pdu[0] %d pdu[0] %d \n",
|
||||
next_slot ,
|
||||
eNB_transport_info[enb_id].cntl.pbch_payload,
|
||||
((u8*)PHY_vars_eNB_g[enb_id]->pbch_pdu)[0],
|
||||
((u8*)PHY_vars_eNB_g[enb_id]->pbch_pdu)[1]);
|
||||
*/
|
||||
// }
|
||||
//CFI
|
||||
// not needed yet
|
||||
|
||||
//PHICH
|
||||
// to be added later
|
||||
|
||||
//DCI
|
||||
nb_total_dci= eNB_transport_info[enb_id].num_ue_spec_dci+ eNB_transport_info[enb_id].num_common_dci;
|
||||
PHY_vars_eNB_g[enb_id]->num_ue_spec_dci[(next_slot>>1)&1] = eNB_transport_info[enb_id].num_ue_spec_dci;
|
||||
PHY_vars_eNB_g[enb_id]->num_common_dci[(next_slot>>1)&1] = eNB_transport_info[enb_id].num_common_dci;
|
||||
|
||||
if (nb_total_dci >0) {
|
||||
|
||||
memcpy(PHY_vars_eNB_g[enb_id]->dci_alloc[(next_slot>>1)&1],
|
||||
&eNB_transport_info[enb_id].dci_alloc,
|
||||
(nb_total_dci)* sizeof(DCI_ALLOC_t));
|
||||
|
||||
|
||||
n_dci_dl=0;
|
||||
// fill dlsch_eNB structure from DCI
|
||||
for (n_dci =0 ;
|
||||
n_dci < nb_total_dci;
|
||||
n_dci++) {
|
||||
|
||||
if (eNB_transport_info[enb_id].dci_alloc[n_dci_dl].format > 0){ //exclude ul dci
|
||||
#ifdef DEBUG_EMU
|
||||
LOG_D(EMU, "dci spec %d common %d tbs is %d payload offset %d\n",
|
||||
eNB_transport_info[enb_id].num_ue_spec_dci,
|
||||
eNB_transport_info[enb_id].num_common_dci,
|
||||
eNB_transport_info[enb_id].tbs[n_dci_dl],
|
||||
payload_offset);
|
||||
#endif
|
||||
switch (eNB_transport_info[enb_id].dlsch_type[n_dci_dl]) {
|
||||
|
||||
case 0: //SI:
|
||||
|
||||
memcpy(PHY_vars_eNB_g[enb_id]->dlsch_eNB_SI->harq_processes[0]->b,
|
||||
&eNB_transport_info[enb_id].transport_blocks[payload_offset],
|
||||
eNB_transport_info[enb_id].tbs[n_dci_dl]);
|
||||
#ifdef DEBUG_EMU
|
||||
LOG_D(EMU, "SI eNB_transport_info[enb_id].tbs[n_dci_dl]%d \n", eNB_transport_info[enb_id].tbs[n_dci_dl]);
|
||||
#endif
|
||||
break;
|
||||
case 1: //RA:
|
||||
|
||||
memcpy(PHY_vars_eNB_g[enb_id]->dlsch_eNB_ra->harq_processes[0]->b,
|
||||
&eNB_transport_info[enb_id].transport_blocks[payload_offset],
|
||||
eNB_transport_info[enb_id].tbs[n_dci_dl]);
|
||||
#ifdef DEBUG_EMU
|
||||
LOG_D(EMU, "RA eNB_transport_info[enb_id].tbs[n_dci_dl]%d \n", eNB_transport_info[enb_id].tbs[n_dci_dl]);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 2://TB0:
|
||||
harq_pid = eNB_transport_info[enb_id].harq_pid[n_dci_dl];
|
||||
ue_id = eNB_transport_info[enb_id].ue_id[n_dci_dl];
|
||||
PHY_vars_eNB_g[enb_id]->dlsch_eNB[ue_id][0]->rnti= eNB_transport_info[enb_id].dci_alloc[n_dci_dl].rnti;
|
||||
dlsch_eNB = PHY_vars_eNB_g[enb_id]->dlsch_eNB[ue_id][0];
|
||||
#ifdef DEBUG_EMU
|
||||
LOG_D(EMU, " enb_id %d ue id is %d rnti is %x dci index %d, harq_pid %d tbs %d \n",
|
||||
enb_id, ue_id, eNB_transport_info[enb_id].dci_alloc[n_dci_dl].rnti,
|
||||
n_dci_dl, harq_pid, eNB_transport_info[enb_id].tbs[n_dci_dl]);
|
||||
int i;
|
||||
for (i=0;i<eNB_transport_info[enb_id].tbs[n_dci_dl];i++)
|
||||
msg("%x.",(unsigned char) eNB_transport_info[enb_id].transport_blocks[payload_offset+i]);
|
||||
#endif
|
||||
memcpy(dlsch_eNB->harq_processes[harq_pid]->b,
|
||||
&eNB_transport_info[enb_id].transport_blocks[payload_offset],
|
||||
eNB_transport_info[enb_id].tbs[n_dci_dl]);
|
||||
break;
|
||||
|
||||
case 3://TB1:
|
||||
harq_pid = eNB_transport_info[enb_id].harq_pid[n_dci_dl];
|
||||
ue_id = eNB_transport_info[enb_id].ue_id[n_dci_dl];
|
||||
PHY_vars_eNB_g[enb_id]->dlsch_eNB[ue_id][1]->rnti= eNB_transport_info[enb_id].dci_alloc[n_dci_dl].rnti;
|
||||
dlsch_eNB = PHY_vars_eNB_g[enb_id]->dlsch_eNB[ue_id][1];
|
||||
|
||||
memcpy(dlsch_eNB->harq_processes[harq_pid]->b,
|
||||
&eNB_transport_info[enb_id].transport_blocks[payload_offset],
|
||||
eNB_transport_info[enb_id].tbs[n_dci_dl]);
|
||||
break;
|
||||
|
||||
}
|
||||
payload_offset += eNB_transport_info[enb_id].tbs[n_dci_dl];
|
||||
}
|
||||
n_dci_dl++;
|
||||
}
|
||||
#ifdef DEBUG_EMU
|
||||
LOG_D(EMU, "Fill phy eNB vars done next slot %d !\n", next_slot);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void fill_phy_ue_vars(unsigned int ue_id, unsigned int last_slot) {
|
||||
|
||||
int n_enb;//index
|
||||
int enb_id;
|
||||
// int harq_id;
|
||||
// int payload_offset = 0;
|
||||
unsigned short rnti;
|
||||
unsigned int harq_pid;
|
||||
LTE_UE_ULSCH_t *ulsch;
|
||||
PUCCH_FMT_t pucch_format;
|
||||
// u8 ue_transport_info_index[NUMBER_OF_eNB_MAX];
|
||||
u8 subframe = (last_slot+1)>>1;
|
||||
|
||||
memcpy (&ue_cntl_delay[ue_id][(last_slot+1)%2],
|
||||
&UE_transport_info[ue_id].cntl,
|
||||
sizeof(UE_cntl));
|
||||
|
||||
#ifdef DEBUG_EMU
|
||||
LOG_D(EMU, "Last slot %d subframe %d Fill phy UE %d vars PRACH is (%d,%d) preamble (%d,%d) SR (%d,%d), pucch_sel (%d, %d)\n",
|
||||
last_slot,subframe,ue_id,
|
||||
UE_transport_info[ue_id].cntl.prach_flag,
|
||||
ue_cntl_delay[ue_id][last_slot%2].prach_flag,
|
||||
UE_transport_info[ue_id].cntl.prach_id,
|
||||
ue_cntl_delay[ue_id][last_slot%2].prach_id,
|
||||
UE_transport_info[ue_id].cntl.sr,
|
||||
ue_cntl_delay[ue_id][last_slot%2].sr,
|
||||
UE_transport_info[ue_id].cntl.pucch_sel,
|
||||
ue_cntl_delay[ue_id][last_slot%2].pucch_sel );
|
||||
#endif
|
||||
//ue_cntl_delay[subframe%2].prach_flag ;
|
||||
PHY_vars_UE_g[ue_id]->generate_prach = ue_cntl_delay[ue_id][last_slot%2].prach_flag;//UE_transport_info[ue_id].cntl.prach_flag;
|
||||
if (PHY_vars_UE_g[ue_id]->generate_prach == 1) {
|
||||
// if (PHY_vars_UE_g[ue_id]->prach_resources[enb_id] == NULL)
|
||||
// PHY_vars_UE_g[ue_id]->prach_resources[enb_id] = malloc(sizeof(PRACH_RESOURCES_t));
|
||||
//ue_cntl_delay[subframe%2].prach_id;
|
||||
PHY_vars_UE_g[ue_id]->prach_PreambleIndex = ue_cntl_delay[ue_id][last_slot%2].prach_id;
|
||||
}
|
||||
|
||||
pucch_format= ue_cntl_delay[ue_id][last_slot%2].pucch_flag;// UE_transport_info[ue_id].cntl.pucch_flag;
|
||||
if ((last_slot+1) % 2 == 0 ) {
|
||||
if (pucch_format == pucch_format1) // UE_transport_info[ue_id].cntl.sr;
|
||||
PHY_vars_UE_g[ue_id]->sr[subframe] = ue_cntl_delay[ue_id][last_slot%2].sr;
|
||||
else if ((pucch_format == pucch_format1a) || (pucch_format == pucch_format1b )){
|
||||
PHY_vars_UE_g[ue_id]->pucch_payload[0] = ue_cntl_delay[ue_id][last_slot%2].pucch_payload;//UE_transport_info[ue_id].cntl.pucch_payload;
|
||||
}
|
||||
PHY_vars_UE_g[ue_id]->pucch_sel[subframe] = ue_cntl_delay[ue_id][last_slot%2].pucch_sel;
|
||||
}
|
||||
#ifdef DEBUG_EMU
|
||||
LOG_D(EMU,"subframe %d trying to copy the payload from num eNB %d to UE %d \n",subframe, UE_transport_info[ue_id].num_eNB, ue_id);
|
||||
#endif
|
||||
for (n_enb=0; n_enb < UE_transport_info[ue_id].num_eNB; n_enb++){
|
||||
#ifdef DEBUG_EMU
|
||||
/* LOG_D(EMU,"Setting ulsch vars for ue %d rnti %x harq pid is %d \n",
|
||||
ue_id, UE_transport_info[ue_id].rnti[n_enb],
|
||||
PHY_vars_UE_g[ue_id]->ulsch_ue[enb_id]);
|
||||
*/
|
||||
#endif
|
||||
rnti = UE_transport_info[ue_id].rnti[n_enb];
|
||||
enb_id = UE_transport_info[ue_id].eNB_id[n_enb];
|
||||
|
||||
PHY_vars_UE_g[ue_id]->lte_ue_pdcch_vars[enb_id]->crnti=rnti;
|
||||
|
||||
harq_pid = UE_transport_info[ue_id].harq_pid[n_enb];
|
||||
|
||||
//ulsch = PHY_vars_UE_g[ue_id]->ulsch_ue[enb_id];
|
||||
|
||||
PHY_vars_UE_g[ue_id]->ulsch_ue[enb_id]->o_RI[0] = ue_cntl_delay[ue_id][last_slot%2].pusch_ri & 0x1;
|
||||
PHY_vars_UE_g[ue_id]->ulsch_ue[enb_id]->o_RI[1] = (ue_cntl_delay[ue_id][last_slot%2].pusch_ri>>1) & 0x1;
|
||||
|
||||
PHY_vars_UE_g[ue_id]->ulsch_ue[enb_id]->o_ACK[0]= ue_cntl_delay[ue_id][last_slot%2].pusch_ack & 0x1;
|
||||
PHY_vars_UE_g[ue_id]->ulsch_ue[enb_id]->o_ACK[1]= (ue_cntl_delay[ue_id][last_slot%2].pusch_ack>>1) & 0x1;
|
||||
//*(u32 *)ulsch->o = ue_cntl_delay[ue_id][last_slot%2].pusch_uci;
|
||||
|
||||
if (last_slot%2 == 1 ) {
|
||||
PHY_vars_UE_g[ue_id]->ulsch_ue[enb_id]->O = ue_cntl_delay[ue_id][last_slot%2].length_uci;
|
||||
PHY_vars_UE_g[ue_id]->ulsch_ue[enb_id]->uci_format = ue_cntl_delay[ue_id][last_slot%2].uci_format;
|
||||
|
||||
memcpy(PHY_vars_UE_g[ue_id]->ulsch_ue[enb_id]->o,
|
||||
ue_cntl_delay[ue_id][last_slot%2].pusch_uci,
|
||||
MAX_CQI_BYTES);
|
||||
|
||||
ulsch = PHY_vars_UE_g[ue_id]->ulsch_ue[enb_id];
|
||||
// if (((HLC_subband_cqi_rank1_2A_5MHz *)ulsch->o)->cqi1)
|
||||
LOG_D(EMU,"[UE %d] subframe %d last slot %d copy the payload from eNB %d to UE %d with harq id %d cqi (val %d, length %d) \n",
|
||||
ue_id, subframe, last_slot, enb_id, ue_id, harq_pid,
|
||||
((HLC_subband_cqi_rank1_2A_5MHz *)ulsch->o)->cqi1,
|
||||
PHY_vars_UE_g[ue_id]->ulsch_ue[enb_id]->O);
|
||||
}
|
||||
memcpy(PHY_vars_UE_g[ue_id]->ulsch_ue[enb_id]->harq_processes[harq_pid]->b,
|
||||
UE_transport_info[ue_id].transport_blocks,
|
||||
UE_transport_info[ue_id].tbs[enb_id]);
|
||||
|
||||
//ue_transport_info_index[enb_id]+=UE_transport_info[ue_id].tbs[enb_id];
|
||||
|
||||
//UE_transport_info[ue_id].transport_blocks+=ue_transport_info_index[enb_id];
|
||||
//LOG_T(EMU,"ulsch tbs is %d\n", UE_transport_info[ue_id].tbs[enb_id]);
|
||||
}
|
||||
}
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
/*! \file extern.h
|
||||
* \brief specifies the extern variables for phy emulation
|
||||
* \author Navid Nikaein and Raymomd Knopp and Hicham Anouar
|
||||
* \date 2011
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
*/
|
||||
|
||||
#ifndef __BYPASS_SESSION_LAYER_EXTERN_H__
|
||||
# define __BYPASS_SESSION_LAYER_EXTERN_H__
|
||||
|
||||
#ifndef USER_MODE
|
||||
#include <rtai_posix.h>
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#endif //RTAI_ENABLED
|
||||
|
||||
extern unsigned char Emulation_status;
|
||||
extern unsigned char emu_tx_status;
|
||||
extern unsigned char emu_rx_status;
|
||||
//extern unsigned int Master_list;
|
||||
//extern unsigned short Master_id;
|
||||
//extern unsigned int Is_primary_master;
|
||||
|
||||
extern pthread_mutex_t emul_low_mutex;
|
||||
extern pthread_cond_t emul_low_cond;
|
||||
extern char emul_low_mutex_var;
|
||||
extern pthread_mutex_t Tx_mutex;
|
||||
extern pthread_cond_t Tx_cond;
|
||||
extern char Tx_mutex_var;
|
||||
|
||||
|
||||
extern int (*rx_handler) (unsigned char,char*,int);
|
||||
extern int (*tx_handler) (unsigned char,char*, unsigned int*, unsigned int*);
|
||||
|
||||
extern eNB_transport_info_t eNB_transport_info[NUMBER_OF_eNB_MAX];
|
||||
extern u16 eNB_transport_info_TB_index[NUMBER_OF_eNB_MAX];
|
||||
|
||||
extern UE_transport_info_t UE_transport_info[NUMBER_OF_UE_MAX];
|
||||
extern u16 UE_transport_info_TB_index[NUMBER_OF_UE_MAX];
|
||||
|
||||
extern UE_cntl ue_cntl_delay[NUMBER_OF_UE_MAX][2];
|
||||
|
||||
#endif
|
||||
+296
@@ -0,0 +1,296 @@
|
||||
/*! \file multicast.h
|
||||
* \brief
|
||||
* \author Lionel Gauthier and Navid Nikaein
|
||||
* \date 2011
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
*/
|
||||
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <net/if.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <assert.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <sys/select.h>
|
||||
//#include "openair_defs.h"
|
||||
//#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
//#include "openair_defs.h"
|
||||
#define MULTICAST_LINK_C
|
||||
|
||||
#include "socket.h"
|
||||
#include "multicast_link.h"
|
||||
#ifndef USER_MODE
|
||||
#ifdef NODE_RG
|
||||
//#include "mac_rg_bypass.h"
|
||||
#endif
|
||||
#ifdef NODE_MT
|
||||
//#include "mac_ue_bypass.h"
|
||||
#endif
|
||||
#endif //USER_MODE
|
||||
|
||||
#ifdef USER_MODE
|
||||
//#include <rtai.h>
|
||||
# define msg printf
|
||||
# include "UTIL/LOG/log.h"
|
||||
#endif //USER_MODE
|
||||
//#include "extern.h"
|
||||
extern unsigned short Master_id;
|
||||
|
||||
#define MULTICAST_LINK_NUM_GROUPS 4
|
||||
|
||||
char *multicast_group_list[MULTICAST_LINK_NUM_GROUPS] = {
|
||||
"239.0.0.161\0",
|
||||
"239.0.0.162\0",
|
||||
"239.0.0.163\0",
|
||||
"239.0.0.164\0"
|
||||
};
|
||||
|
||||
static multicast_group_t group_list[MULTICAST_LINK_NUM_GROUPS];
|
||||
|
||||
static fd_set socks; /* Socket file descriptors we want to wake up for, using select() */
|
||||
static int highsock; /* Highest #'d file descriptor, needed for select() */
|
||||
static pthread_t main_loop_thread;
|
||||
static void (*rx_handler) (unsigned int, char*);
|
||||
static unsigned char multicast_group;
|
||||
static char *multicast_if;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
multicast_link_init ()
|
||||
{
|
||||
//------------------------------------------------------------------------------
|
||||
int group;
|
||||
int multicast_loop;
|
||||
int reuse_addr = 1; /* Used so we can re-bind to our port
|
||||
while a previous connection is still
|
||||
in TIME_WAIT state. */
|
||||
static struct ip_mreq command;
|
||||
struct sockaddr_in sin;
|
||||
// struct ifreq ifr;
|
||||
|
||||
for (group = 0; group < MULTICAST_LINK_NUM_GROUPS; group++) {
|
||||
strcpy (group_list[group].host_addr, multicast_group_list[group]);
|
||||
group_list[group].port = 46014 + group;
|
||||
group_list[group].socket = make_socket_inet (SOCK_DGRAM, &group_list[group].port, &sin);
|
||||
msg("multicast_link_init(): Created socket %d for group %d, port %d\n",
|
||||
group_list[group].socket,group,group_list[group].port);
|
||||
if (setsockopt (group_list[group].socket, SOL_SOCKET, SO_REUSEADDR, &reuse_addr, sizeof (reuse_addr)) < 0) {
|
||||
msg ("[MULTICAST] ERROR : setsockopt:SO_REUSEADDR, exiting ...");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
if (multicast_if != NULL) {
|
||||
/* memset(&ifr, 0, sizeof(struct ifreq));
|
||||
snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), multicast_if);
|
||||
ioctl(group_list[group].socket, SIOCGIFINDEX, &ifr);
|
||||
if (setsockopt (group_list[group].socket, SOL_SOCKET,SO_BINDTODEVICE,(void*)&ifr, sizeof(struct ifreq)) < 0) { */
|
||||
if (setsockopt (group_list[group].socket, SOL_SOCKET,SO_BINDTODEVICE,multicast_if, 4) < 0) {
|
||||
msg ("[MULTICAST] ERROR : setsockopt:SO_BINDTODEVICE on interface %s, exiting ...\n", multicast_if);
|
||||
msg ("[MULTICAST] make sure that you have a root privilage or run with sudo -E \n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
socket_setnonblocking (group_list[group].socket);
|
||||
|
||||
//
|
||||
multicast_loop = 0;
|
||||
if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_MULTICAST_LOOP, &multicast_loop, sizeof (multicast_loop)) < 0) {
|
||||
msg ("[MULTICAST] ERROR: %s line %d multicast_link_main_loop() IP_MULTICAST_LOOP %m", __FILE__, __LINE__);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
// Join the broadcast group:
|
||||
command.imr_multiaddr.s_addr = inet_addr (group_list[group].host_addr);
|
||||
command.imr_interface.s_addr = htonl (INADDR_ANY);
|
||||
if (command.imr_multiaddr.s_addr == -1) {
|
||||
msg ("[MULTICAST] ERROR: %s line %d NO MULTICAST", __FILE__, __LINE__);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_ADD_MEMBERSHIP, &command, sizeof (command)) < 0) {
|
||||
msg ("[MULTICAST] ERROR: %s line %d IP_ADD_MEMBERSHIP %m", __FILE__, __LINE__);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
memset (&group_list[group].sock_remote_addr, 0, sizeof (struct sockaddr_in));
|
||||
group_list[group].sock_remote_addr.sin_family = AF_INET;
|
||||
group_list[group].sock_remote_addr.sin_addr.s_addr = inet_addr (multicast_group_list[group]);
|
||||
group_list[group].sock_remote_addr.sin_port = htons (group_list[group].port);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
multicast_link_build_select_list ()
|
||||
{
|
||||
//------------------------------------------------------------------------------
|
||||
int group;
|
||||
|
||||
/* First put together fd_set for select(), which will
|
||||
consist of the sock veriable in case a new connection
|
||||
is coming in, plus all the sockets we have already
|
||||
accepted. */
|
||||
|
||||
|
||||
/* FD_ZERO() clears out the fd_set called socks, so that
|
||||
it doesn't contain any file descriptors. */
|
||||
|
||||
FD_ZERO (&socks);
|
||||
|
||||
|
||||
/* Loops through all the possible connections and adds
|
||||
those sockets to the fd_set */
|
||||
|
||||
for (group = 0; group < MULTICAST_LINK_NUM_GROUPS; group++) {
|
||||
if (group_list[group].socket != 0) {
|
||||
FD_SET (group_list[group].socket, &socks);
|
||||
if (group_list[group].socket > highsock)
|
||||
highsock = group_list[group].socket;
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
multicast_link_read_data (int groupP)
|
||||
{
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#ifdef BYPASS_PHY
|
||||
//pthread_mutex_lock(&Bypass_phy_wr_mutex);
|
||||
// while(Bypass_phy_wr){
|
||||
// msg("[Multicast read] BYPASS_PHY_NOT_YET READY, Waiting for signal\n");
|
||||
// pthread_cond_wait(&Bypass_phy_wr_cond,&Bypass_phy_wr_mutex);
|
||||
// }
|
||||
//msg("[Multicast read] BYPASS_PHY TX Signal\n");
|
||||
//pthread_mutex_unlock(&Bypass_phy_wr_mutex);
|
||||
//pthread_mutex_lock(&Bypass_phy_wr_mutex);
|
||||
// Bypass_phy_wr=1;
|
||||
// pthread_mutex_unlock(&Bypass_phy_wr_mutex);
|
||||
#endif //BYPASS_PHY
|
||||
|
||||
int num_bytes;
|
||||
//msg("multicast link read INNNNNNNNNNNNNNNNNN\n");
|
||||
// msg("multicast_link_read_data: groupP=%d,rx_buffer = %p\n",groupP,group_list[groupP].rx_buffer );
|
||||
if ((groupP <= MULTICAST_LINK_NUM_GROUPS) && (groupP >= 0)) {
|
||||
if ((num_bytes = recvfrom (group_list[groupP].socket, group_list[groupP].rx_buffer, 40000, 0, 0, 0)) < 0) {
|
||||
fprintf (stderr, "ERROR: %s line %d multicast_link_read_data()/recvfrom() %m", __FILE__, __LINE__);
|
||||
} else {
|
||||
// msg("multicast_link_read_data: groupP=%d,rx_buffer = %p,NUm_bytes=%d\n",groupP,group_list[groupP].rx_buffer,num_bytes );
|
||||
//msg("MULTICAST calling rx_handler\n");
|
||||
rx_handler(num_bytes,group_list[groupP].rx_buffer);
|
||||
}
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"ERROR: groupP out of bounds %d\n",groupP);
|
||||
}
|
||||
//msg("ENNNNND multicast_link_read_data: groupP=%d,rx_buffer = %p, num_bytes=%d\n",groupP,group_list[groupP].rx_buffer,num_bytes );
|
||||
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
multicast_link_read ()
|
||||
{
|
||||
//------------------------------------------------------------------------------
|
||||
int group; /* Current item in connectlist for for loops */
|
||||
|
||||
/* Now check connectlist for available data */
|
||||
|
||||
/* Run through our sockets and check to see if anything
|
||||
happened with them, if so 'service' them. */
|
||||
|
||||
for (group = multicast_group; group < MULTICAST_LINK_NUM_GROUPS ; group++) {
|
||||
if (FD_ISSET (group_list[group].socket, &socks)) {
|
||||
multicast_link_read_data (group);
|
||||
break;
|
||||
}
|
||||
} /* for (all entries in queue) */
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
multicast_link_write_sock (int groupP, char *dataP, uint32_t sizeP)
|
||||
{
|
||||
//------------------------------------------------------------------------------
|
||||
int num;
|
||||
if ((num = sendto (group_list[groupP].socket, dataP, sizeP, 0, (struct sockaddr *) &group_list[groupP].sock_remote_addr, sizeof (group_list[groupP].sock_remote_addr))) < 0) {
|
||||
fprintf (stderr, "ERROR: %s line %d multicast_link_write_sock()/sendto() %m", __FILE__, __LINE__);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void *
|
||||
multicast_link_main_loop (void *param)
|
||||
{
|
||||
//------------------------------------------------------------------------------
|
||||
struct timeval timeout; /* Timeout for select */
|
||||
int readsocks; /* Number of sockets ready for reading */
|
||||
#ifdef USER_MODE
|
||||
|
||||
#endif //USER_MODE
|
||||
highsock = -1;
|
||||
while (1) {
|
||||
multicast_link_build_select_list ();
|
||||
/* [24/06/13] SR: Set the timeout to one second ->
|
||||
* avoid infinite loop if no data to read.
|
||||
*/
|
||||
timeout.tv_sec = 1;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
readsocks = select (highsock + 1, &socks, (fd_set *) 0, (fd_set *) 0, &timeout);
|
||||
if (readsocks < 0) {
|
||||
LOG_E(EMU, "Multicast select failed (%d:%s)\n", errno, strerror(errno));
|
||||
// exit();
|
||||
} else if (readsocks > 0) {
|
||||
//msg("calling multicast link read\n");
|
||||
multicast_link_read ();
|
||||
// usleep(1);
|
||||
} else {
|
||||
/* Timeout */
|
||||
LOG_I(EMU, "Multicast select time-out\n");
|
||||
}
|
||||
}
|
||||
#ifdef USER_MODE
|
||||
|
||||
#endif //USER_MODE
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
multicast_link_start ( void (*rx_handlerP) (unsigned int, char*), unsigned char multicast_group, char * multicast_ifname)
|
||||
{
|
||||
//-----------------------------------------------------------------------------
|
||||
rx_handler = rx_handlerP;
|
||||
multicast_group = multicast_group;
|
||||
multicast_if = multicast_ifname;
|
||||
msg("[MULTICAST] LINK START on interface=%s for group=%d: handler=%p\n",
|
||||
(multicast_if == NULL) ? "not specified" : multicast_if, multicast_group, rx_handler);
|
||||
#ifdef BYPASS_PHY
|
||||
// pthread_mutex_init(&Bypass_phy_wr_mutex,NULL);
|
||||
//pthread_cond_init(&Bypass_phy_wr_cond,NULL);
|
||||
//Bypass_phy_wr=0;
|
||||
#endif //BYPASS_PHY
|
||||
multicast_link_init ();
|
||||
msg("[MULTICAST] multicast link start thread\n");
|
||||
if (pthread_create (&main_loop_thread, NULL, multicast_link_main_loop, NULL) != 0) {
|
||||
msg ("[MULTICAST LINK] Thread started\n");
|
||||
exit (-2);
|
||||
} else {
|
||||
pthread_detach (main_loop_thread); // disassociate from parent
|
||||
msg ("[MULTICAST LINK] Thread detached\n");
|
||||
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/*! \file multicast.h
|
||||
* \brief
|
||||
* \author Lionel Gauthier and Navid Nikaein
|
||||
* \date 2011
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
*/
|
||||
|
||||
#ifndef __MULTICAST_LINK_H__
|
||||
# define __MULTICAST_LINK_H__
|
||||
# ifdef MULTICAST_LINK_C
|
||||
# define private_multicast_link(x) x
|
||||
# define public_multicast_link(x) x
|
||||
# else
|
||||
# define private_multicast_link(x)
|
||||
# define public_multicast_link(x) extern x
|
||||
# endif
|
||||
# include "stdint.h"
|
||||
|
||||
|
||||
|
||||
private_multicast_link (typedef struct multicast_group_t {
|
||||
int socket;
|
||||
char host_addr[16];
|
||||
uint16_t port;
|
||||
struct sockaddr_in sock_remote_addr;
|
||||
char rx_buffer[40000];
|
||||
} multicast_group_t;)
|
||||
|
||||
|
||||
private_multicast_link(void multicast_link_init ());
|
||||
private_multicast_link(void multicast_link_read_data (int groupP));
|
||||
private_multicast_link(void multicast_link_read ());
|
||||
private_multicast_link(void *multicast_link_main_loop (void *param));
|
||||
|
||||
public_multicast_link(int multicast_link_write_sock (int groupP, char *dataP, uint32_t sizeP));
|
||||
public_multicast_link( void multicast_link_start ( void (*rx_handlerP) (unsigned int, char*), unsigned char multicast_group, char * multicast_ifname));
|
||||
#ifdef BYPASS_PHY
|
||||
public_multicast_link( pthread_mutex_t Bypass_phy_wr_mutex);
|
||||
public_multicast_link( pthread_cond_t Bypass_phy_wr_cond);
|
||||
public_multicast_link( char Bypass_phy_wr);
|
||||
#endif //BYPASS_PHY
|
||||
#endif
|
||||
@@ -0,0 +1,86 @@
|
||||
/*! \file netlink_init.c
|
||||
* \brief initiate the netlink socket for communication with nas dirver
|
||||
* \author Navid Nikaein and Raymomd Knopp
|
||||
* \date 2011
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
*/
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#define MAX_PAYLOAD 4096 /* this sould cover the max mtu size*/
|
||||
struct sockaddr_nl nas_src_addr, nas_dest_addr;
|
||||
struct nlmsghdr *nas_nlh = NULL;
|
||||
struct iovec nas_iov;
|
||||
int nas_sock_fd;
|
||||
struct msghdr nas_msg;
|
||||
|
||||
#define GRAAL_NETLINK_ID 31
|
||||
|
||||
int netlink_init(void) {
|
||||
|
||||
|
||||
int ret;
|
||||
|
||||
|
||||
nas_sock_fd = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID);
|
||||
if (nas_sock_fd==-1) {
|
||||
printf("[NETLINK] Error opening socket %d\n",nas_sock_fd);
|
||||
return(-1);
|
||||
}
|
||||
printf("[NETLINK]Opened socket with fd %d\n",nas_sock_fd);
|
||||
|
||||
ret = fcntl(nas_sock_fd,F_SETFL,O_NONBLOCK);
|
||||
printf("[NETLINK] fcntl returns %d\n",ret);
|
||||
|
||||
memset(&nas_src_addr, 0, sizeof(nas_src_addr));
|
||||
nas_src_addr.nl_family = AF_NETLINK;
|
||||
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
|
||||
nas_src_addr.nl_groups = 0; /* not in mcast groups */
|
||||
ret = bind(nas_sock_fd, (struct sockaddr*)&nas_src_addr,
|
||||
sizeof(nas_src_addr));
|
||||
|
||||
printf("[NETLINK] bind returns %d\n",ret);
|
||||
|
||||
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
|
||||
nas_dest_addr.nl_family = AF_NETLINK;
|
||||
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
|
||||
nas_dest_addr.nl_groups = 0; /* unicast */
|
||||
|
||||
nas_nlh=(struct nlmsghdr *)malloc(NLMSG_SPACE(MAX_PAYLOAD));
|
||||
/* Fill the netlink message header */
|
||||
nas_nlh->nlmsg_len = NLMSG_SPACE(MAX_PAYLOAD);
|
||||
nas_nlh->nlmsg_pid = 1;//getpid(); /* self pid */
|
||||
nas_nlh->nlmsg_flags = 0;
|
||||
|
||||
nas_iov.iov_base = (void *)nas_nlh;
|
||||
nas_iov.iov_len = nas_nlh->nlmsg_len;
|
||||
memset(&nas_msg,0,sizeof(nas_msg));
|
||||
nas_msg.msg_name = (void *)&nas_dest_addr;
|
||||
nas_msg.msg_namelen = sizeof(nas_dest_addr);
|
||||
nas_msg.msg_iov = &nas_iov;
|
||||
nas_msg.msg_iovlen = 1;
|
||||
|
||||
|
||||
/* Read message from kernel */
|
||||
memset(nas_nlh, 0, NLMSG_SPACE(MAX_PAYLOAD));
|
||||
|
||||
|
||||
return(nas_sock_fd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*! \file proto.h
|
||||
* \brief
|
||||
* \author Navid Nikaein
|
||||
* \date 2011
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
*/
|
||||
|
||||
void init_bypass (void);
|
||||
void bypass_init ( unsigned int (*tx_handlerP) (unsigned char,char*, unsigned int*, unsigned int*),unsigned int (*rx_handlerP) (unsigned char,char*,unsigned int));
|
||||
int bypass_rx_data (unsigned int frame, unsigned int last_slot, unsigned int next_slot);
|
||||
void bypass_signal_mac_phy(unsigned int frame, unsigned int last_slot, unsigned int next_slot);
|
||||
#ifndef USER_MODE
|
||||
int multicast_link_write_sock (int groupP, char *dataP, unsigned int sizeP);
|
||||
int bypass_tx_handler(unsigned int fifo, int rw);
|
||||
int bypass_rx_handler(unsigned int fifo, int rw);
|
||||
#else
|
||||
void bypass_rx_handler(unsigned int Num_bytes,char *Rx_buffer);
|
||||
#endif
|
||||
|
||||
void bypass_tx_data (char Type, unsigned int frame, unsigned int next_slot);
|
||||
|
||||
void emulation_tx_rx(void);
|
||||
|
||||
unsigned int emul_tx_handler(unsigned char Mode,char *Tx_buffer,unsigned int* Nbytes,unsigned int *Nb_flows);
|
||||
unsigned int emul_rx_handler(unsigned char Mode,char *rx_buffer, unsigned int Nbytes);
|
||||
|
||||
unsigned int emul_rx_data(void);
|
||||
|
||||
void emu_transport_info(unsigned int last_slot, unsigned int next_slot);
|
||||
void fill_phy_enb_vars(unsigned int enb_id, unsigned int next_slot);
|
||||
void fill_phy_ue_vars(unsigned int ue_id, unsigned int last_slot);
|
||||
void emu_transport_sync(void);
|
||||
void emu_transport(unsigned int frame, unsigned int last_slot,unsigned int next_slot, lte_subframe_t direction, unsigned char frame_type, int ethernet_flag );
|
||||
void emu_transport_DL(unsigned int frame, unsigned int last_slot,unsigned int next_slot);
|
||||
void emu_transport_UL(unsigned int frame, unsigned int last_slot,unsigned int next_slot);
|
||||
void emu_transport_release(void);
|
||||
|
||||
void clear_eNB_transport_info(u8);
|
||||
void clear_UE_transport_info(u8);
|
||||
int netlink_init(void);
|
||||
|
||||
Executable
+83
@@ -0,0 +1,83 @@
|
||||
/*! \file socket.c
|
||||
* \brief
|
||||
* \author Lionel Gauthier
|
||||
* \date 2011
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: lionel.gauthier@eurecom.fr
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
//#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define SOCKET_C
|
||||
//#include "openair_defs.h"
|
||||
#include "socket.h"
|
||||
|
||||
#ifdef USER_MODE
|
||||
#define msg printf
|
||||
#endif
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
socket_setnonblocking (int sockP)
|
||||
{
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
int opts;
|
||||
|
||||
opts = fcntl (sockP, F_GETFL);
|
||||
if (opts < 0) {
|
||||
perror ("fcntl(F_GETFL)");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
opts = (opts | O_NONBLOCK);
|
||||
if (fcntl (sockP, F_SETFL, opts) < 0) {
|
||||
perror ("fcntl(F_SETFL)");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
make_socket_inet (int typeP, uint16_t * portP, struct sockaddr_in *ptr_addressP)
|
||||
{
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
int sock;
|
||||
unsigned int length = sizeof (struct sockaddr_in);
|
||||
struct sockaddr_in name;
|
||||
|
||||
|
||||
assert ((typeP == SOCK_STREAM) || (typeP == SOCK_DGRAM));
|
||||
|
||||
/* Create the socket. */
|
||||
sock = socket (PF_INET, typeP, 0);
|
||||
if (sock < 0) {
|
||||
fprintf (stderr, "ERROR: %s line %d socket %m", __FILE__, __LINE__);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* Give the socket a name. */
|
||||
name.sin_family = AF_INET;
|
||||
name.sin_port = htons (*portP);
|
||||
name.sin_addr.s_addr = htonl (INADDR_ANY);
|
||||
|
||||
if (bind (sock, (struct sockaddr *) &name, sizeof (name)) < 0) {
|
||||
close (sock);
|
||||
fprintf (stderr, "ERROR: %s line %d bind port %d %m", __FILE__, __LINE__, *portP);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
if (ptr_addressP != NULL) {
|
||||
getsockname (sock, (struct sockaddr *) ptr_addressP, &length);
|
||||
}
|
||||
msg("[SOCKET] bound socket port %d\n", *portP);
|
||||
return sock;
|
||||
}
|
||||
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
/*! \file socket.h
|
||||
* \brief
|
||||
* \author Lionel Gauthier
|
||||
* \date 2011
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: lionel.gauthier@eurecom.fr
|
||||
*/
|
||||
|
||||
#ifndef __SOCKET_H__
|
||||
# define __SOCKET_H__
|
||||
# ifdef SOCKET_C
|
||||
# define private_socket(x) x
|
||||
# define public_socket(x) x
|
||||
# else
|
||||
# define private_socket(x)
|
||||
# define public_socket(x) extern x
|
||||
# endif
|
||||
# include "stdint.h"
|
||||
public_socket (void socket_setnonblocking (int sockP);
|
||||
)
|
||||
public_socket (int make_socket_inet (int typeP, uint16_t * portP, struct sockaddr_in *ptr_addressP);
|
||||
)
|
||||
#endif
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
/*! \file vars.h
|
||||
* \brief specifies the variables for phy emulation
|
||||
* \author Navid Nikaein and Raymomd Knopp and Hicham Anouar
|
||||
* \date 2011
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
*/
|
||||
|
||||
#ifndef USER_MODE
|
||||
#include <rtai_posix.h>
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
#include "defs.h"
|
||||
|
||||
#ifndef __BYPASS_SESSION_LAYER_VARS_H__
|
||||
# define __BYPASS_SESSION_LAYER_VARS_H__
|
||||
|
||||
unsigned char Emulation_status;
|
||||
unsigned char emu_tx_status;
|
||||
unsigned char emu_rx_status;
|
||||
//unsigned int Master_list=0;
|
||||
//unsigned short Master_id;
|
||||
//unsigned int Is_primary_master;
|
||||
|
||||
pthread_mutex_t emul_low_mutex;
|
||||
pthread_cond_t emul_low_cond;
|
||||
char emul_low_mutex_var;
|
||||
pthread_mutex_t Tx_mutex;
|
||||
pthread_cond_t Tx_cond;
|
||||
char Tx_mutex_var;
|
||||
|
||||
int (*rx_handler) (unsigned char,char*,int);
|
||||
int (*tx_handler) (unsigned char,char*, unsigned int*, unsigned int*);
|
||||
|
||||
eNB_transport_info_t eNB_transport_info[NUMBER_OF_eNB_MAX];
|
||||
u16 eNB_transport_info_TB_index[NUMBER_OF_eNB_MAX];
|
||||
|
||||
UE_transport_info_t UE_transport_info[NUMBER_OF_UE_MAX];
|
||||
u16 UE_transport_info_TB_index[NUMBER_OF_UE_MAX];
|
||||
|
||||
UE_cntl ue_cntl_delay[NUMBER_OF_UE_MAX][2];
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,121 @@
|
||||
#CC = $(shell if [ $(OSTYPE) = "cygwin" ]; then echo "gcc-4"; else echo "gcc"; fi)
|
||||
#CC = gcc-4.3
|
||||
|
||||
SSE3PROC = $(shell echo `grep ssse3 /proc/cpuinfo`)
|
||||
SSE4PROC = $(shell echo `grep sse4 /proc/cpuinfo`)
|
||||
CPUFLAGS = -mmmx -msse -msse2 -m32 -mssse3 #-msse4
|
||||
#CPUFLAGS += $(shell if [ -z $(SSE3PROC) ]; then echo "" ; else echo "-mssse3"; fi)
|
||||
#CPUFLAGS += $(shell if [ -z $(SSE4PROC) ]; then echo "" ; else echo "-msse4"; fi)
|
||||
|
||||
TOP_DIR = $(OPENAIR1_DIR)
|
||||
OPENAIR1_TOP = $(OPENAIR1_DIR)
|
||||
OPENAIR2_TOP = $(OPENAIR2_DIR)
|
||||
OPENAIR3 = $(OPENAIR3_DIR)
|
||||
|
||||
CFLAGS = -Wall -fno-common -mpreferred-stack-boundary=4 -fno-strict-aliasing -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 -g -ggdb -rdynamic $(CPUFLAGS) # -Wno-packed-bitfield-compat
|
||||
|
||||
LFLAGS = -lm -lblas -lrt
|
||||
|
||||
GCCVERSION = $(shell gcc --version | grep ^gcc | sed 's/^.* //g')
|
||||
ifeq "$(GCCVERSION)" "4.4.3"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
ifeq "$(GCCVERSION)" "4.5.2"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
ifeq "$(GCCVERSION)" "4.6.1"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
|
||||
CFLAGS += -DOPENAIR_LTE -DOFDMA_ULSCH #-DIFFT_FPGA -DIFFT_FPGA_UE
|
||||
#CFLAGS += -DTBS_FIX
|
||||
CFLAGS += -DCELLULAR
|
||||
|
||||
ASN1_MSG_INC = $(OPENAIR2_DIR)/RRC/LITE/MESSAGES
|
||||
|
||||
ifdef EMOS
|
||||
CFLAGS += -DEMOS
|
||||
endif
|
||||
|
||||
ifdef DEBUG_PHY
|
||||
CFLAGS += -DDEBUG_PHY
|
||||
endif
|
||||
|
||||
ifdef MeNBMUE
|
||||
CFLAGS += -DMeNBMUE
|
||||
endif
|
||||
|
||||
ifdef MU_RECEIVER
|
||||
CFLAGS += -DMU_RECEIVER
|
||||
endif
|
||||
|
||||
ifdef ZBF_ENABLED
|
||||
CFLAGS += -DNULL_SHAPE_BF_ENABLED
|
||||
endif
|
||||
|
||||
ifdef RANDOM_BF
|
||||
CFLAGS += -DRANDOM_BF
|
||||
endif
|
||||
|
||||
ifdef PBS_SIM
|
||||
CFLAGS += -DPBS_SIM
|
||||
endif
|
||||
|
||||
ifdef XFORMS
|
||||
CFLAGS += -DXFORMS
|
||||
LFLAGS += -lforms
|
||||
endif
|
||||
|
||||
ifdef PERFECT_CE
|
||||
CFLAGS += -DPERFECT_CE
|
||||
endif
|
||||
|
||||
CFLAGS += -DNO_RRM -DOPENAIR2 #-DPHY_ABSTRACTION
|
||||
|
||||
CFLAGS += -I/usr/include/X11 -I/usr/X11R6/include
|
||||
|
||||
|
||||
all: colabsim
|
||||
|
||||
include $(TOP_DIR)/PHY/Makefile.inc
|
||||
#SCHED_OBJS = $(TOP_DIR)/SCHED/phy_procedures_lte_common.o $(TOP_DIR)/SCHED/phy_procedures_lte_eNb.o $(TOP_DIR)/SCHED/phy_procedures_lte_ue.o
|
||||
include $(TOP_DIR)/SCHED/Makefile.inc
|
||||
include $(TOP_DIR)/SIMULATION/Makefile.inc
|
||||
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
|
||||
include $(OPENAIR2_DIR)/UTIL/Makefile.inc
|
||||
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
|
||||
|
||||
CFLAGS += $(L2_incl) -I$(ASN1_MSG_INC) -I$(TOP_DIR) -I$(OPENAIR3) ${UTIL_incl}
|
||||
#EXTRA_CFLAGS =
|
||||
|
||||
#STATS_OBJS += $(TOP_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_proc.o
|
||||
|
||||
#LAYER2_OBJ += $(OPENAIR2_DIR)/LAYER2/MAC/rar_tools.o
|
||||
LAYER2_OBJ = $(OPENAIR2_DIR)/LAYER2/MAC/lte_transport_init.o
|
||||
|
||||
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(LAYER2_OBJ) $(LOG_OBJS) #$(ASN1_MSG_OBJS)
|
||||
|
||||
ifdef XFORMS
|
||||
OBJ += ../../USERSPACE_TOOLS/SCOPE/lte_scope.o
|
||||
endif
|
||||
|
||||
$(OBJ) : %.o : %.c
|
||||
@echo
|
||||
@echo Compiling $< ...
|
||||
@$(CC) -c $(CFLAGS) -o $@ $<
|
||||
|
||||
colabsim : $(OBJ) colabsim.c
|
||||
@echo "Compiling colabsim.c ..."
|
||||
@$(CC) colabsim.c -o colabsim $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas
|
||||
|
||||
clean :
|
||||
rm -f $(OBJ)
|
||||
rm -f *.o
|
||||
|
||||
cleanall : clean
|
||||
rm -f colabsim
|
||||
rm -f *.exe*
|
||||
|
||||
showcflags :
|
||||
@echo $(CFLAGS)
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
* TDD mode 1
|
||||
* [du]lsch_ue_col for collaborative links
|
||||
* Define TBS_FIX (pilots for several CH)
|
||||
* Document output result file format
|
||||
* Add end-to-end HARQ strategy
|
||||
* AMC?
|
||||
* Describe placement of data in LTE frame
|
||||
* Automatic RB allocation
|
||||
* MR bler statistics
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,86 @@
|
||||
function r = read_results(f)
|
||||
%r = read_results(f)
|
||||
%
|
||||
%Reads colabsim simulation results from file f.
|
||||
%
|
||||
%Arguments:
|
||||
% f - results file (produced with -r option to colabsim)
|
||||
%
|
||||
%Returns:
|
||||
% r - results structure with the following fields:
|
||||
% n_relays: number of relays
|
||||
% channel_model: the used channel model as a string
|
||||
% n_tests: the number of tests done (each with different SNR)
|
||||
% n_pdu: the number of sent MAC PDUs for each test
|
||||
% n_harq: the maximum number of HARQ rounds
|
||||
% tests: struct array of length n_tests containing the following fields:
|
||||
% snr_hop{1,2}: SNRs for each link in hop {1,2}
|
||||
% n_frames_hop{1,2}: number of transmitted LTE frames in hop {1,2}
|
||||
% n_bits_hop{1,2}: number of correctly received information bits in hop {1,2}
|
||||
% n_pdu_success_hop{1,2}: number of correctly received MAC PDUs in hop {1,2}
|
||||
% ber_hop1: vector of average raw BER at relays
|
||||
% ber_hop2: average raw BER at destination CH
|
||||
% n_harq_tries_hop{1,2}: number of transmitted MAC PDUs in each HARQ round in hop {1,2}
|
||||
% n_harq_success_hop{1,2}: number of successfully decoded MAC PDUs in each HARQ round in hop {1,2}
|
||||
% mcs_hop{1,2}: MCS used in each transmission in hop {1,2}
|
||||
% tbs_hop{1,2}: TBS used in each transmission in hop {1,2}
|
||||
% n_rb_hop{1,2}: number of resource blocks used in each transmission in hop {1,2}
|
||||
% n_transmissions: distribution of the number of required transmissions in each hop for the
|
||||
% successfully decoded MAC PDUs, n_transmissions(n1,n2) is the number of successfully decoded
|
||||
% MAC PDUs that required n1 transmissions in hop 1 and n2 transmissions in hop 2
|
||||
% relay_activity: number of transmissions with different cooperation level of relays,
|
||||
% for n_relays==2 there are four values: [0 MR1 MR2 MR1+MR2], this is for all transmissions
|
||||
% over hop 2, even if the PDU was not finally received at the destination CH
|
||||
|
||||
fid = fopen(f, 'r');
|
||||
|
||||
A = mread(fid, 1, 5);
|
||||
r.n_relays = A(1);
|
||||
r.channel_model = parse_channel(A(2));
|
||||
r.n_tests = A(3);
|
||||
r.n_pdu = A(4);
|
||||
r.n_harq = A(5);
|
||||
|
||||
n_relays = A(1);
|
||||
n_tests = A(3);
|
||||
n_pdu = A(4);
|
||||
n_harq = A(5);
|
||||
|
||||
test_row = 1;
|
||||
for test = 1:n_tests
|
||||
r.tests(test).snr_hop1 = mread(fid, 1, n_relays);
|
||||
r.tests(test).snr_hop2 = mread(fid, 1, n_relays);
|
||||
A = mread(fid, 1, 6);
|
||||
r.tests(test).n_frames_hop1 = A(1);
|
||||
r.tests(test).n_frames_hop2 = A(2);
|
||||
r.tests(test).n_bits_hop1 = A(3);
|
||||
r.tests(test).n_bits_hop2 = A(4);
|
||||
r.tests(test).n_pdu_success_hop1 = A(5);
|
||||
r.tests(test).n_pdu_success_hop2 = A(6);
|
||||
A = mread(fid, 1, n_relays+1);
|
||||
r.tests(test).ber_hop1 = A(1:end-1);
|
||||
r.tests(test).ber_hop2 = A(end);
|
||||
r.tests(test).n_harq_tries_hop1 = mread(fid, 1, n_harq);
|
||||
r.tests(test).n_harq_success_hop1 = mread(fid, 1, n_harq);
|
||||
r.tests(test).n_harq_tries_hop2 = mread(fid, 1, n_harq);
|
||||
r.tests(test).n_harq_success_hop2 = mread(fid, 1, n_harq);
|
||||
r.tests(test).mcs_hop1 = mread(fid, n_pdu, n_harq);
|
||||
r.tests(test).mcs_hop2 = mread(fid, n_pdu, n_harq);
|
||||
r.tests(test).tbs_hop1 = mread(fid, n_pdu, n_harq);
|
||||
r.tests(test).tbs_hop2 = mread(fid, n_pdu, n_harq);
|
||||
r.tests(test).n_rb_hop1 = mread(fid, n_pdu, n_harq);
|
||||
r.tests(test).n_rb_hop2 = mread(fid, n_pdu, n_harq);
|
||||
r.tests(test).n_transmissions = mread(fid, n_harq, n_harq);
|
||||
r.tests(test).relay_activity = mread(fid, 1, 2^n_relays);
|
||||
end
|
||||
|
||||
fclose(fid);
|
||||
|
||||
function s = parse_channel(c)
|
||||
|
||||
s = sprintf('%d', c);
|
||||
|
||||
function A = mread(fid, nrow, ncol)
|
||||
|
||||
A = fscanf(fid, '%f', [ncol,nrow])';
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
#CC = $(shell if [ $(OSTYPE) = "cygwin" ]; then echo "gcc-4"; else echo "gcc"; fi)
|
||||
#CC = gcc-4.3
|
||||
|
||||
SSE3PROC = $(shell echo `grep ssse3 /proc/cpuinfo`)
|
||||
SSE4PROC = $(shell echo `grep sse4 /proc/cpuinfo`)
|
||||
CPUFLAGS = -mmmx -msse -msse2 -m32 -mssse3 #-msse4
|
||||
#CPUFLAGS += $(shell if [ -z $(SSE3PROC) ]; then echo "" ; else echo "-mssse3"; fi)
|
||||
#CPUFLAGS += $(shell if [ -z $(SSE4PROC) ]; then echo "" ; else echo "-msse4"; fi)
|
||||
|
||||
TOP_DIR = $(OPENAIR1_DIR)
|
||||
OPENAIR1_TOP = $(OPENAIR1_DIR)
|
||||
OPENAIR2_TOP = $(OPENAIR2_DIR)
|
||||
OPENAIR3 = $(OPENAIR3_DIR)
|
||||
|
||||
CFLAGS = -O2 -Wall -fno-common -mpreferred-stack-boundary=4 -fno-strict-aliasing -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 -g -ggdb -rdynamic $(CPUFLAGS) -DMALLOC_CHECK_=1 # -Wno-packed-bitfield-compat
|
||||
|
||||
LFLAGS = -lm -lblas -lxml2 -lrt
|
||||
|
||||
GCCVERSION = $(shell gcc --version | grep ^gcc | sed 's/^.* //g')
|
||||
ifeq "$(GCCVERSION)" "4.4.3"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
ifeq "$(GCCVERSION)" "4.5.2"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
ifeq "$(GCCVERSION)" "4.6.1"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
|
||||
CFLAGS += -DOPENAIR_LTE #-DOFDMA_ULSCH #-DIFFT_FPGA -DIFFT_FPGA_UE
|
||||
#CFLAGS += -DTBS_FIX
|
||||
CFLAGS += -DCELLULAR
|
||||
|
||||
ASN1_MSG_INC = $(OPENAIR2_DIR)/RRC/LITE/MESSAGES
|
||||
|
||||
ifdef EMOS
|
||||
CFLAGS += -DEMOS
|
||||
endif
|
||||
|
||||
ifdef DEBUG_PHY
|
||||
CFLAGS += -DDEBUG_PHY
|
||||
endif
|
||||
|
||||
ifdef MeNBMUE
|
||||
CFLAGS += -DMeNBMUE
|
||||
endif
|
||||
|
||||
ifdef MU_RECEIVER
|
||||
CFLAGS += -DMU_RECEIVER
|
||||
endif
|
||||
|
||||
ifdef ZBF_ENABLED
|
||||
CFLAGS += -DNULL_SHAPE_BF_ENABLED
|
||||
endif
|
||||
|
||||
ifdef RANDOM_BF
|
||||
CFLAGS += -DRANDOM_BF
|
||||
endif
|
||||
|
||||
ifdef PBS_SIM
|
||||
CFLAGS += -DPBS_SIM
|
||||
endif
|
||||
|
||||
# Debugging flags
|
||||
#CFLAGS += -DDEBUG_DLSCH_CODING
|
||||
#CFLAGS += -DDEBUG_DLSCH_DECODING
|
||||
#CFLAGS += -DDEBUG_LOGMAP
|
||||
|
||||
# Always use this flag with relaysim. Will be fixed in future versions.
|
||||
CFLAGS += -DREL_AMPLIFY_FORWARD
|
||||
|
||||
# Use this flag if you want to run relaysim with only 1 relay node.
|
||||
#CFLAGS += -DSINGLE_RELAY
|
||||
|
||||
# This is a flag to use different patterns for RVI (redundancy versions)
|
||||
# Normally it is (0,0,1,1). If you use this flag, it is used as (0,1,1,0).
|
||||
CFLAGS += -DRVI_PATTERN_ALT
|
||||
|
||||
# This flag is used in relayQMFsim where relays are Quantize-Forward relays.
|
||||
# with this option you get results which assumes there is no error in the first link (Source-Relays).
|
||||
# This kind of an upper bound to the performance of QMF relays in this scenario after LLR adjustment at the destination.
|
||||
#CFLAGS += -DQF_UPPER_BOUND
|
||||
|
||||
CFLAGS += -DNO_RRM #-DOPENAIR2 -DPHY_ABSTRACTION
|
||||
|
||||
ifdef XFORMS
|
||||
CFLAGS += -DXFORMS
|
||||
LFLAGS += -lforms
|
||||
endif
|
||||
|
||||
ifdef PERFECT_CE
|
||||
CFLAGS += -DPERFECT_CE
|
||||
endif
|
||||
|
||||
ifdef BIT8_TX
|
||||
CFLAGS += -DBIT8_TX
|
||||
endif
|
||||
|
||||
CFLAGS += -DNO_RRM -DOPENAIR1 #-DOPENAIR2 #-DPHY_ABSTRACTION
|
||||
|
||||
CFLAGS += -I/usr/include/X11 -I/usr/X11R6/include
|
||||
|
||||
ifdef ENABLE_FXP
|
||||
CFLAGS += -DENABLE_FXP # Fxp only
|
||||
else
|
||||
ifdef ENABLE_FLP
|
||||
CFLAGS += -DENABLE_FLP # dual_stream_correlation(), channel_compensation_prec() and qam16_qam16_mu_mimo() are flp (independently)
|
||||
else
|
||||
ifdef ENABLE_FULL_FLP
|
||||
CFLAGS += -DENABLE_FULL_FLP # Flp inside of rx_pdsch() (dlsch_detection_mrc(), dual_stream_correlation(), channel_compensation_prec(), qam16_qam16_mu_mimo() and dlsch_16qam_16qam_llr)
|
||||
else
|
||||
CFLAGS += -DENABLE_FXP # Fxp only by default
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef COMPARE_FLP_AND_FXP
|
||||
CFLAGS += -DCOMPARE_FLP_AND_FXP
|
||||
endif
|
||||
|
||||
include $(TOP_DIR)/PHY/Makefile.inc
|
||||
#SCHED_OBJS = $(TOP_DIR)/SCHED/phy_procedures_lte_common.o $(TOP_DIR)/SCHED/phy_procedures_lte_eNb.o $(TOP_DIR)/SCHED/phy_procedures_lte_ue.o
|
||||
include $(TOP_DIR)/SCHED/Makefile.inc
|
||||
include $(TOP_DIR)/SIMULATION/Makefile.inc
|
||||
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
|
||||
include $(OPENAIR2_DIR)/UTIL/Makefile.inc
|
||||
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
|
||||
|
||||
CFLAGS += $(L2_incl) -I$(ASN1_MSG_INC) -I$(TOP_DIR) -I$(OPENAIR3) $(UTIL_incl)
|
||||
# EXTRA_CFLAGS =
|
||||
|
||||
#STATS_OBJS += $(TOP_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_proc.o
|
||||
|
||||
#LAYER2_OBJ += $(OPENAIR2_DIR)/LAYER2/MAC/rar_tools.o
|
||||
LAYER2_OBJ = $(OPENAIR2_DIR)/LAYER2/MAC/lte_transport_init.o
|
||||
|
||||
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(LAYER2_OBJ) $(LOG_OBJS) #$(ASN1_MSG_OBJS)
|
||||
#OBJ2 = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS)
|
||||
|
||||
ifdef XFORMS
|
||||
OBJ += ../../USERSPACE_TOOLS/SCOPE/lte_scope.o
|
||||
endif
|
||||
|
||||
OBJ += openair_hw.o
|
||||
|
||||
all: relaysim
|
||||
|
||||
$(OBJ) : %.o : %.c
|
||||
@echo
|
||||
@echo Compiling $< ...
|
||||
$(CC) -c $(CFLAGS) -o $@ $<
|
||||
|
||||
relaysim : $(OBJ) relaysim.c
|
||||
@echo "Compiling relaysim.c ..."
|
||||
$(CC) relaysim.c -o relaysim $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas
|
||||
|
||||
clean :
|
||||
rm -f $(OBJ)
|
||||
rm -f *.o
|
||||
|
||||
cleanall : clean
|
||||
rm -f relaysim
|
||||
rm -f *.exe*
|
||||
|
||||
showcflags :
|
||||
@echo $(CFLAGS)
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include <execinfo.h>
|
||||
#include <signal.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include "SIMULATION/TOOLS/defs.h"
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
#ifdef IFFT_FPGA
|
||||
#include "PHY/LTE_REFSIG/mod_table.h"
|
||||
#endif
|
||||
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h"
|
||||
#include "ARCH/COMMON/defs.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
|
||||
#include "SCHED/defs.h"
|
||||
#include "SCHED/extern.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
|
||||
|
||||
TX_RX_VARS dummy_tx_rx_vars;
|
||||
|
||||
|
||||
int pci_buffers[2*NB_ANTENNAS_RX];
|
||||
int openair_fd,fc;
|
||||
unsigned int bigphys_top;
|
||||
unsigned int mem_base;
|
||||
|
||||
|
||||
int setup_oai_hw(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
PHY_VARS_UE *phy_vars_ue,
|
||||
PHY_VARS_eNB *phy_vars_eNB) {
|
||||
int i,j;
|
||||
|
||||
frame_parms->dual_tx = 0;
|
||||
frame_parms->freq_idx = 0;
|
||||
fc = 0;
|
||||
|
||||
printf("Opening /dev/openair0\n");
|
||||
if ((openair_fd = open("/dev/openair0", O_RDWR)) <0) {
|
||||
fprintf(stderr,"Error %d opening /dev/openair0\n",openair_fd);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
ioctl(openair_fd,openair_DUMP_CONFIG,frame_parms);
|
||||
sleep(1);
|
||||
// ioctl(openair_fd,openair_GET_BUFFER,(void *)&fc);
|
||||
ioctl(openair_fd,openair_GET_VARS,&dummy_tx_rx_vars);
|
||||
ioctl(openair_fd,openair_GET_BIGPHYSTOP,(void *)&bigphys_top);
|
||||
|
||||
if (dummy_tx_rx_vars.TX_DMA_BUFFER[0]==NULL) {
|
||||
printf("pci_buffers not allocated\n");
|
||||
close(openair_fd);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
printf("BIGPHYS top 0x%x\n",bigphys_top);
|
||||
printf("RX_DMA_BUFFER[0] %p\n",dummy_tx_rx_vars.RX_DMA_BUFFER[0]);
|
||||
printf("TX_DMA_BUFFER[0] %p\n",dummy_tx_rx_vars.TX_DMA_BUFFER[0]);
|
||||
|
||||
mem_base = (unsigned int) mmap(0,
|
||||
BIGPHYS_NUMPAGES*4096,
|
||||
PROT_READ|PROT_WRITE,
|
||||
MAP_SHARED|MAP_FIXED,//MAP_SHARED,
|
||||
openair_fd,
|
||||
0);
|
||||
|
||||
if (mem_base != -1)
|
||||
msg("MEM base= 0x%x\n",mem_base);
|
||||
else {
|
||||
msg("Could not map physical memory\n");
|
||||
close(openair_fd);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (phy_vars_ue) {
|
||||
|
||||
// replace RX signal buffers with mmaped HW versions
|
||||
for (i=0;i<frame_parms->nb_antennas_rx;i++) {
|
||||
free(phy_vars_ue->lte_ue_common_vars.rxdata[i]);
|
||||
phy_vars_ue->lte_ue_common_vars.rxdata[i] = (s32*)((int)dummy_tx_rx_vars.RX_DMA_BUFFER[0]-bigphys_top+mem_base);
|
||||
printf("rxdata[%d] @ %p\n",i,phy_vars_ue->lte_ue_common_vars.rxdata[i]);
|
||||
}
|
||||
for (i=0;i<frame_parms->nb_antennas_tx;i++) {
|
||||
free(phy_vars_ue->lte_ue_common_vars.txdata[i]);
|
||||
phy_vars_ue->lte_ue_common_vars.txdata[i] = (s32*)((int)dummy_tx_rx_vars.TX_DMA_BUFFER[0]-bigphys_top+mem_base);
|
||||
printf("txdata[%d] @ %p\n",i,phy_vars_ue->lte_ue_common_vars.txdata[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (phy_vars_eNB) {
|
||||
// replace RX signal buffers with mmaped HW versions
|
||||
for (i=0;i<frame_parms->nb_antennas_rx;i++) {
|
||||
free(phy_vars_eNB->lte_eNB_common_vars.rxdata[0][i]);
|
||||
phy_vars_eNB->lte_eNB_common_vars.rxdata[0][i] = (s32*)((int)dummy_tx_rx_vars.RX_DMA_BUFFER[0]-bigphys_top+mem_base);
|
||||
printf("rxdata[%d] @ %p\n",i,phy_vars_eNB->lte_eNB_common_vars.rxdata[0][i]);
|
||||
}
|
||||
for (i=0;i<frame_parms->nb_antennas_tx;i++) {
|
||||
free(phy_vars_eNB->lte_eNB_common_vars.txdata[0][i]);
|
||||
phy_vars_eNB->lte_eNB_common_vars.txdata[0][i] = (s32*)((int)dummy_tx_rx_vars.TX_DMA_BUFFER[0]-bigphys_top+mem_base);
|
||||
printf("txdata[%d] @ %p\n",i,phy_vars_eNB->lte_eNB_common_vars.txdata[0][i]);
|
||||
for (j=0;j<16;j++) {
|
||||
printf("txbuffer %d: %x\n",j,phy_vars_eNB->lte_eNB_common_vars.txdata[0][i][j]);
|
||||
phy_vars_eNB->lte_eNB_common_vars.txdata[0][i][j] = 16-j;
|
||||
}
|
||||
// msync(openair_fd);
|
||||
}
|
||||
}
|
||||
|
||||
return(openair_fd);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
This file is created by Emre Atsan. emre.atsan@epfl.ch, ARNI, EPFL, CH.
|
||||
------------------------------------------------------------
|
||||
|
||||
Link level simulations for CONECT project Diamond Relay Network Scenario.
|
||||
|
||||
We assume Half-Duplex relays and a proper scheduling in which two relays never transmit at the same time.
|
||||
|
||||
* relaysim: This file is an extension to dlsim with additional channels created for the second source-relay and relay-destination paths. Relays are AF (Amplify-Forward relays in this simulation).
|
||||
* relayQMFsim: Similar to relaysim, except relays are Quantize-Forward relays.
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,185 @@
|
||||
CC = $(shell if [ $$OSTYPE = "cygwin" ] ; then echo "gcc-4"; else echo "gcc"; fi)
|
||||
#CC = gcc
|
||||
|
||||
SSE3PROC = $(shell echo `grep ssse3 /proc/cpuinfo`)
|
||||
SSE4PROC = $(shell echo `grep sse4 /proc/cpuinfo`)
|
||||
CPUFLAGS = -mmmx -msse -msse2 -m32 #-mssse3 -msse4
|
||||
CPUFLAGS += $(shell if [ -z $(SSE3PROC)]; then echo "" ; else echo "-mssse3"; fi)
|
||||
CPUFLAGS += $(shell if [ -z $(SSE4PROC)]; then echo "" ; else echo "-msse4"; fi)
|
||||
|
||||
TOP_DIR = ../..
|
||||
|
||||
CFLAGS = -Wall -fno-common -mpreferred-stack-boundary=4 -fno-strict-aliasing -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DMAX_MODULES=1 -DPHY_CONTEXT=1 -g -ggdb $(CPUFLAGS)
|
||||
|
||||
#CFLAGS = -Wall -Wno-packed-bitfield-compat -fno-common -mpreferred-stack-boundary=4 -fno-strict-aliasing -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DMAX_MODULES=1 -DPHY_CONTEXT=1 -g -ggdb $(CPUFLAGS)
|
||||
|
||||
CFLAGS += -DOPENAIR_LTE -DOFDMA_ULSCH #-DIFFT_FPGA #-O2
|
||||
CFLAGS += -DTBS_FIX
|
||||
|
||||
ifdef EMOS
|
||||
CFLAGS += -DEMOS
|
||||
endif
|
||||
|
||||
ifdef DEBUG_PHY
|
||||
CFLAGS += -DDEBUG_PHY
|
||||
endif
|
||||
|
||||
ifdef MeNBMUE
|
||||
CFLAGS += -DMeNBMUE
|
||||
endif
|
||||
|
||||
ifdef PBS_SIM
|
||||
CFLAGS += -DPBS_SIM
|
||||
endif
|
||||
|
||||
ifdef OPENAIR2
|
||||
CFLAGS += -DOPENAIR2
|
||||
endif
|
||||
|
||||
CFLAGS += -I$(OPENAIR2_DIR) -I$(OPENAIR3_DIR)/MESH -I$(OPENAIR2_DIR)/COMMON -I$(OPENAIR2_DIR)/LAYER2/RLC -I$(OPENAIR2_DIR)/UTIL/MEM -I$(OPENAIR2_DIR)/UTIL/MATH -I$(OPENAIR2_DIR)/UTIL/LISTS -I$(OPENAIR2_DIR)/LAYER2/RLC/AM -I$(OPENAIR2_DIR)/LAYER2/RLC/UM_v6.1.0_LITE -I$(OPENAIR2_DIR)/LAYER2/RLC/TM -I$(OPENAIR2_DIR)/UTIL/TIMER
|
||||
|
||||
|
||||
|
||||
PHY_OBJS = $(TOP_DIR)/PHY/LTE_TRANSPORT/pss.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/pilots.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dlsch_coding.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dlsch_modulation.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dlsch_demodulation.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dlsch_decoding.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dci_tools.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/uci_tools.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/lte_mcs.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/pbch.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dci.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/srs_modulation.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/drs_modulation.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/ulsch_modulation.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/ulsch_demodulation.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/ulsch_coding.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/ulsch_decoding.o
|
||||
#PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/rar_tools.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/phich.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/pcfich.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/MODULATION/ofdm_mod.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/MODULATION/slot_fep.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/MODULATION/slot_fep_ul.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_sync_time.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_adjust_sync.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_est_freq_offset.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_ue_measurements.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_eNB_measurements.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/adjust_gain.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_dl_cell_spec.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_gold.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_ul_ref.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/CODING/lte_segmentation.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/CODING/ccoding_byte.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/CODING/ccoding_byte_lte.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/CODING/3gpplte.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/CODING/crc_byte.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/CODING/3gpplte_turbo_decoder_sse.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/CODING/lte_rate_matching.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/CODING/rate_matching.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/CODING/viterbi.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/CODING/viterbi_lte.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/INIT/lte_init.o
|
||||
ifdef MeNBMUE
|
||||
#PHY_OBJS += $(TOP_DIR)/PHY/INIT/secsys_init.o
|
||||
endif
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/INIT/init_top.o
|
||||
ifdef OPENAIR2
|
||||
PHY_OBJS += $(TOP_DIR)/MAC_INTERFACE/init.o
|
||||
endif
|
||||
ifdef EMOS
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_dl_channel_estimation_emos.o
|
||||
endif
|
||||
ifdef OPENAIR2
|
||||
PHY_OBJS += $(OPENAIR2_DIR)/PHY_INTERFACE/mac_phy_primitives.o
|
||||
endif
|
||||
|
||||
SIMULATION_OBJS = $(TOP_DIR)/SIMULATION/TOOLS/gauss.o
|
||||
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/random_channel.o
|
||||
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/rangen_double.o
|
||||
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/taus.o
|
||||
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/multipath_channel.o
|
||||
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/rf.o
|
||||
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/adc.o
|
||||
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/dac.o
|
||||
|
||||
TOOLS_OBJS = $(TOP_DIR)/PHY/TOOLS/file_output.o
|
||||
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/fft.o
|
||||
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/log2_approx.o
|
||||
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/cmult_sv.o
|
||||
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/cmult_vv.o
|
||||
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/cdot_prod.o
|
||||
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/signal_energy.o
|
||||
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/dB_routines.o
|
||||
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/sqrt.o
|
||||
TOOLS_OBJS += $(TOP_DIR)/PHY/TOOLS/lte_dfts.o
|
||||
|
||||
SCHED_OBJS += $(TOP_DIR)/SCHED/phy_procedures_lte_common.o
|
||||
SCHED_OBJS += $(TOP_DIR)/SCHED/phy_procedures_lte_eNb.o
|
||||
SCHED_OBJS += $(TOP_DIR)/SCHED/phy_procedures_lte_ue.o
|
||||
ifdef MeNBMUE
|
||||
SCHED_OBJS += $(TOP_DIR)/SCHED/phy_procedures_lte_MeNbMue.o
|
||||
endif
|
||||
|
||||
#STATS_OBJS += $(TOP_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_proc.o
|
||||
|
||||
LAYER2_OBJ += $(OPENAIR2_DIR)/LAYER2/MAC/rar_tools.o
|
||||
|
||||
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(STATS_OBJS) $(LAYER2_OBJ)
|
||||
OBJ2 = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS)
|
||||
|
||||
all: dlsim dlsim2 ulsim ulsim2 physim physim_secsys relays_sim relays_sim_dl relays_sim_harq relays_sim_harq2
|
||||
|
||||
test:
|
||||
echo $(OPENAIR2_DIR) $(LAYER2_OBJ)
|
||||
|
||||
$(OBJ) : %.o : %.c
|
||||
$(CC) -c $(CFLAGS) -I$(TOP_DIR) -o $@ $<
|
||||
|
||||
dlsim : $(OBJ2) dlsim.c
|
||||
$(CC) dlsim.c -I$(TOP_DIR) -o dlsim $(CFLAGS) $(OBJ2) -lm
|
||||
|
||||
dlsim2 : $(OBJ2) dlsim2.c
|
||||
$(CC) dlsim2.c -I$(TOP_DIR) -o dlsim2 $(CFLAGS) $(OBJ2) -lm
|
||||
|
||||
dlsim_secsys : $(OBJ2) dlsim_secsys.c
|
||||
$(CC) dlsim_secsys.c -I$(TOP_DIR) -o dlsim_secsys $(CFLAGS) $(OBJ2) -lm
|
||||
|
||||
ulsim : $(OBJ2) ulsim.c
|
||||
$(CC) ulsim.c -I$(TOP_DIR) -o ulsim $(CFLAGS) $(OBJ2) -lm
|
||||
|
||||
ulsim2 : $(OBJ2) ulsim2.c
|
||||
$(CC) ulsim2.c -I$(TOP_DIR) -o ulsim2 $(CFLAGS) $(OBJ2) -lm
|
||||
|
||||
physim : $(OBJ) phy_procedures_sim.c
|
||||
$(CC) phy_procedures_sim.c -I$(TOP_DIR) -o physim $(CFLAGS) $(OBJ) -lm
|
||||
|
||||
physim_secsys : $(OBJ) phy_procedures_sim_secsys.c
|
||||
$(CC) phy_procedures_sim_secsys.c -I$(TOP_DIR) -o physim_secsys $(CFLAGS) $(OBJ) -lm
|
||||
|
||||
relays_sim : $(OBJ2) relays_sim.c
|
||||
$(CC) relays_sim.c -I$(TOP_DIR) -o relaysim $(CFLAGS) $(OBJ2) -lm
|
||||
|
||||
relays_sim_dl : $(OBJ2) relays_sim_dl.c
|
||||
$(CC) relays_sim_dl.c -I$(TOP_DIR) -o relaysim_dl $(CFLAGS) $(OBJ2) -lm
|
||||
|
||||
relays_sim_harq : $(OBJ2) relays_sim_harq.c
|
||||
$(CC) relays_sim_harq.c -I$(TOP_DIR) -o relaysim_harq $(CFLAGS) $(OBJ2) -lm
|
||||
|
||||
relays_sim_harq2 : $(OBJ2) relays_sim_harq2.c
|
||||
$(CC) relays_sim_harq2.c -I$(TOP_DIR) -o relaysim_harq2 $(CFLAGS) $(OBJ2) -lm
|
||||
|
||||
clean:
|
||||
rm -f dlsim dlsim2 dlsim_secsys
|
||||
rm -f $(OBJ)
|
||||
rm -f *.o
|
||||
rm -f *.exe*
|
||||
|
||||
showcflags:
|
||||
@echo $(CFLAGS)
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
This file contains the details of the simulators used for BLER and Throughput measurements for a 2 Relay Distributed System:
|
||||
|
||||
1. relays_sim: To plot the overall BLER vs Uplink SNR, Uplink BLER vs Uplink SNR for a fixed value of downlink SNR. It also plots Throughput vs Uplink SNR for the entire system.
|
||||
|
||||
2. relays_sim_harq: HARQ Scheme 1: First the downlink phase transmits,even if one of the two relays decode, the signal is forwarded to destination otherwise retransmission at phase 1. If destination do not decode correctly, then retransmissions in the phase 2 take place.
|
||||
|
||||
It implements harq scheme 1 for cooperative schemes and plots the Uplink BLER vs Uplink SNR, overall BLER vs Uplink SNR and overall Throughput vs Uplink SNR.
|
||||
|
||||
3. relays_sim_harq2: HARQ Scheme 2: First the downlink phase transmits,even if one of the two relays decode, the signal is forwarded to destination otherwise retransmission at phase 1.If destination do not decode correctly, then two cases arise: If both the relays had decoded correctly, then retransmission in phase 2 takes place otherwise if only 1 relay had forwarded then retransmission takes place in phase 1.
|
||||
|
||||
It implements harq scheme 2 for cooperative schemes and plots the Uplink BLER vs Uplink SNR, overall BLER vs Uplink SNR and overall Throughput vs Uplink SNR.
|
||||
|
||||
|
||||
Flags to change: 1. COLLABRATIVE_SCHEME: If not set, then the simulator is for a single relay case. If set, then it performs cooperative schemes
|
||||
2. relay_flag: If 1, then only one relay. If 2, then 2 relays
|
||||
3. diversity_scheme: If 0, then no diversity scheme. If 1, then Delay Diversity Scheme and if 2, then Distributed Alamouti Scheme
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,212 @@
|
||||
# Doxyfile 1.3.8
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = FEMTOSIM
|
||||
PROJECT_NUMBER =
|
||||
OUTPUT_DIRECTORY =
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF =
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH =
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
INHERIT_DOCS = NO
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
TAB_SIZE = 8
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
SUBGROUPING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = YES
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_STATIC = NO
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
EXTRACT_LOCAL_METHODS = YES
|
||||
HIDE_UNDOC_MEMBERS = YES
|
||||
HIDE_UNDOC_CLASSES = YES
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = NO
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = NO
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = NO
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= NO
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = $(OPENAIR1_DIR)/SIMULATION/LTE_FEMTO/
|
||||
FILE_PATTERNS = *.h
|
||||
RECURSIVE = NO
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS =
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH = images
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = NO
|
||||
REFERENCES_RELATION = NO
|
||||
VERBATIM_HEADERS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = NO
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = NO
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = YES
|
||||
CHM_FILE = irs_openair.chm
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = YES
|
||||
TREEVIEW_WIDTH = 250
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES = amsmath amssymb
|
||||
LATEX_HEADER = header.tex
|
||||
PDF_HYPERLINKS = YES
|
||||
USE_PDFLATEX = YES
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = YES
|
||||
RTF_HYPERLINKS = YES
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = YES
|
||||
EXPAND_ONLY_PREDEF = YES
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED = OPENAIR_LTE=1 RLC_MODULE=1 RLC_C=1 RLC_MAC_C=1 RLC_RRC_C=1 RLC_AM_C=1 RLC_AM_MODULE=1 RLC_AM_REASSEMBLY_C=1 RLC_AM_IN_SDU_C=1 RLC_AM_RETRANSMIT_C=1 RLC_AM_RX_LIST_C=1 RLC_AM_SEGMENT_C=1 RLC_AM_SEGMENT_HOLES_C=1 RLC_AM_STATUS_REPORT_C=1 RLC_AM_TIMER_POLL_RETRANSMIT_C=1 RLC_AM_TIMER_POLL_REORDERING_C=1 RLC_AM_TIMER_STATUS_PROHIBIT_C=1 RLC_AM_WINDOWS_C=1 RLC_UM_MODULE=1 RLC_UM_C=1 RLC_TM_MODULE=1 RLC_UM_C=1 public_rlc(x)=x protected_rlc private_rlc(x)=x public_rlc_mac(x)=x protected_rlc_mac(x)=x private_rlc_mac(x)=x public_rlc_rrc(x)=x protected_rlc_rrc(x)=x private_rlc_rrc(x)=x public_rlc_am(x)=x protected_rlc_am(x)=x private_rlc_am(x)=x public_rlc_am_reassembly(x)=x protected_rlc_am_reassembly(x)=x private_rlc_am_reassembly(x)=x public_rlc_am_in_sdu(x)=x protected_rlc_am_in_sdu(x)=x private_rlc_am_in_sdu(x)=x private_rlc_am_receiver(x)=x protected_rlc_am_receiver(x)=x public_rlc_am_receiver(x)=x private_rlc_am_retransmit(x)=x protected_rlc_am_retransmit(x)=x public_rlc_am_retransmit(x)=x private_rlc_am_rx_list(x)=x protected_rlc_am_rx_list(x)=x public_rlc_am_rx_list(x)=x private_rlc_am_segment(x)=x protected_rlc_am_segment(x)=x public_rlc_am_segment(x)=x private_rlc_am_segments_holes(x)=x protected_rlc_am_segments_holes(x)=x public_rlc_am_segments_holes(x)=x private_rlc_am_status_report(x)=x protected_rlc_am_status_report(x)=x public_rlc_am_status_report(x)=x private_rlc_am_timer_poll_retransmit(x)=x protected_rlc_am_timer_poll_retransmit(x)=x public_rlc_am_timer_poll_retransmit(x)=x private_rlc_am_timer_reordering(x)=x protected_rlc_am_timer_reordering(x)=x public_rlc_am_timer_reordering(x)=x private_rlc_am_timer_status_prohibit(x)=x protected_rlc_am_timer_status_prohibit(x)=x public_rlc_am_timer_status_prohibit(x)=x private_rlc_am_windows(x)=x protected_rlc_am_windows(x)=x public_rlc_am_windows(x)=x public_rlc_um(x)=x protected_rlc_um(x)=x private_rlc_um(x)=x
|
||||
|
||||
EXPAND_AS_DEFINED = public_rlc(x)=x protected_rlc(x)=x private_rlc(x)=x public_rlc_mac(x)=x protected_rlc_mac(x)=x private_rlc_mac(x)=x public_rlc_rrc(x)=x protected_rlc_rrc(x)=x private_rlc_rrc(x)=x public_rlc_am(x)=x protected_rlc_am(x)=x private_rlc_am(x)=x public_rlc_am_reassembly(x)=x protected_rlc_am_reassembly(x)=x private_rlc_am_reassembly(x)=x public_rlc_am_in_sdu(x)=x protected_rlc_am_in_sdu(x)=x private_rlc_am_in_sdu(x)=x private_rlc_am_receiver(x)=x protected_rlc_am_receiver(x)=x public_rlc_am_receiver(x)=x private_rlc_am_retransmit(x)=x protected_rlc_am_retransmit(x)=x public_rlc_am_retransmit(x)=x private_rlc_am_rx_list(x)=x protected_rlc_am_rx_list(x)=x public_rlc_am_rx_list(x)=x private_rlc_am_segment(x)=x protected_rlc_am_segment(x)=x public_rlc_am_segment(x)=x private_rlc_am_segments_holes(x)=x protected_rlc_am_segments_holes(x)=x public_rlc_am_segments_holes(x)=x private_rlc_am_status_report(x)=x protected_rlc_am_status_report(x)=x public_rlc_am_status_report(x)=x private_rlc_am_timer_poll_retransmit(x)=x protected_rlc_am_timer_poll_retransmit(x)=x public_rlc_am_timer_poll_retransmit(x)=x private_rlc_am_timer_reordering(x)=x protected_rlc_am_timer_reordering(x)=x public_rlc_am_timer_reordering(x)=x private_rlc_am_timer_status_prohibit(x)=x protected_rlc_am_timer_status_prohibit(x)=x public_rlc_am_timer_status_prohibit(x)=x private_rlc_am_windows(x)=x protected_rlc_am_windows(x)=x public_rlc_am_windows(x)=x public_rlc_um(x)=x protected_rlc_um(x)=x private_rlc_um(x)=x
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = NO
|
||||
HIDE_UNDOC_RELATIONS = NO
|
||||
HAVE_DOT = NO
|
||||
CLASS_GRAPH = NO
|
||||
COLLABORATION_GRAPH = NO
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = NO
|
||||
INCLUDE_GRAPH = NO
|
||||
INCLUDED_BY_GRAPH = NO
|
||||
CALL_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = NO
|
||||
DOT_IMAGE_FORMAT = jpg
|
||||
DOT_PATH = "/usr/bin"
|
||||
DOTFILE_DIRS = ../docs/dotfiles
|
||||
@@ -0,0 +1,160 @@
|
||||
CPUFLAGS = -mmmx -msse -msse2 -m32 -mssse3 -msse4.1
|
||||
|
||||
TOP_DIR = $(OPENAIR1_DIR)
|
||||
OPENAIR1_TOP = $(OPENAIR1_DIR)
|
||||
OPENAIR2_TOP = $(OPENAIR2_DIR)
|
||||
OPENAIR3 = $(OPENAIR3_DIR)
|
||||
|
||||
CFLAGS = -Wall -fno-common -mpreferred-stack-boundary=4 -fno-strict-aliasing -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 -g -ggdb -rdynamic $(CPUFLAGS) -DMALLOC_CHECK_=1 # -Wno-packed-bitfield-compat -O2
|
||||
|
||||
CFLAGS += -DNEW_FFT
|
||||
|
||||
LFLAGS = -lm -lblas -lxml2 -lrt
|
||||
|
||||
ifdef GPIB
|
||||
LFLAGS += -lgpib
|
||||
endif
|
||||
|
||||
GCCVERSION = $(shell gcc --version | grep ^gcc | sed 's/^.* //g')
|
||||
ifeq "$(GCCVERSION)" "4.4.3"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
ifeq "$(GCCVERSION)" "4.5.2"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
ifeq "$(GCCVERSION)" "4.6.1"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
|
||||
CFLAGS += -DOPENAIR_LTE #-DOFDMA_ULSCH #-DIFFT_FPGA -DIFFT_FPGA_UE
|
||||
#CFLAGS += -DTBS_FIX
|
||||
CFLAGS += -DCELLULAR
|
||||
|
||||
ASN1_MSG_INC = $(OPENAIR2_DIR)/RRC/LITE/MESSAGES
|
||||
|
||||
ifdef EMOS
|
||||
CFLAGS += -DEMOS
|
||||
endif
|
||||
|
||||
ifdef DEBUG_PHY
|
||||
CFLAGS += -DDEBUG_PHY
|
||||
endif
|
||||
|
||||
ifdef MeNBMUE
|
||||
CFLAGS += -DMeNBMUE
|
||||
endif
|
||||
|
||||
ifdef MU_RECEIVER
|
||||
CFLAGS += -DMU_RECEIVER
|
||||
endif
|
||||
|
||||
ifdef ZBF_ENABLED
|
||||
CFLAGS += -DNULL_SHAPE_BF_ENABLED
|
||||
endif
|
||||
|
||||
ifdef RANDOM_BF
|
||||
CFLAGS += -DRANDOM_BF
|
||||
endif
|
||||
|
||||
ifdef PBS_SIM
|
||||
CFLAGS += -DPBS_SIM
|
||||
endif
|
||||
|
||||
ifdef XFORMS
|
||||
CFLAGS += -DXFORMS
|
||||
LFLAGS += -lforms
|
||||
endif
|
||||
|
||||
ifdef PERFECT_CE
|
||||
CFLAGS += -DPERFECT_CE
|
||||
endif
|
||||
|
||||
ifdef BIT8_TX
|
||||
CFLAGS += -DBIT8_TX
|
||||
endif
|
||||
|
||||
CFLAGS += -DNO_RRM -DOPENAIR1 #-DOPENAIR2 #-DPHY_ABSTRACTION
|
||||
|
||||
CFLAGS += -I/usr/include/X11 -I/usr/X11R6/include
|
||||
|
||||
ifdef ENABLE_FXP
|
||||
CFLAGS += -DENABLE_FXP # Fxp only
|
||||
else
|
||||
ifdef ENABLE_FLP
|
||||
CFLAGS += -DENABLE_FLP # dual_stream_correlation(), channel_compensation_prec() and qam16_qam16_mu_mimo() are flp (independently)
|
||||
else
|
||||
ifdef ENABLE_FULL_FLP
|
||||
CFLAGS += -DENABLE_FULL_FLP # Flp inside of rx_pdsch() (dlsch_detection_mrc(), dual_stream_correlation(), channel_compensation_prec(), qam16_qam16_mu_mimo() and dlsch_16qam_16qam_llr)
|
||||
else
|
||||
CFLAGS += -DENABLE_FXP # Fxp only by default
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef COMPARE_FLP_AND_FXP
|
||||
CFLAGS += -DCOMPARE_FLP_AND_FXP
|
||||
endif
|
||||
|
||||
ifdef RTAI
|
||||
CFLAGS += -DRTAI_ENABLED -D__IN_RTAI__ $(shell rtai-config --lxrt-cflags)
|
||||
LFLAGS += $(shell rtai-config --lxrt-ldflags) -llxrt
|
||||
endif
|
||||
|
||||
include $(TOP_DIR)/PHY/Makefile.inc
|
||||
SCHED_OBJS = $(TOP_DIR)/SCHED/phy_procedures_lte_common.o #$(TOP_DIR)/SCHED/phy_procedures_lte_eNb.o $(TOP_DIR)/SCHED/phy_procedures_lte_ue.o
|
||||
#include $(TOP_DIR)/SCHED/Makefile.inc
|
||||
include $(TOP_DIR)/SIMULATION/Makefile.inc
|
||||
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
|
||||
include $(OPENAIR2_DIR)/UTIL/Makefile.inc
|
||||
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
|
||||
|
||||
CFLAGS += $(L2_incl) -I$(ASN1_MSG_INC) -I$(TOP_DIR) -I$(OPENAIR3) $(UTIL_incl)
|
||||
# EXTRA_CFLAGS =
|
||||
|
||||
#STATS_OBJS += $(TOP_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_proc.o
|
||||
|
||||
#LAYER2_OBJ += $(OPENAIR2_DIR)/LAYER2/MAC/rar_tools.o
|
||||
#LAYER2_OBJ = $(OPENAIR2_DIR)/LAYER2/MAC/lte_transport_init.o
|
||||
|
||||
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(LAYER2_OBJ) $(LOG_OBJS)
|
||||
ifdef GPIB
|
||||
OBJ += LTE_Configuration.o
|
||||
endif
|
||||
#OBJ2 = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS)
|
||||
|
||||
ifdef XFORMS
|
||||
OBJ += ../../USERSPACE_TOOLS/SCOPE/lte_scope.o
|
||||
endif
|
||||
|
||||
OBJ += $(LOG_DIR)/vcd_signal_dumper.o
|
||||
|
||||
all: femtosim
|
||||
|
||||
#$(OBJ)
|
||||
femtosim : femtoUtils.o femtosim.c
|
||||
@echo "Compiling femtosim.c"
|
||||
@$(CC) -o femtosim femtosim.c femtoUtils.o $(CFLAGS) $(OBJ) $(LFLAGS) #-static -L/usr/lib/libblas #-lm -lblas
|
||||
|
||||
femtoUtils.o: $(OBJ) femtoUtils.h femtoUtils.c
|
||||
@echo "Compiling femtoUtils.c"
|
||||
@$(CC) -c femtoUtils.c $(CFLAGS) $(OBJ) $(LFLAGS) -L/usr/lib/libblas #-lm -lblas -DPERFECT_CE
|
||||
|
||||
Tester: Tester.c
|
||||
@$(CC) Tester.c -o Tester $(CFLAGS)
|
||||
|
||||
ComparaFile: ComparaFile.c
|
||||
@$(CC) ComparaFile.c -o ComparaFile
|
||||
|
||||
clean :
|
||||
rm -f $(OBJ)
|
||||
rm -f *.o
|
||||
|
||||
cleanall : clean
|
||||
rm -f femtosim
|
||||
rm -f *.exe*
|
||||
|
||||
#showflags :
|
||||
#@echo $(CFLAGS)
|
||||
#@echo $(LFLAGS)
|
||||
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
void main( int argc, char **argv){
|
||||
|
||||
|
||||
clock_t t_ini, t_fin;
|
||||
time_t tiempo = time(0);
|
||||
struct tm *tlocal ;
|
||||
char output[128];
|
||||
int i,j,h,x,z;
|
||||
|
||||
int interferencias[11];
|
||||
|
||||
interferencias[0]=-15;
|
||||
interferencias[1]=-5;
|
||||
interferencias[2]=-3;
|
||||
interferencias[3]=-2;
|
||||
interferencias[4]=-1;
|
||||
interferencias[5]=0;
|
||||
interferencias[6]=1;
|
||||
interferencias[7]=2;
|
||||
interferencias[8]=3;
|
||||
interferencias[9]=5;
|
||||
interferencias[10]=15;
|
||||
|
||||
FILE *output_fd ;
|
||||
output_fd= fopen("TesterControl.txt","w");
|
||||
double secs;
|
||||
|
||||
|
||||
char **pruebas;
|
||||
int n=(4*8*4*11)+1;
|
||||
|
||||
pruebas= (char **) malloc(n*sizeof(char *));
|
||||
|
||||
|
||||
|
||||
for(i=0;i<n; i++)
|
||||
{
|
||||
pruebas[i]=(char*)malloc(200*sizeof(char));
|
||||
}
|
||||
|
||||
|
||||
pruebas[0]= "./femtosim -n1000 -s0 -S25 -b0";
|
||||
|
||||
i=1;
|
||||
x=1;
|
||||
for(j=0;j<8;j++)
|
||||
{
|
||||
for(h=0;h<4;h++)
|
||||
{
|
||||
|
||||
for( z=0;z<11;z++)
|
||||
{
|
||||
//printf(" %d %d %d %d %d %d\n",interferencias[z],x,j,h,i,n);
|
||||
|
||||
sprintf(pruebas[i],"./femtosim -n1000 -s0 -S25 -a -I1 -w%d -b100%d -p%d,%d",interferencias[z],x,j,h);
|
||||
i++;
|
||||
sprintf(pruebas[i],"./femtosim -n1000 -s0 -S25 -a -I1 -w%d -b200%d -p%d,%d -A1 -D",interferencias[z],x,j,h);
|
||||
i++;
|
||||
sprintf(pruebas[i],"./femtosim -n1000 -s0 -S25 -I1 -w%d -b300%d -p%d,%d",interferencias[z],x,j,h);
|
||||
i++;
|
||||
sprintf(pruebas[i],"./femtosim -n1000 -s0 -S25 -I1 -w%d -b400%d -p%d,%d -A1 -D",interferencias[z],x,j,h);
|
||||
i++;
|
||||
x++;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
for(i=0;i<n;i++)
|
||||
{
|
||||
printf("\n%s",pruebas[i]);
|
||||
|
||||
t_ini = clock();
|
||||
fprintf(output_fd,"\n%s",pruebas[i]);
|
||||
tiempo = time(0);
|
||||
tlocal = localtime(&tiempo);
|
||||
strftime(output,128,"%d/%m/%y %H:%M:%S",tlocal);
|
||||
|
||||
fprintf(output_fd,"\n\tInicio: \t%s",output);
|
||||
|
||||
system(pruebas[i]);
|
||||
|
||||
|
||||
tiempo = time(0);
|
||||
tlocal = localtime(&tiempo);
|
||||
strftime(output,128,"%d/%m/%y %H:%M:%S",tlocal);
|
||||
|
||||
fprintf(output_fd,"\n\tFin: \t%s",output);
|
||||
|
||||
}
|
||||
fclose(output_fd);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,573 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <getopt.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <sys/stat.h>
|
||||
#include "femtoUtils.h"
|
||||
|
||||
#ifndef _FEMTO_UTILS
|
||||
|
||||
#include "PHY/types.h"
|
||||
#include "SIMULATION/TOOLS/defs.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h" //TVT:Navid
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void _parseOptions(options_t *opts, int argc, char ** argv) {
|
||||
char c;
|
||||
char aux[100];
|
||||
//int prob_flag=0;
|
||||
|
||||
static struct option long_options[] =
|
||||
{
|
||||
{"h", no_argument, 0, 'h'},
|
||||
{"s", required_argument, 0, 's'},
|
||||
{"S", required_argument, 0, 'S'},
|
||||
{"T", required_argument, 0, 'T'},
|
||||
{"n", required_argument, 0, 'n'},
|
||||
{"x", no_argument, 0, 'x'},
|
||||
{"d", no_argument, 0, 'd'},
|
||||
{"t", required_argument, 0, 't'},
|
||||
{"y", required_argument, 0, 'y'},
|
||||
{"z", required_argument, 0, 'z'},
|
||||
{"I", required_argument, 0, 'I'},
|
||||
{"j", required_argument, 0, 'j'},
|
||||
{"N", required_argument, 0, 'N'},
|
||||
{"o", required_argument, 0, 'o'},
|
||||
{"g", required_argument, 0, 'g'},
|
||||
{"f", no_argument, 0, 'f'},
|
||||
{"a", no_argument, 0, 'a'},
|
||||
{"b", required_argument, 0, 'b'},
|
||||
{"w", required_argument, 0, 'w'},
|
||||
{"k", required_argument, 0, 'k'},
|
||||
{"c", required_argument, 0, 'c'},
|
||||
{"e", no_argument, 0, 'e'},
|
||||
{"m", required_argument, 0, 'm'},
|
||||
{"A", required_argument, 0, 'A'},
|
||||
{"D", no_argument, 0, 'D'},
|
||||
{"p", no_argument, 0, 'p'},
|
||||
{"r", required_argument, 0, 'r'},
|
||||
{"p", required_argument, 0, 'p'},
|
||||
{"Q", required_argument, 0, 'Q'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
|
||||
int option_index = 0;
|
||||
|
||||
while ((c = getopt_long (argc, argv, "hs:S:T:n:xdt:y:z:I:j:N:o:g:fab:r:R:w:c:em:A:Dp:B:k:Q:",long_options, &option_index)) != -1)
|
||||
{
|
||||
//printf("%c %s\n",c,optarg);
|
||||
switch (c)
|
||||
{
|
||||
case 'a':
|
||||
opts->awgn_flag=1;
|
||||
opts->channel_model=AWGN;
|
||||
sprintf(opts->parameters,"%s -a",opts->parameters);
|
||||
break;
|
||||
case 'B':
|
||||
opts->N_RB_DL=atoi(optarg);
|
||||
break;
|
||||
case 'f':
|
||||
opts->fixed_channel_flag=1;
|
||||
sprintf(opts->parameters,"%s -f",opts->parameters);
|
||||
break;
|
||||
case 'D':
|
||||
if(opts->n_adj_cells==0 )
|
||||
{
|
||||
msg("First specify the number of adjuncts cells to estimate channel using -A #!\n");
|
||||
exit(-1);
|
||||
}
|
||||
opts->dual_stream_UE=1;
|
||||
sprintf(opts->parameters,"%s -D",opts->parameters);
|
||||
break;
|
||||
case 'e':
|
||||
opts->dci_flag=1;
|
||||
sprintf(opts->parameters,"%s -d",opts->parameters);
|
||||
break;
|
||||
case 'r':
|
||||
opts->DLSCH_RB_ALLOC = atoi(optarg);
|
||||
opts->rballocset = 1;
|
||||
break;
|
||||
case 's':
|
||||
opts->snr_init=atof(optarg);
|
||||
//opts->snr_max= opts->snr_init+5;
|
||||
sprintf(opts->parameters,"%s -s%f",opts->parameters,opts->snr_init);
|
||||
break;
|
||||
case 'S':
|
||||
opts->snr_max=atof(optarg);
|
||||
sprintf(opts->parameters,"%s -S%f",opts->parameters,opts->snr_max);
|
||||
break;
|
||||
case 'Q':
|
||||
opts->ratio=atoi(optarg);
|
||||
break;
|
||||
case 'T':
|
||||
opts->snr_step=atof(optarg);
|
||||
sprintf(opts->parameters,"%s -T%f",opts->parameters,opts->snr_step);
|
||||
break;
|
||||
case 'n':
|
||||
opts->nframes=atoi(optarg);
|
||||
sprintf(opts->parameters,"%s -n%d",opts->parameters,opts->nframes);
|
||||
break;
|
||||
case 'x':
|
||||
opts->extended_prefix_flag=1;
|
||||
sprintf(opts->parameters,"%s -x",opts->parameters);
|
||||
if (opts->extended_prefix_flag == 0)
|
||||
{
|
||||
opts->nsymb = 14 ;
|
||||
opts->pilot1 = 4;
|
||||
opts->pilot2 = 7;
|
||||
opts->pilot3 = 11;
|
||||
} else
|
||||
{
|
||||
opts->nsymb = 12;
|
||||
opts->pilot1 = 3;
|
||||
opts->pilot2 = 6;
|
||||
opts->pilot3 = 9;
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
opts->frame_type= 1;
|
||||
sprintf(opts->parameters,"%s -d",opts->parameters);
|
||||
break;
|
||||
case 't':
|
||||
opts->transmission_mode=atoi(optarg);
|
||||
sprintf(opts->parameters,"%s -t%d",opts->parameters,opts->transmission_mode);
|
||||
if ((opts->transmission_mode!=1) && (opts->transmission_mode!=2) && (opts->transmission_mode!=6))
|
||||
{
|
||||
printf("Unsupported transmission mode %d\n",opts->transmission_mode);
|
||||
exit(-1);
|
||||
}
|
||||
break;
|
||||
case 'y':
|
||||
opts->n_tx=atoi(optarg);
|
||||
sprintf(opts->parameters,"%s -y%d",opts->parameters,opts->n_tx);
|
||||
break;
|
||||
case 'z':
|
||||
opts->n_rx=atoi(optarg);
|
||||
sprintf(opts->parameters,"%s -z%d",opts->parameters, opts->n_rx);
|
||||
break;
|
||||
case 'I':
|
||||
opts->nInterf=atoi(optarg);
|
||||
sprintf(opts->parameters,"%s -I%d",opts->parameters, opts->nInterf);
|
||||
if(opts->nInterf>5 )
|
||||
{
|
||||
msg("Max num interferer = 5 \n");
|
||||
exit(-1);
|
||||
}
|
||||
break;
|
||||
case 'w':
|
||||
if(opts->nInterf==0 )
|
||||
{
|
||||
msg("First specify the number of interferer with -I# \n");
|
||||
exit(-1);
|
||||
}
|
||||
sprintf(aux,"%s",optarg);
|
||||
strcpy(opts->interfLevels,aux);
|
||||
sprintf(opts->parameters,"%s -w%s", opts->parameters,opts->interfLevels);
|
||||
|
||||
break;
|
||||
case 'k':
|
||||
if(opts->nInterf==0 )
|
||||
{
|
||||
msg("First specify the number of interferer with -I# \n");
|
||||
exit(-1);
|
||||
}
|
||||
sprintf(aux,"%s",optarg);
|
||||
strcpy(opts->interfProbability,aux);
|
||||
sprintf(opts->parameters,"%s -k%s", opts->parameters,opts->interfProbability);
|
||||
opts->prob_flag=1;
|
||||
break;
|
||||
case 'N':
|
||||
opts->Nid_cell = atoi(optarg);
|
||||
sprintf(opts->parameters,"%s -N%d",opts->parameters, opts->Nid_cell);
|
||||
break;
|
||||
case 'c':
|
||||
opts->interCellId = atoi(optarg);
|
||||
sprintf(opts->parameters,"%s -c%d",opts->parameters, opts->interCellId);
|
||||
break;
|
||||
case 'o':
|
||||
opts->oversampling=atoi(optarg);
|
||||
sprintf(opts->parameters,"%s -o%d",opts->parameters, opts->oversampling);
|
||||
break;
|
||||
case 'b':
|
||||
opts->testNumber=atoi(optarg);
|
||||
sprintf(opts->parameters,"%s -b%d",opts->parameters, opts->testNumber);
|
||||
break;
|
||||
case 'm':
|
||||
opts->mcs=atoi(optarg);
|
||||
sprintf(opts->parameters,"%s -b%d",opts->parameters, opts->mcs);
|
||||
break;
|
||||
case 'g':
|
||||
sprintf(opts->parameters,"%s -g%s",opts->parameters, optarg);
|
||||
switch ((char)*optarg) {
|
||||
case 'A':
|
||||
opts->channel_model=SCM_A;
|
||||
break;
|
||||
case 'B':
|
||||
opts->channel_model=SCM_B;
|
||||
break;
|
||||
case 'C':
|
||||
opts->channel_model=SCM_C;
|
||||
break;
|
||||
case 'D':
|
||||
opts->channel_model=SCM_D;
|
||||
break;
|
||||
case 'E':
|
||||
opts->channel_model=EPA;
|
||||
break;
|
||||
case 'F':
|
||||
opts->channel_model=EVA;
|
||||
break;
|
||||
case 'G':
|
||||
opts->channel_model=ETU;
|
||||
break;
|
||||
case 'H':
|
||||
opts->channel_model=Rayleigh8;
|
||||
break;
|
||||
case 'I':
|
||||
opts->channel_model=Rayleigh1;
|
||||
break;
|
||||
case 'J':
|
||||
opts->channel_model=Rayleigh1_corr;
|
||||
break;
|
||||
case 'K':
|
||||
opts->channel_model=Rayleigh1_anticorr;
|
||||
break;
|
||||
case 'L':
|
||||
opts->channel_model=Rice8;
|
||||
break;
|
||||
case 'M':
|
||||
opts->channel_model=Rice1;
|
||||
break;
|
||||
default:
|
||||
msg("Unsupported channel model! [A,B,C,D,E,F,G,H,I,J,K,L,M]\n");
|
||||
exit(-1);
|
||||
}
|
||||
break;
|
||||
case 'A':
|
||||
opts->n_adj_cells=atoi(optarg);
|
||||
sprintf(opts->parameters,"%s -b%d",opts->parameters, opts->n_adj_cells);
|
||||
break;
|
||||
case 'R':
|
||||
opts->num_rounds=atoi(optarg);
|
||||
sprintf(opts->parameters,"%s -R%d",opts->parameters, opts->num_rounds);
|
||||
if(opts->num_rounds>4 )
|
||||
{
|
||||
msg("Max num round = 4 \n");
|
||||
exit(-1);
|
||||
}
|
||||
opts->fix_rounds=1;
|
||||
break;
|
||||
case 'p':
|
||||
sprintf(aux,"%s",optarg);
|
||||
strcpy(opts->power,aux);
|
||||
sprintf(opts->parameters,"%s -w%s", opts->parameters,opts->power);
|
||||
_parsePower(opts);
|
||||
break;
|
||||
default:
|
||||
case 'h':
|
||||
printf("-h This message\n");
|
||||
printf("-s Starting SNR default value is %f\n",opts->snr_init);
|
||||
printf("-S Ending SNR default value is %f\n",opts->snr_max);
|
||||
printf("-T Step size of SNR, default value is %f\n",opts->snr_step);
|
||||
printf("-n Number of frames, default value is %d\n",opts->nframes);
|
||||
printf("-x Use extended prefix mode flag, default value is Normal\n");
|
||||
printf("-d Use TDD flag\n");
|
||||
printf("-t Transmission mode (1,2,6 for the moment),default value is %d\n",opts->transmission_mode);
|
||||
printf("-y Number of TX antennas used in eNB, default value is %d\n",opts->n_tx);
|
||||
printf("-z Number of RX antennas used in UE, default value is %d\n",opts->n_rx);
|
||||
printf("-I Number of interference to apply, default value is %d \n",opts->nInterf);
|
||||
printf("-w Relative strength of inteference list (in dB) separeted by ',' \n");
|
||||
printf("-N Nid_cell, default value is %d \n",opts->Nid_cell);
|
||||
printf("-o Oversampling factor (1,2,4,8,16), default value is %d \n",opts->oversampling);
|
||||
printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor), default value is AWGN\n");
|
||||
// printf("-f Output filename (.txt format) for Pe/SNR results\n");
|
||||
printf("-a Use AWGN channel and not multipath\n");
|
||||
printf("-b Test Number\n");
|
||||
printf("-c CellId Number for interferer\n");
|
||||
printf("-r ressource block allocation (see section 7.1.6.3 in 36.213\n");
|
||||
printf("-m MCS\n");
|
||||
printf("-D Enable interference cancellation\n");
|
||||
printf("-e Enable verification of DCI\n");
|
||||
printf("-A Indicates number of interfering to estimate, by default does not estimate the channel from the interfering\n");
|
||||
printf("-R Number of rounds\n");
|
||||
printf("-k Probability of each interferer list (0-1) separeted by ',' \n");
|
||||
printf("-f Use fixed data and channel\n");
|
||||
printf("-B Number of PRBs depending on the bandwidth\n");
|
||||
exit (-1);
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(opts->folderName,"%d_resp",opts->testNumber);
|
||||
if (opts->nInterf>0)
|
||||
{
|
||||
_parseInterferenceLevels(opts,opts->interfLevels,opts->nInterf);
|
||||
_parseInterferenceProbability(opts,opts->interfProbability,opts->nInterf);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void _printOptions(options_t *opts)
|
||||
{
|
||||
int i;
|
||||
printf("\n----------Options----------");
|
||||
printf("\nsnr_init:\t\t%f",opts->snr_init);
|
||||
printf("\nsnr_max:\t\t%f",opts->snr_max);
|
||||
printf("\nsnr_step:\t\t%f",opts->snr_step);
|
||||
printf("\nnframes:\t\t%d",opts->nframes);
|
||||
printf("\nextended_prefix_flag:\t%d",opts->extended_prefix_flag);
|
||||
printf("\nframe_type:\t\t%d",opts->frame_type);
|
||||
printf("\ntransmission_mode:\t%d",opts->transmission_mode);
|
||||
printf("\nn_tx:\t\t\t%d",opts->n_tx);
|
||||
printf("\nn_rx:\t\t\t%d",opts->n_rx);
|
||||
printf("\nNid_cell:\t\t%d",opts->Nid_cell);
|
||||
printf("\noversampling:\t\t%d",opts->oversampling);
|
||||
printf("\nchannel_model:\t\t%d",opts->channel_model);
|
||||
printf("\nchannel_modeli:\t\t%d",opts->channel_modeli);
|
||||
printf("\nawgn_flag:\t\t%d",opts->awgn_flag);
|
||||
printf("\nawgn_flagi:\t\t%d",opts->awgn_flagi);
|
||||
printf("\nnInterf:\t\t%d",opts->nInterf);
|
||||
printf("\nxx:%p",(void *)opts->outputFile);
|
||||
|
||||
for (i=0; i<opts->nInterf; i++)
|
||||
{
|
||||
printf("\n\tInterference n%d:%f (%f)",i+1,opts->dbInterf[i],opts->probabilityInterf[i]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
printf("\n");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void _parseInterferenceProbability(options_t *opts, char *interfProbability,int nInterf)
|
||||
{
|
||||
int i;
|
||||
char * pch;
|
||||
|
||||
opts->probabilityInterf=(double*)malloc(sizeof(double)*nInterf);
|
||||
for (i=0; i<nInterf; i++)
|
||||
{
|
||||
opts->probabilityInterf[i]=1.0;
|
||||
}
|
||||
if(opts->prob_flag)
|
||||
{
|
||||
pch = strtok (interfProbability,",");
|
||||
i=0;
|
||||
while (pch != NULL)
|
||||
{
|
||||
opts->probabilityInterf[i]=atof(pch);
|
||||
i++;
|
||||
pch = strtok (NULL,",");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void _parseInterferenceLevels(options_t *opts, char *interfLevels,int nInterf)
|
||||
{
|
||||
int i;
|
||||
char * pch;
|
||||
opts->dbInterf=(double*)malloc(sizeof(double)*nInterf);
|
||||
for (i=0; i<nInterf; i++)
|
||||
{
|
||||
opts->dbInterf[i]=0.0;
|
||||
}
|
||||
|
||||
pch = strtok (interfLevels,",");
|
||||
i=0;
|
||||
while (pch != NULL)
|
||||
{
|
||||
opts->dbInterf[i]=atof(pch);
|
||||
i++;
|
||||
pch = strtok (NULL,",");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void _allocData(options_t opts, data_t *data ,u8 n_tx,u8 n_rx, int Frame_length_complex_samples)
|
||||
{
|
||||
int i,j;
|
||||
data->s_re = (double**)malloc(n_tx*sizeof(double*));
|
||||
data->s_im = (double**)malloc(n_tx*sizeof(double*));
|
||||
data->r_re = (double**)malloc(n_rx*sizeof(double*));
|
||||
data->r_im = (double**)malloc(n_rx*sizeof(double*));
|
||||
|
||||
if(opts.nInterf>0)
|
||||
{
|
||||
data->is_re=(double***)malloc(opts.nInterf*sizeof(double**));
|
||||
data->is_im=(double***)malloc(opts.nInterf*sizeof(double**));
|
||||
data->ir_re=(double***)malloc(opts.nInterf*sizeof(double**));
|
||||
data->ir_im=(double***)malloc(opts.nInterf*sizeof(double**));
|
||||
for(i=0;i<opts.nInterf;i++)
|
||||
{
|
||||
data->is_re[i]=(double**)malloc(n_tx*sizeof(double*));
|
||||
data->is_im[i]=(double**)malloc(n_tx*sizeof(double*));
|
||||
data->ir_re[i]=(double**)malloc(n_rx*sizeof(double*));
|
||||
data->ir_im[i]=(double**)malloc(n_rx*sizeof(double*));
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<n_tx; i++)
|
||||
{
|
||||
|
||||
data->s_re[i] =(double*)malloc(Frame_length_complex_samples*sizeof(double));
|
||||
data->s_im[i] = (double*)malloc(Frame_length_complex_samples*sizeof(double));
|
||||
|
||||
bzero(data->s_re[i],Frame_length_complex_samples*sizeof(double));
|
||||
bzero(data->s_im[i],Frame_length_complex_samples*sizeof(double));
|
||||
|
||||
for(j=0;j<opts.nInterf;j++)
|
||||
{
|
||||
data->is_re[j][i] =(double*)malloc(Frame_length_complex_samples*sizeof(double));
|
||||
data->is_im[j][i] = (double*)malloc(Frame_length_complex_samples*sizeof(double));
|
||||
|
||||
bzero(data->is_re[j][i],Frame_length_complex_samples*sizeof(double));
|
||||
bzero(data->is_im[j][i],Frame_length_complex_samples*sizeof(double));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (i=0; i<n_rx; i++)
|
||||
{
|
||||
|
||||
data->r_re[i] =(double*)malloc(Frame_length_complex_samples*sizeof(double));
|
||||
data->r_im[i] = (double*)malloc(Frame_length_complex_samples*sizeof(double));
|
||||
|
||||
bzero(data->r_re[i],Frame_length_complex_samples*sizeof(double));
|
||||
bzero(data->r_im[i],Frame_length_complex_samples*sizeof(double));
|
||||
|
||||
for(j=0;j<opts.nInterf;j++)
|
||||
{
|
||||
data->ir_re[j][i] =(double*)malloc(Frame_length_complex_samples*sizeof(double));
|
||||
data->ir_im[j][i] = (double*)malloc(Frame_length_complex_samples*sizeof(double));
|
||||
|
||||
bzero(data->ir_re[j][i],Frame_length_complex_samples*sizeof(double));
|
||||
bzero(data->ir_im[j][i],Frame_length_complex_samples*sizeof(double));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void copyDataFixed(data_t * origin,data_t * destination,options_t *opts, int Frame_length_complex_samples)
|
||||
{
|
||||
|
||||
int i,j;
|
||||
|
||||
int sizeData=4*opts->nInterf*sizeof(double**)+
|
||||
(opts->nInterf+1)*2*(opts->n_tx+opts->n_rx)*(sizeof(double*)+Frame_length_complex_samples*sizeof(double));
|
||||
|
||||
printf("Copying sizeData: %d\n",sizeData);
|
||||
|
||||
opts->fixed_data_set=1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void _makeOutputDir(options_t *opts)
|
||||
{
|
||||
int status;
|
||||
char auxDir[100];
|
||||
char auxFile[100];
|
||||
FILE *controlFile;
|
||||
|
||||
status=mkdir ("testResults",S_IRWXU | S_IRWXG | S_IRWXO);
|
||||
// status=chdir("testResults");
|
||||
sprintf(auxDir,"%s",opts->folderName);
|
||||
//status=mkdir(auxDir,S_IRWXU | S_IRWXG | S_IRWXO);
|
||||
//status=chdir(auxDir);
|
||||
|
||||
sprintf(auxFile,"OutpuSimulation_%df_%dI_%sdB_%dch_%d.m",opts->nframes,opts->nInterf,opts->interfLevels,opts->channel_model,opts->testNumber);
|
||||
sprintf(auxFile,"Bler_%d.m",opts->testNumber);
|
||||
|
||||
opts->outputFile =fopen(auxFile,"w");
|
||||
|
||||
sprintf(auxFile,"OutputBlerRound_%d.m",opts->testNumber);
|
||||
|
||||
opts->outputBler =fopen(auxFile,"w");
|
||||
fprintf( opts->outputBler,"SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err\n");
|
||||
|
||||
sprintf(auxFile,"OutputBER_%d.m",opts->testNumber);
|
||||
opts->outputBer =fopen(auxFile,"w");
|
||||
|
||||
sprintf(auxFile,"Throughput_%d.m",opts->testNumber);
|
||||
opts->outputTrougput =fopen(auxFile,"w");
|
||||
|
||||
controlFile=fopen("ControlTest.txt","w");
|
||||
|
||||
fprintf(controlFile,"Parameters\n");
|
||||
|
||||
fprintf(controlFile,"./femtosim %s\n\n",opts->parameters);
|
||||
|
||||
|
||||
fprintf(controlFile,"testNumber:\t\t\n",opts->testNumber);
|
||||
|
||||
fprintf(controlFile,"awgn_flag:\t\t%d\n",opts->awgn_flag);
|
||||
fprintf(controlFile,"snr_init:\t\t%f\n",opts->snr_init);
|
||||
fprintf(controlFile,"snr_max;\t\t%f\n",opts->snr_max);
|
||||
fprintf(controlFile,"snr_step:\t\t%f\n",opts->snr_step);
|
||||
fprintf(controlFile,"nframes:\t\t%d\n",opts->nframes);
|
||||
fprintf(controlFile,"extended_prefix_flag:\t\t%d\n",opts->extended_prefix_flag);
|
||||
fprintf(controlFile,"frame_type:\t\t%d\n",opts->frame_type);
|
||||
fprintf(controlFile,"transmission_mode:\t\t%d\n",opts->transmission_mode);
|
||||
fprintf(controlFile,"n_tx:\t\t%d\n",opts->n_tx);
|
||||
fprintf(controlFile,"n_rx:\t\t%d\n",opts->n_rx);
|
||||
fprintf(controlFile,"nInterf:\t\t%d\n",opts->nInterf);
|
||||
fprintf(controlFile,"interfLevels:\t\t%s\n",opts->interfLevels);
|
||||
fprintf(controlFile,"Nid_cell:\t\t%d\n",opts->Nid_cell);
|
||||
fprintf(controlFile,"oversampling:\t\t%d\n",opts->oversampling);
|
||||
|
||||
fclose(controlFile);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void _parsePower(options_t *opts)
|
||||
{
|
||||
//printf("opts->power:%s\n",opts->power);
|
||||
int i;
|
||||
char * pch;
|
||||
pch=strtok (opts->power,",");
|
||||
if (pch != NULL)
|
||||
{
|
||||
opts->p_a=atoi(pch);
|
||||
pch=strtok (NULL,",");
|
||||
opts->p_b=atoi(pch);
|
||||
opts->d_offset=0;
|
||||
/* pch=strtok (NULL,",");
|
||||
opts->d_offset=atoi(pch); */
|
||||
}
|
||||
|
||||
if(opts->p_a< 0 || opts->p_a>7)
|
||||
{
|
||||
msg("Error -> PA (0...7) (dBm6, dBm477 ,dBm3 ,dBm177 ,dB0 ,dB1 ,dB2 ,dB3 )\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if(opts->p_b< 0 || opts->p_b>3)
|
||||
{
|
||||
msg("Error -> PB (0...3)\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* if(opts->d_offset< -6 || opts->d_offset>12)
|
||||
{
|
||||
msg("Error -> Offset (-6...12)\n");
|
||||
exit(1);
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
|
||||
#include "PHY/types.h"
|
||||
#include "SIMULATION/TOOLS/defs.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef _FEMTO_UTILS
|
||||
#define _FEMTO_UTILS
|
||||
|
||||
/*! \file SIMULATION/LTE_FEMTO/femtoUtils.h
|
||||
* \brief Defines structure and function headers
|
||||
* \author L. Garcia
|
||||
* \date 2012
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
///Top-level data Structure for general options of simulation and other global variables
|
||||
typedef struct {
|
||||
|
||||
double snr_init;
|
||||
double snr_max;
|
||||
double snr_step;
|
||||
int nframes;
|
||||
int fixed_channel_flag;
|
||||
int fixed_data_set;
|
||||
int extended_prefix_flag;
|
||||
|
||||
///Frame type (0 FDD, 1 TDD).
|
||||
u8 frame_type;
|
||||
///Transmission mode (1 for the moment)
|
||||
u8 transmission_mode;
|
||||
///Number of Transmit antennas in node.
|
||||
u8 n_tx;
|
||||
///Number of Receive antennas in node.
|
||||
u8 n_rx;
|
||||
///Number of interference to simulate
|
||||
int nInterf;
|
||||
///Array with interference level in dB
|
||||
double *dbInterf;
|
||||
double *probabilityInterf;
|
||||
char interfLevels[150];
|
||||
char interfProbability[150];
|
||||
|
||||
u16 Nid_cell;
|
||||
u16 tdd_config;
|
||||
u8 oversampling;
|
||||
SCM_t channel_model;
|
||||
SCM_t channel_modeli;
|
||||
int awgn_flag;
|
||||
int awgn_flagi;
|
||||
int nsymb;
|
||||
int num_layers;
|
||||
u16 n_rnti;
|
||||
///Modulation and code scheme
|
||||
u8 mcs;
|
||||
|
||||
|
||||
u8 pilot1,pilot2,pilot3;
|
||||
///Pointer to the output file SNRvsBLER
|
||||
FILE *outputFile;
|
||||
///Pointer to the output file errors and trials for each SNR
|
||||
FILE *outputBler;
|
||||
FILE *outputBer;
|
||||
FILE *outputTrougput;
|
||||
|
||||
u8 num_rounds;
|
||||
u8 fix_rounds;
|
||||
u8 subframe;
|
||||
// int eNB_id;
|
||||
/// Amplitude of QPSK symbols
|
||||
s16 amp;
|
||||
///1- Analysis of errors on DCI, 0- No analysis of errors in DCI
|
||||
u8 dci_flag;
|
||||
int testNumber;
|
||||
char folderName[50];
|
||||
char parameters[300];
|
||||
|
||||
int SIZE_TXDATAF;
|
||||
int SIZE_TXDATA;
|
||||
int SIZE_RXDATA;
|
||||
int SIZE_RXDATAF;
|
||||
|
||||
u16 interCellId;
|
||||
int n_adj_cells;
|
||||
u8 dual_stream_UE;
|
||||
|
||||
int perfect_ce;
|
||||
int common_flag;
|
||||
int TPC;
|
||||
u8 N_RB_DL;
|
||||
int rballocset;
|
||||
u32 DLSCH_RB_ALLOC;
|
||||
|
||||
PA_t p_a;
|
||||
u8 p_b;
|
||||
s8 d_offset;
|
||||
int ratio;
|
||||
int prob_flag;
|
||||
|
||||
char power[50];
|
||||
|
||||
} options_t;
|
||||
|
||||
/// Store signal data
|
||||
typedef struct {
|
||||
double **s_re;
|
||||
double **s_im;
|
||||
double **r_re;
|
||||
double **r_im;
|
||||
double ***is_re;
|
||||
double ***is_im;
|
||||
double ***ir_re;
|
||||
double ***ir_im;
|
||||
} data_t;
|
||||
|
||||
/// Parses the command line options and assigns values to pilots, num_symbols, etc. modified by the options selected
|
||||
void _parseOptions(options_t *opts, int argc, char ** argv);
|
||||
void _printOptions(options_t *opts);
|
||||
/// Interference Levels are recivend in form num,num,num this function parse the string and fill dbInterf array
|
||||
void _parseInterferenceLevels(options_t *opts, char *interfLevels,int nInterf);
|
||||
void _parseInterferenceProbability(options_t *opts, char *interfLevels,int nInterf);
|
||||
|
||||
|
||||
void _parsePower(options_t *opts);
|
||||
/// Allocate memory for signal data arrays
|
||||
void _allocData(options_t opts,data_t *data, u8 n_tx,u8 n_rx,int Frame_length_complex_samples);
|
||||
|
||||
void copyDataFixed(data_t *origin,data_t *destination,options_t *opts, int Frame_length_complex_samples);
|
||||
/// Generate output dir with the prefix specified in testNumber
|
||||
void _makeOutputDir(options_t *opts);
|
||||
|
||||
/// Initializes lte_frame_parms structure and make the structures of the eNB and EU involved in the simulation, including interference, if any.
|
||||
LTE_DL_FRAME_PARMS* _lte_param_init(options_t opts);
|
||||
/// Set defaults values for the simulations
|
||||
void _initDefaults(options_t *opts);
|
||||
/// Allocate and fill UL, CCCH and DLSCH structures
|
||||
void _fill_Ul_CCCH_DLSCH_Alloc(options_t opts);
|
||||
/// Allocate the eNB2UE structure for transmision and interference
|
||||
void _generatesRandomChannel(options_t opts);
|
||||
/** @brief This function allocates structures for a particular DLSCH at eNB.
|
||||
*
|
||||
* modifications will be required with more than 2 users
|
||||
* It's used to generate the dci. they contain informations such as the modulation and coding scheme
|
||||
* either if the transmit power control is required or not and so on...
|
||||
* dlsch_eNB can suport 8 users.
|
||||
* Create transport channel structures for 2 transport blocks (MIMO)
|
||||
*/
|
||||
void _allocDLSChannel(options_t opts);
|
||||
void _generateDCI(options_t opts,DCI_ALLOC_t *dci_alloc,DCI_ALLOC_t *dci_alloc_rx);//,u8 **input_buffer);
|
||||
u32 _allocRBs(options_t *opts, int ind);
|
||||
void _freeMemory(data_t data,options_t opts);
|
||||
void _makeSimulation(data_t data,options_t opts,DCI_ALLOC_t *dci_alloc,DCI_ALLOC_t *dci_alloc_rx,u32 *NB_RB2,LTE_DL_FRAME_PARMS *frame_parms,u8 num_pdcch_symbols);
|
||||
void _printResults(u32 *errs,u32 *round_trials,u32 dci_errors,double rate);
|
||||
void _printFileResults(double SNR, double rate,u32 *errs,u32 *round_trials,u32 dci_errors,options_t opts,double BER);
|
||||
void _initErrsRoundsTrials(u32 **errs,u32 **trials,int allocFlag,options_t opts);
|
||||
void _fillData(options_t opts,data_t data,int numSubFrames);
|
||||
void _applyNoise(options_t opts,data_t data,double sigma2,double iqim,int numSubFrames);
|
||||
u8 _generate_dci_top(int num_ue_spec_dci,int num_common_dci,DCI_ALLOC_t *dci_alloc,options_t opts,u8 num_pdcch_symbols);
|
||||
void do_OFDM_mod(mod_sym_t **txdataF, s32 **txdata, u16 next_slot, LTE_DL_FRAME_PARMS *frame_parms);
|
||||
//void _apply_Multipath_Noise_Interference(options_t opts,data_t data,data_t data_fixed,double sigma2_dB,double sigma2,int numSubFrames);
|
||||
void _apply_Multipath_Noise_Interference(options_t opts,data_t data,double sigma2_dB,double sigma2,int numSubFrames);
|
||||
void _writeOuputOneFrame(options_t opts,u32 coded_bits_per_codeword,short *uncoded_ber_bit,u32 tbs);
|
||||
void _dumpTransportBlockSegments(u32 C,u32 Cminus,u32 Kminus,u32 Kplus, u8 ** c_UE,u8 ** c_eNB);
|
||||
void _applyInterference(options_t opts,data_t data,double sigma2,double iqim,int numSubFrames);
|
||||
double compute_ber_soft(u8* ref, s16* rec, int n);
|
||||
void _fillPerfectChannelDescription(options_t opts,u8 l);
|
||||
|
||||
void _writeTxData(char *num,char *desc, int init, int numframes,options_t opts, int output,int senial);
|
||||
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
Executable
+47
@@ -0,0 +1,47 @@
|
||||
\documentclass[a4paper]{book}
|
||||
\usepackage{a4wide}
|
||||
\usepackage{makeidx}
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{graphicx}
|
||||
\usepackage{multicol}
|
||||
\usepackage{float}
|
||||
\usepackage{textcomp}
|
||||
\usepackage{alltt}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{amssymb}
|
||||
\ifx\pdfoutput\undefined
|
||||
\usepackage[ps2pdf,
|
||||
pagebackref=true,
|
||||
colorlinks=true,
|
||||
linkcolor=blue
|
||||
]{hyperref}
|
||||
\usepackage{pspicture}
|
||||
\else
|
||||
\usepackage[pdftex,
|
||||
pagebackref=true,
|
||||
colorlinks=true,
|
||||
linkcolor=blue
|
||||
]{hyperref}
|
||||
\fi
|
||||
\usepackage{doxygen}
|
||||
\usepackage{times}
|
||||
\makeindex
|
||||
\setcounter{tocdepth}{1}
|
||||
\renewcommand{\footrulewidth}{0.4pt}
|
||||
\begin{document}
|
||||
\begin{titlepage}
|
||||
\vspace*{7cm}
|
||||
\begin{center}
|
||||
{\Large openair Specifications }\\
|
||||
Phyiscal, Medium-Access, Radio-link Control, Packet Data Convergence Protocol and Radio Resource Control Layers\\
|
||||
\vspace*{1cm}
|
||||
{\large Generated by Doxygen 1.3.8}\\
|
||||
\vspace*{0.5cm}
|
||||
{\small Sun Oct 31 19:27:37 2004}\\
|
||||
\end{center}
|
||||
\end{titlepage}
|
||||
\clearemptydoublepage
|
||||
\pagenumbering{roman}
|
||||
\tableofcontents
|
||||
\clearemptydoublepage
|
||||
\pagenumbering{arabic}
|
||||
@@ -0,0 +1,4 @@
|
||||
Bler_1
|
||||
Bler_2
|
||||
semilogy(s1(:,1),s1(:,2),'b',s2(:,1),s2(:,2),'r');
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
close all
|
||||
fch0e
|
||||
fch1e
|
||||
figure;
|
||||
plot(abs(ch0e),'b'); title 'Estimated 0'
|
||||
hold on
|
||||
plot(abs(ch1e),'r');
|
||||
hold off
|
||||
dlsch0_ch_ext00
|
||||
dlsch1_ch_ext00
|
||||
figure;
|
||||
plot(abs(dl0_ch_ext00)); title 'Ext 0';
|
||||
hold on
|
||||
plot(abs(dl1_ch_ext00),'r');
|
||||
hold off
|
||||
|
||||
|
||||
dlsch0_rxF_comp0
|
||||
dlsch1_rxF_comp0
|
||||
figure;
|
||||
plot(dl0_rxF_comp0,'x') ;title 'Comp 0';
|
||||
figure;
|
||||
plot(dl1_rxF_comp0,'x');title 'Comp 1 interferer';
|
||||
|
||||
|
||||
dlsch0_rxF_llr
|
||||
rho
|
||||
figure;
|
||||
plot(real(rho_0),'x'); title 'Rho';
|
||||
figure;
|
||||
plot(dl0_llr,'x'); title 'Llr';
|
||||
@@ -0,0 +1,37 @@
|
||||
#close all
|
||||
dlsch0_rxF_comp0
|
||||
dlsch1_rxF_comp0
|
||||
figure;
|
||||
plot(dl0_rxF_comp0,'x') ;title 'Comp 0';
|
||||
figure;
|
||||
plot(dl1_rxF_comp0,'x');title 'Comp 1 interferer';
|
||||
#plot(s0(:,1),20*log(s0(:,2)));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#fch0e;
|
||||
#fch0p;
|
||||
#fch1e;
|
||||
#fch1p;
|
||||
#plot(abs(ch0e),'r');
|
||||
#hold on;
|
||||
#figure;plot(abs(ch0p),'b');
|
||||
#hold off;
|
||||
#figure;
|
||||
|
||||
#plot(abs(ch1e),'m');
|
||||
#hold on;
|
||||
#figure;plot(abs(ch1p),'g');
|
||||
#hold off;
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
fch0e
|
||||
fch1e
|
||||
figure;
|
||||
plot(abs(ch0e)); title 'Estimated 0'
|
||||
hold on
|
||||
plot(abs(ch1e),'r');
|
||||
@@ -0,0 +1,6 @@
|
||||
dlsch0_ch_ext00
|
||||
dlsch1_ch_ext00
|
||||
figure;
|
||||
plot(abs(dl0_ch_ext00)); title 'Ext 0';
|
||||
figure;
|
||||
plot(abs(dl1_ch_ext00)); title 'Ext 1 interferer';
|
||||
@@ -0,0 +1,6 @@
|
||||
dlsch0_rxF_ext0
|
||||
dlsch1_rxF_ext0
|
||||
figure;
|
||||
plot(abs(dl0_rxF_ext0)); title 'Ext 0';
|
||||
figure;
|
||||
plot(abs(dl1_rxF_ext0)); title 'Ext 1 interferer';
|
||||
@@ -0,0 +1,6 @@
|
||||
dlsch0_rxF_llr
|
||||
rho
|
||||
figure;
|
||||
plot(real(rho_0));
|
||||
figure;
|
||||
plot(dl0_llr,'x');
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,84 @@
|
||||
CC = $(shell if [ $$OSTYPE = "cygwin" ] ; then echo "gcc-4"; else echo "gcc"; fi)
|
||||
#CC = gcc-4
|
||||
|
||||
SSE3PROC = $(shell echo `grep ssse3 /proc/cpuinfo`)
|
||||
SSE4PROC = $(shell echo `grep sse4 /proc/cpuinfo`)
|
||||
CPUFLAGS = -mmmx -msse -msse2 -m32 #-mssse3 -msse4
|
||||
CPUFLAGS += $(shell if [ -z $(SSE3PROC) ]; then echo "" ; else echo "-mssse3"; fi)
|
||||
CPUFLAGS += $(shell if [ -z $(SSE4PROC) ]; then echo "" ; else echo "-msse4"; fi)
|
||||
|
||||
TOP_DIR = ../..
|
||||
|
||||
#CFLAGS = -O2 -Wall -fno-common -mpreferred-stack-boundary=4 -fno-strict-aliasing -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DMAX_MODULES=1 -DPHY_CONTEXT=1 -g -ggdb $(CPUFLAGS)
|
||||
|
||||
CFLAGS = -Wall -Wno-packed-bitfield-compat -fno-common -mpreferred-stack-boundary=4 -fno-strict-aliasing -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DMAX_MODULES=1 -DPHY_CONTEXT=1 -g -ggdb $(CPUFLAGS)
|
||||
|
||||
CFLAGS += -DOPENAIR_LTE -DOFDMA_ULSCH #-DIFFT_FPGA -DIFFT_FPGA_UE
|
||||
CFLAGS += -DTBS_FIX
|
||||
CFLAGS += -DCELLULAR
|
||||
|
||||
ifdef EMOS
|
||||
CFLAGS += -DEMOS
|
||||
endif
|
||||
|
||||
ifdef DEBUG_PHY
|
||||
CFLAGS += -DDEBUG_PHY
|
||||
endif
|
||||
|
||||
ifdef OPENAIR2
|
||||
CFLAGS += -DOPENAIR2
|
||||
endif
|
||||
|
||||
CFLAGS += -I$(OPENAIR2_DIR) -I$(OPENAIR3_DIR)/MESH -I$(OPENAIR2_DIR)/COMMON -I$(OPENAIR2_DIR)/LAYER2/RLC -I$(OPENAIR2_DIR)/UTIL/MEM -I$(OPENAIR2_DIR)/UTIL/MATH -I$(OPENAIR2_DIR)/UTIL/LISTS -I$(OPENAIR2_DIR)/LAYER2/RLC/AM -I$(OPENAIR2_DIR)/LAYER2/RLC/UM_v6.1.0_LITE -I$(OPENAIR2_DIR)/LAYER2/RLC/TM -I$(OPENAIR2_DIR)/UTIL/TIMER -I/usr/include/X11 -I/usr/X11R6/include
|
||||
|
||||
include $(TOP_DIR)/PHY/Makefile.inc
|
||||
include $(TOP_DIR)/SCHED/Makefile.inc
|
||||
|
||||
SIMULATION_OBJS = $(TOP_DIR)/SIMULATION/TOOLS/gauss.o
|
||||
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/random_channel.o
|
||||
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/rangen_double.o
|
||||
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/taus.o
|
||||
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/multipath_channel.o
|
||||
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/rf.o
|
||||
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/adc.o
|
||||
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/RF/dac.o
|
||||
|
||||
#STATS_OBJS += $(TOP_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_proc.o
|
||||
|
||||
LAYER2_OBJ += $(OPENAIR2_DIR)/LAYER2/MAC/rar_tools.o
|
||||
|
||||
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(STATS_OBJS) $(LAYER2_OBJ)
|
||||
OBJ2 = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(TOP_DIR)/SCHED/phy_procedures_lte_common.o $(TOP_DIR)/SCHED/phy_procedures_lte_ue.o
|
||||
|
||||
all: dlsim dlsim2 ulsim ulsim2 physim physim_secsys
|
||||
|
||||
test: $(SIMULATION_OBJS) $(TOOLS_OBJS) $(TOP_DIR)/PHY/INIT/lte_init.o test.c
|
||||
$(CC) test.c -I$(TOP_DIR) -o test $(CFLAGS) $(SIMULATION_OBJS) $(TOOLS_OBJS) -lm
|
||||
|
||||
%.o : %.c
|
||||
$(CC) -c $(CFLAGS) -I$(TOP_DIR) -o $@ $<
|
||||
|
||||
dlsim : $(OBJ2) dlsim.c
|
||||
$(CC) dlsim.c -I$(TOP_DIR) -o dlsim $(CFLAGS) $(OBJ2) -lm -lblas
|
||||
|
||||
dlsim2 : $(OBJ2) dlsim2.c
|
||||
$(CC) dlsim2.c -I$(TOP_DIR) -o dlsim2 $(CFLAGS) $(OBJ2) -lm -lblas
|
||||
|
||||
ulsim : $(OBJ2) ulsim.c ulsim_form.c
|
||||
$(CC) ulsim.c ulsim_form.c -I$(TOP_DIR) -o ulsim $(CFLAGS) $(OBJ2) -lm -lforms -L/usr/local/lib -lforms -lX11 -L/usr/X11R6/lib -lXpm
|
||||
|
||||
ulsim2 : $(OBJ2) ulsim2.c
|
||||
$(CC) ulsim2.c -I$(TOP_DIR) -o ulsim2 $(CFLAGS) $(OBJ2) -lm
|
||||
|
||||
physim : $(OBJ) phy_procedures_sim.c
|
||||
$(CC) phy_procedures_sim.c -I$(TOP_DIR) -o physim $(CFLAGS) $(OBJ) -lm
|
||||
|
||||
clean:
|
||||
rm -f dlsim dlsim2 ulsim ulsim2 physim
|
||||
rm -f $(OBJ)
|
||||
rm -f *.o
|
||||
rm -f *.exe*
|
||||
|
||||
showcflags:
|
||||
@echo $(CFLAGS)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+4702
File diff suppressed because it is too large
Load Diff
+1100
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,745 @@
|
||||
|
||||
%% bare_jrnl.tex
|
||||
%% V1.3
|
||||
%% 2007/01/11
|
||||
%% by Michael Shell
|
||||
%% see http://www.michaelshell.org/
|
||||
%% for current contact information.
|
||||
%%
|
||||
%% This is a skeleton file demonstrating the use of IEEEtran.cls
|
||||
%% (requires IEEEtran.cls version 1.7 or later) with an IEEE journal paper.
|
||||
%%
|
||||
%% Support sites:
|
||||
%% http://www.michaelshell.org/tex/ieeetran/
|
||||
%% http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/
|
||||
%% and
|
||||
%% http://www.ieee.org/
|
||||
|
||||
|
||||
|
||||
% *** Authors should verify (and, if needed, correct) their LaTeX system ***
|
||||
% *** with the testflow diagnostic prior to trusting their LaTeX platform ***
|
||||
% *** with production work. IEEE's font choices can trigger bugs that do ***
|
||||
% *** not appear when using other class files. ***
|
||||
% The testflow support page is at:
|
||||
% http://www.michaelshell.org/tex/testflow/
|
||||
|
||||
|
||||
%%*************************************************************************
|
||||
%% Legal Notice:
|
||||
%% This code is offered as-is without any warranty either expressed or
|
||||
%% implied; without even the implied warranty of MERCHANTABILITY or
|
||||
%% FITNESS FOR A PARTICULAR PURPOSE!
|
||||
%% User assumes all risk.
|
||||
%% In no event shall IEEE or any contributor to this code be liable for
|
||||
%% any damages or losses, including, but not limited to, incidental,
|
||||
%% consequential, or any other damages, resulting from the use or misuse
|
||||
%% of any information contained here.
|
||||
%%
|
||||
%% All comments are the opinions of their respective authors and are not
|
||||
%% necessarily endorsed by the IEEE.
|
||||
%%
|
||||
%% This work is distributed under the LaTeX Project Public License (LPPL)
|
||||
%% ( http://www.latex-project.org/ ) version 1.3, and may be freely used,
|
||||
%% distributed and modified. A copy of the LPPL, version 1.3, is included
|
||||
%% in the base LaTeX documentation of all distributions of LaTeX released
|
||||
%% 2003/12/01 or later.
|
||||
%% Retain all contribution notices and credits.
|
||||
%% ** Modified files should be clearly indicated as such, including **
|
||||
%% ** renaming them and changing author support contact information. **
|
||||
%%
|
||||
%% File list of work: IEEEtran.cls, IEEEtran_HOWTO.pdf, bare_adv.tex,
|
||||
%% bare_conf.tex, bare_jrnl.tex, bare_jrnl_compsoc.tex
|
||||
%%*************************************************************************
|
||||
|
||||
% Note that the a4paper option is mainly intended so that authors in
|
||||
% countries using A4 can easily print to A4 and see how their papers will
|
||||
% look in print - the typesetting of the document will not typically be
|
||||
% affected with changes in paper size (but the bottom and side margins will).
|
||||
% Use the testflow package mentioned above to verify correct handling of
|
||||
% both paper sizes by the user's LaTeX system.
|
||||
%
|
||||
% Also note that the "draftcls" or "draftclsnofoot", not "draft", option
|
||||
% should be used if it is desired that the figures are to be displayed in
|
||||
% draft mode.
|
||||
%
|
||||
\documentclass[journal]{IEEEtran}
|
||||
%
|
||||
% If IEEEtran.cls has not been installed into the LaTeX system files,
|
||||
% manually specify the path to it like:
|
||||
% \documentclass[journal]{../sty/IEEEtran}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% Some very useful LaTeX packages include:
|
||||
% (uncomment the ones you want to load)
|
||||
|
||||
|
||||
% *** MISC UTILITY PACKAGES ***
|
||||
%
|
||||
%\usepackage{ifpdf}
|
||||
% Heiko Oberdiek's ifpdf.sty is very useful if you need conditional
|
||||
% compilation based on whether the output is pdf or dvi.
|
||||
% usage:
|
||||
% \ifpdf
|
||||
% % pdf code
|
||||
% \else
|
||||
% % dvi code
|
||||
% \fi
|
||||
% The latest version of ifpdf.sty can be obtained from:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/oberdiek/
|
||||
% Also, note that IEEEtran.cls V1.7 and later provides a builtin
|
||||
% \ifCLASSINFOpdf conditional that works the same way.
|
||||
% When switching from latex to pdflatex and vice-versa, the compiler may
|
||||
% have to be run twice to clear warning/error messages.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% *** CITATION PACKAGES ***
|
||||
%
|
||||
%\usepackage{cite}
|
||||
% cite.sty was written by Donald Arseneau
|
||||
% V1.6 and later of IEEEtran pre-defines the format of the cite.sty package
|
||||
% \cite{} output to follow that of IEEE. Loading the cite package will
|
||||
% result in citation numbers being automatically sorted and properly
|
||||
% "compressed/ranged". e.g., [1], [9], [2], [7], [5], [6] without using
|
||||
% cite.sty will become [1], [2], [5]--[7], [9] using cite.sty. cite.sty's
|
||||
% \cite will automatically add leading space, if needed. Use cite.sty's
|
||||
% noadjust option (cite.sty V3.8 and later) if you want to turn this off.
|
||||
% cite.sty is already installed on most LaTeX systems. Be sure and use
|
||||
% version 4.0 (2003-05-27) and later if using hyperref.sty. cite.sty does
|
||||
% not currently provide for hyperlinked citations.
|
||||
% The latest version can be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/cite/
|
||||
% The documentation is contained in the cite.sty file itself.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% *** GRAPHICS RELATED PACKAGES ***
|
||||
%
|
||||
\ifCLASSINFOpdf
|
||||
% \usepackage[pdftex]{graphicx}
|
||||
% declare the path(s) where your graphic files are
|
||||
% \graphicspath{{../pdf/}{../jpeg/}}
|
||||
% and their extensions so you won't have to specify these with
|
||||
% every instance of \includegraphics
|
||||
% \DeclareGraphicsExtensions{.pdf,.jpeg,.png}
|
||||
\else
|
||||
% or other class option (dvipsone, dvipdf, if not using dvips). graphicx
|
||||
% will default to the driver specified in the system graphics.cfg if no
|
||||
% driver is specified.
|
||||
% \usepackage[dvips]{graphicx}
|
||||
% declare the path(s) where your graphic files are
|
||||
% \graphicspath{{../eps/}}
|
||||
% and their extensions so you won't have to specify these with
|
||||
% every instance of \includegraphics
|
||||
% \DeclareGraphicsExtensions{.eps}
|
||||
\fi
|
||||
% graphicx was written by David Carlisle and Sebastian Rahtz. It is
|
||||
% required if you want graphics, photos, etc. graphicx.sty is already
|
||||
% installed on most LaTeX systems. The latest version and documentation can
|
||||
% be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/required/graphics/
|
||||
% Another good source of documentation is "Using Imported Graphics in
|
||||
% LaTeX2e" by Keith Reckdahl which can be found as epslatex.ps or
|
||||
% epslatex.pdf at: http://www.ctan.org/tex-archive/info/
|
||||
%
|
||||
% latex, and pdflatex in dvi mode, support graphics in encapsulated
|
||||
% postscript (.eps) format. pdflatex in pdf mode supports graphics
|
||||
% in .pdf, .jpeg, .png and .mps (metapost) formats. Users should ensure
|
||||
% that all non-photo figures use a vector format (.eps, .pdf, .mps) and
|
||||
% not a bitmapped formats (.jpeg, .png). IEEE frowns on bitmapped formats
|
||||
% which can result in "jaggedy"/blurry rendering of lines and letters as
|
||||
% well as large increases in file sizes.
|
||||
%
|
||||
% You can find documentation about the pdfTeX application at:
|
||||
% http://www.tug.org/applications/pdftex
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% *** MATH PACKAGES ***
|
||||
%
|
||||
%\usepackage[cmex10]{amsmath}
|
||||
% A popular package from the American Mathematical Society that provides
|
||||
% many useful and powerful commands for dealing with mathematics. If using
|
||||
% it, be sure to load this package with the cmex10 option to ensure that
|
||||
% only type 1 fonts will utilized at all point sizes. Without this option,
|
||||
% it is possible that some math symbols, particularly those within
|
||||
% footnotes, will be rendered in bitmap form which will result in a
|
||||
% document that can not be IEEE Xplore compliant!
|
||||
%
|
||||
% Also, note that the amsmath package sets \interdisplaylinepenalty to 10000
|
||||
% thus preventing page breaks from occurring within multiline equations. Use:
|
||||
%\interdisplaylinepenalty=2500
|
||||
% after loading amsmath to restore such page breaks as IEEEtran.cls normally
|
||||
% does. amsmath.sty is already installed on most LaTeX systems. The latest
|
||||
% version and documentation can be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/required/amslatex/math/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% *** SPECIALIZED LIST PACKAGES ***
|
||||
%
|
||||
%\usepackage{algorithmic}
|
||||
% algorithmic.sty was written by Peter Williams and Rogerio Brito.
|
||||
% This package provides an algorithmic environment fo describing algorithms.
|
||||
% You can use the algorithmic environment in-text or within a figure
|
||||
% environment to provide for a floating algorithm. Do NOT use the algorithm
|
||||
% floating environment provided by algorithm.sty (by the same authors) or
|
||||
% algorithm2e.sty (by Christophe Fiorio) as IEEE does not use dedicated
|
||||
% algorithm float types and packages that provide these will not provide
|
||||
% correct IEEE style captions. The latest version and documentation of
|
||||
% algorithmic.sty can be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/algorithms/
|
||||
% There is also a support site at:
|
||||
% http://algorithms.berlios.de/index.html
|
||||
% Also of interest may be the (relatively newer and more customizable)
|
||||
% algorithmicx.sty package by Szasz Janos:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/algorithmicx/
|
||||
|
||||
|
||||
|
||||
|
||||
% *** ALIGNMENT PACKAGES ***
|
||||
%
|
||||
%\usepackage{array}
|
||||
% Frank Mittelbach's and David Carlisle's array.sty patches and improves
|
||||
% the standard LaTeX2e array and tabular environments to provide better
|
||||
% appearance and additional user controls. As the default LaTeX2e table
|
||||
% generation code is lacking to the point of almost being broken with
|
||||
% respect to the quality of the end results, all users are strongly
|
||||
% advised to use an enhanced (at the very least that provided by array.sty)
|
||||
% set of table tools. array.sty is already installed on most systems. The
|
||||
% latest version and documentation can be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/required/tools/
|
||||
|
||||
|
||||
%\usepackage{mdwmath}
|
||||
%\usepackage{mdwtab}
|
||||
% Also highly recommended is Mark Wooding's extremely powerful MDW tools,
|
||||
% especially mdwmath.sty and mdwtab.sty which are used to format equations
|
||||
% and tables, respectively. The MDWtools set is already installed on most
|
||||
% LaTeX systems. The lastest version and documentation is available at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/mdwtools/
|
||||
|
||||
|
||||
% IEEEtran contains the IEEEeqnarray family of commands that can be used to
|
||||
% generate multiline equations as well as matrices, tables, etc., of high
|
||||
% quality.
|
||||
|
||||
|
||||
%\usepackage{eqparbox}
|
||||
% Also of notable interest is Scott Pakin's eqparbox package for creating
|
||||
% (automatically sized) equal width boxes - aka "natural width parboxes".
|
||||
% Available at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/eqparbox/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% *** SUBFIGURE PACKAGES ***
|
||||
%\usepackage[tight,footnotesize]{subfigure}
|
||||
% subfigure.sty was written by Steven Douglas Cochran. This package makes it
|
||||
% easy to put subfigures in your figures. e.g., "Figure 1a and 1b". For IEEE
|
||||
% work, it is a good idea to load it with the tight package option to reduce
|
||||
% the amount of white space around the subfigures. subfigure.sty is already
|
||||
% installed on most LaTeX systems. The latest version and documentation can
|
||||
% be obtained at:
|
||||
% http://www.ctan.org/tex-archive/obsolete/macros/latex/contrib/subfigure/
|
||||
% subfigure.sty has been superceeded by subfig.sty.
|
||||
|
||||
|
||||
|
||||
%\usepackage[caption=false]{caption}
|
||||
%\usepackage[font=footnotesize]{subfig}
|
||||
% subfig.sty, also written by Steven Douglas Cochran, is the modern
|
||||
% replacement for subfigure.sty. However, subfig.sty requires and
|
||||
% automatically loads Axel Sommerfeldt's caption.sty which will override
|
||||
% IEEEtran.cls handling of captions and this will result in nonIEEE style
|
||||
% figure/table captions. To prevent this problem, be sure and preload
|
||||
% caption.sty with its "caption=false" package option. This is will preserve
|
||||
% IEEEtran.cls handing of captions. Version 1.3 (2005/06/28) and later
|
||||
% (recommended due to many improvements over 1.2) of subfig.sty supports
|
||||
% the caption=false option directly:
|
||||
%\usepackage[caption=false,font=footnotesize]{subfig}
|
||||
%
|
||||
% The latest version and documentation can be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/subfig/
|
||||
% The latest version and documentation of caption.sty can be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/caption/
|
||||
|
||||
|
||||
|
||||
|
||||
% *** FLOAT PACKAGES ***
|
||||
%
|
||||
%\usepackage{fixltx2e}
|
||||
% fixltx2e, the successor to the earlier fix2col.sty, was written by
|
||||
% Frank Mittelbach and David Carlisle. This package corrects a few problems
|
||||
% in the LaTeX2e kernel, the most notable of which is that in current
|
||||
% LaTeX2e releases, the ordering of single and double column floats is not
|
||||
% guaranteed to be preserved. Thus, an unpatched LaTeX2e can allow a
|
||||
% single column figure to be placed prior to an earlier double column
|
||||
% figure. The latest version and documentation can be found at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/base/
|
||||
|
||||
|
||||
|
||||
%\usepackage{stfloats}
|
||||
% stfloats.sty was written by Sigitas Tolusis. This package gives LaTeX2e
|
||||
% the ability to do double column floats at the bottom of the page as well
|
||||
% as the top. (e.g., "\begin{figure*}[!b]" is not normally possible in
|
||||
% LaTeX2e). It also provides a command:
|
||||
%\fnbelowfloat
|
||||
% to enable the placement of footnotes below bottom floats (the standard
|
||||
% LaTeX2e kernel puts them above bottom floats). This is an invasive package
|
||||
% which rewrites many portions of the LaTeX2e float routines. It may not work
|
||||
% with other packages that modify the LaTeX2e float routines. The latest
|
||||
% version and documentation can be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/sttools/
|
||||
% Documentation is contained in the stfloats.sty comments as well as in the
|
||||
% presfull.pdf file. Do not use the stfloats baselinefloat ability as IEEE
|
||||
% does not allow \baselineskip to stretch. Authors submitting work to the
|
||||
% IEEE should note that IEEE rarely uses double column equations and
|
||||
% that authors should try to avoid such use. Do not be tempted to use the
|
||||
% cuted.sty or midfloat.sty packages (also by Sigitas Tolusis) as IEEE does
|
||||
% not format its papers in such ways.
|
||||
|
||||
|
||||
%\ifCLASSOPTIONcaptionsoff
|
||||
% \usepackage[nomarkers]{endfloat}
|
||||
% \let\MYoriglatexcaption\caption
|
||||
% \renewcommand{\caption}[2][\relax]{\MYoriglatexcaption[#2]{#2}}
|
||||
%\fi
|
||||
% endfloat.sty was written by James Darrell McCauley and Jeff Goldberg.
|
||||
% This package may be useful when used in conjunction with IEEEtran.cls'
|
||||
% captionsoff option. Some IEEE journals/societies require that submissions
|
||||
% have lists of figures/tables at the end of the paper and that
|
||||
% figures/tables without any captions are placed on a page by themselves at
|
||||
% the end of the document. If needed, the draftcls IEEEtran class option or
|
||||
% \CLASSINPUTbaselinestretch interface can be used to increase the line
|
||||
% spacing as well. Be sure and use the nomarkers option of endfloat to
|
||||
% prevent endfloat from "marking" where the figures would have been placed
|
||||
% in the text. The two hack lines of code above are a slight modification of
|
||||
% that suggested by in the endfloat docs (section 8.3.1) to ensure that
|
||||
% the full captions always appear in the list of figures/tables - even if
|
||||
% the user used the short optional argument of \caption[]{}.
|
||||
% IEEE papers do not typically make use of \caption[]'s optional argument,
|
||||
% so this should not be an issue. A similar trick can be used to disable
|
||||
% captions of packages such as subfig.sty that lack options to turn off
|
||||
% the subcaptions:
|
||||
% For subfig.sty:
|
||||
% \let\MYorigsubfloat\subfloat
|
||||
% \renewcommand{\subfloat}[2][\relax]{\MYorigsubfloat[]{#2}}
|
||||
% For subfigure.sty:
|
||||
% \let\MYorigsubfigure\subfigure
|
||||
% \renewcommand{\subfigure}[2][\relax]{\MYorigsubfigure[]{#2}}
|
||||
% However, the above trick will not work if both optional arguments of
|
||||
% the \subfloat/subfig command are used. Furthermore, there needs to be a
|
||||
% description of each subfigure *somewhere* and endfloat does not add
|
||||
% subfigure captions to its list of figures. Thus, the best approach is to
|
||||
% avoid the use of subfigure captions (many IEEE journals avoid them anyway)
|
||||
% and instead reference/explain all the subfigures within the main caption.
|
||||
% The latest version of endfloat.sty and its documentation can obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/endfloat/
|
||||
%
|
||||
% The IEEEtran \ifCLASSOPTIONcaptionsoff conditional can also be used
|
||||
% later in the document, say, to conditionally put the References on a
|
||||
% page by themselves.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% *** PDF, URL AND HYPERLINK PACKAGES ***
|
||||
%
|
||||
%\usepackage{url}
|
||||
% url.sty was written by Donald Arseneau. It provides better support for
|
||||
% handling and breaking URLs. url.sty is already installed on most LaTeX
|
||||
% systems. The latest version can be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/misc/
|
||||
% Read the url.sty source comments for usage information. Basically,
|
||||
% \url{my_url_here}.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% *** Do not adjust lengths that control margins, column widths, etc. ***
|
||||
% *** Do not use packages that alter fonts (such as pslatex). ***
|
||||
% There should be no need to do such things with IEEEtran.cls V1.6 and later.
|
||||
% (Unless specifically asked to do so by the journal or conference you plan
|
||||
% to submit to, of course. )
|
||||
|
||||
|
||||
% correct bad hyphenation here
|
||||
\hyphenation{op-tical net-works semi-conduc-tor}
|
||||
|
||||
|
||||
\begin{document}
|
||||
%
|
||||
% paper title
|
||||
% can use linebreaks \\ within to get better formatting as desired
|
||||
\title{Bare Demo of IEEEtran.cls for Journals}
|
||||
%
|
||||
%
|
||||
% author names and IEEE memberships
|
||||
% note positions of commas and nonbreaking spaces ( ~ ) LaTeX will not break
|
||||
% a structure at a ~ so this keeps an author's name from being broken across
|
||||
% two lines.
|
||||
% use \thanks{} to gain access to the first footnote area
|
||||
% a separate \thanks must be used for each paragraph as LaTeX2e's \thanks
|
||||
% was not built to handle multiple paragraphs
|
||||
%
|
||||
|
||||
\author{Michael~Shell,~\IEEEmembership{Member,~IEEE,}
|
||||
John~Doe,~\IEEEmembership{Fellow,~OSA,}
|
||||
and~Jane~Doe,~\IEEEmembership{Life~Fellow,~IEEE}% <-this % stops a space
|
||||
\thanks{M. Shell is with the Department
|
||||
of Electrical and Computer Engineering, Georgia Institute of Technology, Atlanta,
|
||||
GA, 30332 USA e-mail: (see http://www.michaelshell.org/contact.html).}% <-this % stops a space
|
||||
\thanks{J. Doe and J. Doe are with Anonymous University.}% <-this % stops a space
|
||||
\thanks{Manuscript received April 19, 2005; revised January 11, 2007.}}
|
||||
|
||||
% note the % following the last \IEEEmembership and also \thanks -
|
||||
% these prevent an unwanted space from occurring between the last author name
|
||||
% and the end of the author line. i.e., if you had this:
|
||||
%
|
||||
% \author{....lastname \thanks{...} \thanks{...} }
|
||||
% ^------------^------------^----Do not want these spaces!
|
||||
%
|
||||
% a space would be appended to the last name and could cause every name on that
|
||||
% line to be shifted left slightly. This is one of those "LaTeX things". For
|
||||
% instance, "\textbf{A} \textbf{B}" will typeset as "A B" not "AB". To get
|
||||
% "AB" then you have to do: "\textbf{A}\textbf{B}"
|
||||
% \thanks is no different in this regard, so shield the last } of each \thanks
|
||||
% that ends a line with a % and do not let a space in before the next \thanks.
|
||||
% Spaces after \IEEEmembership other than the last one are OK (and needed) as
|
||||
% you are supposed to have spaces between the names. For what it is worth,
|
||||
% this is a minor point as most people would not even notice if the said evil
|
||||
% space somehow managed to creep in.
|
||||
|
||||
|
||||
|
||||
% The paper headers
|
||||
\markboth{Journal of \LaTeX\ Class Files,~Vol.~6, No.~1, January~2007}%
|
||||
{Shell \MakeLowercase{\textit{et al.}}: Bare Demo of IEEEtran.cls for Journals}
|
||||
% The only time the second header will appear is for the odd numbered pages
|
||||
% after the title page when using the twoside option.
|
||||
%
|
||||
% *** Note that you probably will NOT want to include the author's ***
|
||||
% *** name in the headers of peer review papers. ***
|
||||
% You can use \ifCLASSOPTIONpeerreview for conditional compilation here if
|
||||
% you desire.
|
||||
|
||||
|
||||
|
||||
|
||||
% If you want to put a publisher's ID mark on the page you can do it like
|
||||
% this:
|
||||
%\IEEEpubid{0000--0000/00\$00.00~\copyright~2007 IEEE}
|
||||
% Remember, if you use this you must call \IEEEpubidadjcol in the second
|
||||
% column for its text to clear the IEEEpubid mark.
|
||||
|
||||
|
||||
|
||||
% use for special paper notices
|
||||
%\IEEEspecialpapernotice{(Invited Paper)}
|
||||
|
||||
|
||||
|
||||
|
||||
% make the title area
|
||||
\maketitle
|
||||
|
||||
|
||||
\begin{abstract}
|
||||
%\boldmath
|
||||
The abstract goes here.
|
||||
\end{abstract}
|
||||
% IEEEtran.cls defaults to using nonbold math in the Abstract.
|
||||
% This preserves the distinction between vectors and scalars. However,
|
||||
% if the journal you are submitting to favors bold math in the abstract,
|
||||
% then you can use LaTeX's standard command \boldmath at the very start
|
||||
% of the abstract to achieve this. Many IEEE journals frown on math
|
||||
% in the abstract anyway.
|
||||
|
||||
% Note that keywords are not normally used for peerreview papers.
|
||||
\begin{IEEEkeywords}
|
||||
IEEEtran, journal, \LaTeX, paper, template.
|
||||
\end{IEEEkeywords}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% For peer review papers, you can put extra information on the cover
|
||||
% page as needed:
|
||||
% \ifCLASSOPTIONpeerreview
|
||||
% \begin{center} \bfseries EDICS Category: 3-BBND \end{center}
|
||||
% \fi
|
||||
%
|
||||
% For peerreview papers, this IEEEtran command inserts a page break and
|
||||
% creates the second title. It will be ignored for other modes.
|
||||
\IEEEpeerreviewmaketitle
|
||||
|
||||
|
||||
|
||||
\section{Introduction}
|
||||
% The very first letter is a 2 line initial drop letter followed
|
||||
% by the rest of the first word in caps.
|
||||
%
|
||||
% form to use if the first word consists of a single letter:
|
||||
% \IEEEPARstart{A}{demo} file is ....
|
||||
%
|
||||
% form to use if you need the single drop letter followed by
|
||||
% normal text (unknown if ever used by IEEE):
|
||||
% \IEEEPARstart{A}{}demo file is ....
|
||||
%
|
||||
% Some journals put the first two words in caps:
|
||||
% \IEEEPARstart{T}{his demo} file is ....
|
||||
%
|
||||
% Here we have the typical use of a "T" for an initial drop letter
|
||||
% and "HIS" in caps to complete the first word.
|
||||
\IEEEPARstart{T}{his} demo file is intended to serve as a ``starter file''
|
||||
for IEEE journal papers produced under \LaTeX\ using
|
||||
IEEEtran.cls version 1.7 and later.
|
||||
% You must have at least 2 lines in the paragraph with the drop letter
|
||||
% (should never be an issue)
|
||||
I wish you the best of success.
|
||||
|
||||
\hfill mds
|
||||
|
||||
\hfill January 11, 2007
|
||||
|
||||
\subsection{Subsection Heading Here}
|
||||
Subsection text here.
|
||||
|
||||
% needed in second column of first page if using \IEEEpubid
|
||||
%\IEEEpubidadjcol
|
||||
|
||||
\subsubsection{Subsubsection Heading Here}
|
||||
Subsubsection text here.
|
||||
|
||||
|
||||
% An example of a floating figure using the graphicx package.
|
||||
% Note that \label must occur AFTER (or within) \caption.
|
||||
% For figures, \caption should occur after the \includegraphics.
|
||||
% Note that IEEEtran v1.7 and later has special internal code that
|
||||
% is designed to preserve the operation of \label within \caption
|
||||
% even when the captionsoff option is in effect. However, because
|
||||
% of issues like this, it may be the safest practice to put all your
|
||||
% \label just after \caption rather than within \caption{}.
|
||||
%
|
||||
% Reminder: the "draftcls" or "draftclsnofoot", not "draft", class
|
||||
% option should be used if it is desired that the figures are to be
|
||||
% displayed while in draft mode.
|
||||
%
|
||||
%\begin{figure}[!t]
|
||||
%\centering
|
||||
%\includegraphics[width=2.5in]{myfigure}
|
||||
% where an .eps filename suffix will be assumed under latex,
|
||||
% and a .pdf suffix will be assumed for pdflatex; or what has been declared
|
||||
% via \DeclareGraphicsExtensions.
|
||||
%\caption{Simulation Results}
|
||||
%\label{fig_sim}
|
||||
%\end{figure}
|
||||
|
||||
% Note that IEEE typically puts floats only at the top, even when this
|
||||
% results in a large percentage of a column being occupied by floats.
|
||||
|
||||
|
||||
% An example of a double column floating figure using two subfigures.
|
||||
% (The subfig.sty package must be loaded for this to work.)
|
||||
% The subfigure \label commands are set within each subfloat command, the
|
||||
% \label for the overall figure must come after \caption.
|
||||
% \hfil must be used as a separator to get equal spacing.
|
||||
% The subfigure.sty package works much the same way, except \subfigure is
|
||||
% used instead of \subfloat.
|
||||
%
|
||||
%\begin{figure*}[!t]
|
||||
%\centerline{\subfloat[Case I]\includegraphics[width=2.5in]{subfigcase1}%
|
||||
%\label{fig_first_case}}
|
||||
%\hfil
|
||||
%\subfloat[Case II]{\includegraphics[width=2.5in]{subfigcase2}%
|
||||
%\label{fig_second_case}}}
|
||||
%\caption{Simulation results}
|
||||
%\label{fig_sim}
|
||||
%\end{figure*}
|
||||
%
|
||||
% Note that often IEEE papers with subfigures do not employ subfigure
|
||||
% captions (using the optional argument to \subfloat), but instead will
|
||||
% reference/describe all of them (a), (b), etc., within the main caption.
|
||||
|
||||
|
||||
% An example of a floating table. Note that, for IEEE style tables, the
|
||||
% \caption command should come BEFORE the table. Table text will default to
|
||||
% \footnotesize as IEEE normally uses this smaller font for tables.
|
||||
% The \label must come after \caption as always.
|
||||
%
|
||||
%\begin{table}[!t]
|
||||
%% increase table row spacing, adjust to taste
|
||||
%\renewcommand{\arraystretch}{1.3}
|
||||
% if using array.sty, it might be a good idea to tweak the value of
|
||||
% \extrarowheight as needed to properly center the text within the cells
|
||||
%\caption{An Example of a Table}
|
||||
%\label{table_example}
|
||||
%\centering
|
||||
%% Some packages, such as MDW tools, offer better commands for making tables
|
||||
%% than the plain LaTeX2e tabular which is used here.
|
||||
%\begin{tabular}{|c||c|}
|
||||
%\hline
|
||||
%One & Two\\
|
||||
%\hline
|
||||
%Three & Four\\
|
||||
%\hline
|
||||
%\end{tabular}
|
||||
%\end{table}
|
||||
|
||||
|
||||
% Note that IEEE does not put floats in the very first column - or typically
|
||||
% anywhere on the first page for that matter. Also, in-text middle ("here")
|
||||
% positioning is not used. Most IEEE journals use top floats exclusively.
|
||||
% Note that, LaTeX2e, unlike IEEE journals, places footnotes above bottom
|
||||
% floats. This can be corrected via the \fnbelowfloat command of the
|
||||
% stfloats package.
|
||||
|
||||
|
||||
|
||||
\section{Conclusion}
|
||||
The conclusion goes here.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% if have a single appendix:
|
||||
%\appendix[Proof of the Zonklar Equations]
|
||||
% or
|
||||
%\appendix % for no appendix heading
|
||||
% do not use \section anymore after \appendix, only \section*
|
||||
% is possibly needed
|
||||
|
||||
% use appendices with more than one appendix
|
||||
% then use \section to start each appendix
|
||||
% you must declare a \section before using any
|
||||
% \subsection or using \label (\appendices by itself
|
||||
% starts a section numbered zero.)
|
||||
%
|
||||
|
||||
|
||||
\appendices
|
||||
\section{Proof of the First Zonklar Equation}
|
||||
Appendix one text goes here.
|
||||
|
||||
% you can choose not to have a title for an appendix
|
||||
% if you want by leaving the argument blank
|
||||
\section{}
|
||||
Appendix two text goes here.
|
||||
|
||||
|
||||
% use section* for acknowledgement
|
||||
\section*{Acknowledgment}
|
||||
|
||||
|
||||
The authors would like to thank...
|
||||
|
||||
|
||||
% Can use something like this to put references on a page
|
||||
% by themselves when using endfloat and the captionsoff option.
|
||||
\ifCLASSOPTIONcaptionsoff
|
||||
\newpage
|
||||
\fi
|
||||
|
||||
|
||||
|
||||
% trigger a \newpage just before the given reference
|
||||
% number - used to balance the columns on the last page
|
||||
% adjust value as needed - may need to be readjusted if
|
||||
% the document is modified later
|
||||
%\IEEEtriggeratref{8}
|
||||
% The "triggered" command can be changed if desired:
|
||||
%\IEEEtriggercmd{\enlargethispage{-5in}}
|
||||
|
||||
% references section
|
||||
|
||||
% can use a bibliography generated by BibTeX as a .bbl file
|
||||
% BibTeX documentation can be easily obtained at:
|
||||
% http://www.ctan.org/tex-archive/biblio/bibtex/contrib/doc/
|
||||
% The IEEEtran BibTeX style support page is at:
|
||||
% http://www.michaelshell.org/tex/ieeetran/bibtex/
|
||||
%\bibliographystyle{IEEEtran}
|
||||
% argument is your BibTeX string definitions and bibliography database(s)
|
||||
%\bibliography{IEEEabrv,../bib/paper}
|
||||
%
|
||||
% <OR> manually copy in the resultant .bbl file
|
||||
% set second argument of \begin to the number of references
|
||||
% (used to reserve space for the reference number labels box)
|
||||
\begin{thebibliography}{1}
|
||||
|
||||
\bibitem{IEEEhowto:kopka}
|
||||
H.~Kopka and P.~W. Daly, \emph{A Guide to \LaTeX}, 3rd~ed.\hskip 1em plus
|
||||
0.5em minus 0.4em\relax Harlow, England: Addison-Wesley, 1999.
|
||||
|
||||
\end{thebibliography}
|
||||
|
||||
% biography section
|
||||
%
|
||||
% If you have an EPS/PDF photo (graphicx package needed) extra braces are
|
||||
% needed around the contents of the optional argument to biography to prevent
|
||||
% the LaTeX parser from getting confused when it sees the complicated
|
||||
% \includegraphics command within an optional argument. (You could create
|
||||
% your own custom macro containing the \includegraphics command to make things
|
||||
% simpler here.)
|
||||
%\begin{biography}[{\includegraphics[width=1in,height=1.25in,clip,keepaspectratio]{mshell}}]{Michael Shell}
|
||||
% or if you just want to reserve a space for a photo:
|
||||
|
||||
\begin{IEEEbiography}{Michael Shell}
|
||||
Biography text here.
|
||||
\end{IEEEbiography}
|
||||
|
||||
% if you will not have a photo at all:
|
||||
\begin{IEEEbiographynophoto}{John Doe}
|
||||
Biography text here.
|
||||
\end{IEEEbiographynophoto}
|
||||
|
||||
% insert where needed to balance the two columns on the last page with
|
||||
% biographies
|
||||
%\newpage
|
||||
|
||||
\begin{IEEEbiographynophoto}{Jane Doe}
|
||||
Biography text here.
|
||||
\end{IEEEbiographynophoto}
|
||||
|
||||
% You can push biographies down or up by placing
|
||||
% a \vfill before or after them. The appropriate
|
||||
% use of \vfill depends on what kind of text is
|
||||
% on the last page and whether or not the columns
|
||||
% are being equalized.
|
||||
|
||||
%\vfill
|
||||
|
||||
% Can be used to pull up biographies so that the bottom of the last one
|
||||
% is flush with the other column.
|
||||
%\enlargethispage{-5in}
|
||||
|
||||
|
||||
|
||||
% that's all folks
|
||||
\end{document}
|
||||
|
||||
|
||||
@@ -0,0 +1,844 @@
|
||||
|
||||
%% bare_jrnl_compsoc.tex
|
||||
%% V1.3
|
||||
%% 2007/01/11
|
||||
%% by Michael Shell
|
||||
%% See:
|
||||
%% http://www.michaelshell.org/
|
||||
%% for current contact information.
|
||||
%%
|
||||
%% This is a skeleton file demonstrating the use of IEEEtran.cls
|
||||
%% (requires IEEEtran.cls version 1.7 or later) with an IEEE Computer
|
||||
%% Society journal paper.
|
||||
%%
|
||||
%% Support sites:
|
||||
%% http://www.michaelshell.org/tex/ieeetran/
|
||||
%% http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/
|
||||
%% and
|
||||
%% http://www.ieee.org/
|
||||
|
||||
%%*************************************************************************
|
||||
%% Legal Notice:
|
||||
%% This code is offered as-is without any warranty either expressed or
|
||||
%% implied; without even the implied warranty of MERCHANTABILITY or
|
||||
%% FITNESS FOR A PARTICULAR PURPOSE!
|
||||
%% User assumes all risk.
|
||||
%% In no event shall IEEE or any contributor to this code be liable for
|
||||
%% any damages or losses, including, but not limited to, incidental,
|
||||
%% consequential, or any other damages, resulting from the use or misuse
|
||||
%% of any information contained here.
|
||||
%%
|
||||
%% All comments are the opinions of their respective authors and are not
|
||||
%% necessarily endorsed by the IEEE.
|
||||
%%
|
||||
%% This work is distributed under the LaTeX Project Public License (LPPL)
|
||||
%% ( http://www.latex-project.org/ ) version 1.3, and may be freely used,
|
||||
%% distributed and modified. A copy of the LPPL, version 1.3, is included
|
||||
%% in the base LaTeX documentation of all distributions of LaTeX released
|
||||
%% 2003/12/01 or later.
|
||||
%% Retain all contribution notices and credits.
|
||||
%% ** Modified files should be clearly indicated as such, including **
|
||||
%% ** renaming them and changing author support contact information. **
|
||||
%%
|
||||
%% File list of work: IEEEtran.cls, IEEEtran_HOWTO.pdf, bare_adv.tex,
|
||||
%% bare_conf.tex, bare_jrnl.tex, bare_jrnl_compsoc.tex
|
||||
%%*************************************************************************
|
||||
|
||||
% *** Authors should verify (and, if needed, correct) their LaTeX system ***
|
||||
% *** with the testflow diagnostic prior to trusting their LaTeX platform ***
|
||||
% *** with production work. IEEE's font choices can trigger bugs that do ***
|
||||
% *** not appear when using other class files. ***
|
||||
% The testflow support page is at:
|
||||
% http://www.michaelshell.org/tex/testflow/
|
||||
|
||||
|
||||
|
||||
|
||||
% Note that the a4paper option is mainly intended so that authors in
|
||||
% countries using A4 can easily print to A4 and see how their papers will
|
||||
% look in print - the typesetting of the document will not typically be
|
||||
% affected with changes in paper size (but the bottom and side margins will).
|
||||
% Use the testflow package mentioned above to verify correct handling of
|
||||
% both paper sizes by the user's LaTeX system.
|
||||
%
|
||||
% Also note that the "draftcls" or "draftclsnofoot", not "draft", option
|
||||
% should be used if it is desired that the figures are to be displayed in
|
||||
% draft mode.
|
||||
%
|
||||
% The Computer Society usually requires 12pt for submissions.
|
||||
%
|
||||
\documentclass[12pt,journal,compsoc]{IEEEtran}
|
||||
%
|
||||
% If IEEEtran.cls has not been installed into the LaTeX system files,
|
||||
% manually specify the path to it like:
|
||||
% \documentclass[12pt,journal,compsoc]{../sty/IEEEtran}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% Some very useful LaTeX packages include:
|
||||
% (uncomment the ones you want to load)
|
||||
|
||||
|
||||
% *** MISC UTILITY PACKAGES ***
|
||||
%
|
||||
%\usepackage{ifpdf}
|
||||
% Heiko Oberdiek's ifpdf.sty is very useful if you need conditional
|
||||
% compilation based on whether the output is pdf or dvi.
|
||||
% usage:
|
||||
% \ifpdf
|
||||
% % pdf code
|
||||
% \else
|
||||
% % dvi code
|
||||
% \fi
|
||||
% The latest version of ifpdf.sty can be obtained from:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/oberdiek/
|
||||
% Also, note that IEEEtran.cls V1.7 and later provides a builtin
|
||||
% \ifCLASSINFOpdf conditional that works the same way.
|
||||
% When switching from latex to pdflatex and vice-versa, the compiler may
|
||||
% have to be run twice to clear warning/error messages.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% *** CITATION PACKAGES ***
|
||||
%
|
||||
\ifCLASSOPTIONcompsoc
|
||||
% IEEE Computer Society needs nocompress option
|
||||
% requires cite.sty v4.0 or later (November 2003)
|
||||
% \usepackage[nocompress]{cite}
|
||||
\else
|
||||
% normal IEEE
|
||||
% \usepackage{cite}
|
||||
\fi
|
||||
% cite.sty was written by Donald Arseneau
|
||||
% V1.6 and later of IEEEtran pre-defines the format of the cite.sty package
|
||||
% \cite{} output to follow that of IEEE. Loading the cite package will
|
||||
% result in citation numbers being automatically sorted and properly
|
||||
% "compressed/ranged". e.g., [1], [9], [2], [7], [5], [6] without using
|
||||
% cite.sty will become [1], [2], [5]--[7], [9] using cite.sty. cite.sty's
|
||||
% \cite will automatically add leading space, if needed. Use cite.sty's
|
||||
% noadjust option (cite.sty V3.8 and later) if you want to turn this off.
|
||||
% cite.sty is already installed on most LaTeX systems. Be sure and use
|
||||
% version 4.0 (2003-05-27) and later if using hyperref.sty. cite.sty does
|
||||
% not currently provide for hyperlinked citations.
|
||||
% The latest version can be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/cite/
|
||||
% The documentation is contained in the cite.sty file itself.
|
||||
%
|
||||
% Note that some packages require special options to format as the Computer
|
||||
% Society requires. In particular, Computer Society papers do not use
|
||||
% compressed citation ranges as is done in typical IEEE papers
|
||||
% (e.g., [1]-[4]). Instead, they list every citation separately in order
|
||||
% (e.g., [1], [2], [3], [4]). To get the latter we need to load the cite
|
||||
% package with the nocompress option which is supported by cite.sty v4.0
|
||||
% and later. Note also the use of a CLASSOPTION conditional provided by
|
||||
% IEEEtran.cls V1.7 and later.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% *** GRAPHICS RELATED PACKAGES ***
|
||||
%
|
||||
\ifCLASSINFOpdf
|
||||
% \usepackage[pdftex]{graphicx}
|
||||
% declare the path(s) where your graphic files are
|
||||
% \graphicspath{{../pdf/}{../jpeg/}}
|
||||
% and their extensions so you won't have to specify these with
|
||||
% every instance of \includegraphics
|
||||
% \DeclareGraphicsExtensions{.pdf,.jpeg,.png}
|
||||
\else
|
||||
% or other class option (dvipsone, dvipdf, if not using dvips). graphicx
|
||||
% will default to the driver specified in the system graphics.cfg if no
|
||||
% driver is specified.
|
||||
% \usepackage[dvips]{graphicx}
|
||||
% declare the path(s) where your graphic files are
|
||||
% \graphicspath{{../eps/}}
|
||||
% and their extensions so you won't have to specify these with
|
||||
% every instance of \includegraphics
|
||||
% \DeclareGraphicsExtensions{.eps}
|
||||
\fi
|
||||
% graphicx was written by David Carlisle and Sebastian Rahtz. It is
|
||||
% required if you want graphics, photos, etc. graphicx.sty is already
|
||||
% installed on most LaTeX systems. The latest version and documentation can
|
||||
% be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/required/graphics/
|
||||
% Another good source of documentation is "Using Imported Graphics in
|
||||
% LaTeX2e" by Keith Reckdahl which can be found as epslatex.ps or
|
||||
% epslatex.pdf at: http://www.ctan.org/tex-archive/info/
|
||||
%
|
||||
% latex, and pdflatex in dvi mode, support graphics in encapsulated
|
||||
% postscript (.eps) format. pdflatex in pdf mode supports graphics
|
||||
% in .pdf, .jpeg, .png and .mps (metapost) formats. Users should ensure
|
||||
% that all non-photo figures use a vector format (.eps, .pdf, .mps) and
|
||||
% not a bitmapped formats (.jpeg, .png). IEEE frowns on bitmapped formats
|
||||
% which can result in "jaggedy"/blurry rendering of lines and letters as
|
||||
% well as large increases in file sizes.
|
||||
%
|
||||
% You can find documentation about the pdfTeX application at:
|
||||
% http://www.tug.org/applications/pdftex
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% *** MATH PACKAGES ***
|
||||
%
|
||||
%\usepackage[cmex10]{amsmath}
|
||||
% A popular package from the American Mathematical Society that provides
|
||||
% many useful and powerful commands for dealing with mathematics. If using
|
||||
% it, be sure to load this package with the cmex10 option to ensure that
|
||||
% only type 1 fonts will utilized at all point sizes. Without this option,
|
||||
% it is possible that some math symbols, particularly those within
|
||||
% footnotes, will be rendered in bitmap form which will result in a
|
||||
% document that can not be IEEE Xplore compliant!
|
||||
%
|
||||
% Also, note that the amsmath package sets \interdisplaylinepenalty to 10000
|
||||
% thus preventing page breaks from occurring within multiline equations. Use:
|
||||
%\interdisplaylinepenalty=2500
|
||||
% after loading amsmath to restore such page breaks as IEEEtran.cls normally
|
||||
% does. amsmath.sty is already installed on most LaTeX systems. The latest
|
||||
% version and documentation can be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/required/amslatex/math/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% *** SPECIALIZED LIST PACKAGES ***
|
||||
%
|
||||
%\usepackage{algorithmic}
|
||||
% algorithmic.sty was written by Peter Williams and Rogerio Brito.
|
||||
% This package provides an algorithmic environment fo describing algorithms.
|
||||
% You can use the algorithmic environment in-text or within a figure
|
||||
% environment to provide for a floating algorithm. Do NOT use the algorithm
|
||||
% floating environment provided by algorithm.sty (by the same authors) or
|
||||
% algorithm2e.sty (by Christophe Fiorio) as IEEE does not use dedicated
|
||||
% algorithm float types and packages that provide these will not provide
|
||||
% correct IEEE style captions. The latest version and documentation of
|
||||
% algorithmic.sty can be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/algorithms/
|
||||
% There is also a support site at:
|
||||
% http://algorithms.berlios.de/index.html
|
||||
% Also of interest may be the (relatively newer and more customizable)
|
||||
% algorithmicx.sty package by Szasz Janos:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/algorithmicx/
|
||||
|
||||
|
||||
|
||||
|
||||
% *** ALIGNMENT PACKAGES ***
|
||||
%
|
||||
%\usepackage{array}
|
||||
% Frank Mittelbach's and David Carlisle's array.sty patches and improves
|
||||
% the standard LaTeX2e array and tabular environments to provide better
|
||||
% appearance and additional user controls. As the default LaTeX2e table
|
||||
% generation code is lacking to the point of almost being broken with
|
||||
% respect to the quality of the end results, all users are strongly
|
||||
% advised to use an enhanced (at the very least that provided by array.sty)
|
||||
% set of table tools. array.sty is already installed on most systems. The
|
||||
% latest version and documentation can be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/required/tools/
|
||||
|
||||
|
||||
%\usepackage{mdwmath}
|
||||
%\usepackage{mdwtab}
|
||||
% Also highly recommended is Mark Wooding's extremely powerful MDW tools,
|
||||
% especially mdwmath.sty and mdwtab.sty which are used to format equations
|
||||
% and tables, respectively. The MDWtools set is already installed on most
|
||||
% LaTeX systems. The lastest version and documentation is available at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/mdwtools/
|
||||
|
||||
|
||||
% IEEEtran contains the IEEEeqnarray family of commands that can be used to
|
||||
% generate multiline equations as well as matrices, tables, etc., of high
|
||||
% quality.
|
||||
|
||||
|
||||
%\usepackage{eqparbox}
|
||||
% Also of notable interest is Scott Pakin's eqparbox package for creating
|
||||
% (automatically sized) equal width boxes - aka "natural width parboxes".
|
||||
% Available at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/eqparbox/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% *** SUBFIGURE PACKAGES ***
|
||||
%\ifCLASSOPTIONcompsoc
|
||||
%\usepackage[tight,normalsize,sf,SF]{subfigure}
|
||||
%\else
|
||||
%\usepackage[tight,footnotesize]{subfigure}
|
||||
%\fi
|
||||
% subfigure.sty was written by Steven Douglas Cochran. This package makes it
|
||||
% easy to put subfigures in your figures. e.g., "Figure 1a and 1b". For IEEE
|
||||
% work, it is a good idea to load it with the tight package option to reduce
|
||||
% the amount of white space around the subfigures. Computer Society papers
|
||||
% use a larger font and \sffamily font for their captions, hence the
|
||||
% additional options needed under compsoc mode. subfigure.sty is already
|
||||
% installed on most LaTeX systems. The latest version and documentation can
|
||||
% be obtained at:
|
||||
% http://www.ctan.org/tex-archive/obsolete/macros/latex/contrib/subfigure/
|
||||
% subfigure.sty has been superceeded by subfig.sty.
|
||||
|
||||
|
||||
%\ifCLASSOPTIONcompsoc
|
||||
% \usepackage[caption=false]{caption}
|
||||
% \usepackage[font=normalsize,labelfont=sf,textfont=sf]{subfig}
|
||||
%\else
|
||||
% \usepackage[caption=false]{caption}
|
||||
% \usepackage[font=footnotesize]{subfig}
|
||||
%\fi
|
||||
% subfig.sty, also written by Steven Douglas Cochran, is the modern
|
||||
% replacement for subfigure.sty. However, subfig.sty requires and
|
||||
% automatically loads Axel Sommerfeldt's caption.sty which will override
|
||||
% IEEEtran.cls handling of captions and this will result in nonIEEE style
|
||||
% figure/table captions. To prevent this problem, be sure and preload
|
||||
% caption.sty with its "caption=false" package option. This is will preserve
|
||||
% IEEEtran.cls handing of captions. Version 1.3 (2005/06/28) and later
|
||||
% (recommended due to many improvements over 1.2) of subfig.sty supports
|
||||
% the caption=false option directly:
|
||||
%\ifCLASSOPTIONcompsoc
|
||||
% \usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{subfig}
|
||||
%\else
|
||||
% \usepackage[caption=false,font=footnotesize]{subfig}
|
||||
%\fi
|
||||
%
|
||||
% The latest version and documentation can be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/subfig/
|
||||
% The latest version and documentation of caption.sty can be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/caption/
|
||||
|
||||
|
||||
|
||||
|
||||
% *** FLOAT PACKAGES ***
|
||||
%
|
||||
%\usepackage{fixltx2e}
|
||||
% fixltx2e, the successor to the earlier fix2col.sty, was written by
|
||||
% Frank Mittelbach and David Carlisle. This package corrects a few problems
|
||||
% in the LaTeX2e kernel, the most notable of which is that in current
|
||||
% LaTeX2e releases, the ordering of single and double column floats is not
|
||||
% guaranteed to be preserved. Thus, an unpatched LaTeX2e can allow a
|
||||
% single column figure to be placed prior to an earlier double column
|
||||
% figure. The latest version and documentation can be found at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/base/
|
||||
|
||||
|
||||
|
||||
%\usepackage{stfloats}
|
||||
% stfloats.sty was written by Sigitas Tolusis. This package gives LaTeX2e
|
||||
% the ability to do double column floats at the bottom of the page as well
|
||||
% as the top. (e.g., "\begin{figure*}[!b]" is not normally possible in
|
||||
% LaTeX2e). It also provides a command:
|
||||
%\fnbelowfloat
|
||||
% to enable the placement of footnotes below bottom floats (the standard
|
||||
% LaTeX2e kernel puts them above bottom floats). This is an invasive package
|
||||
% which rewrites many portions of the LaTeX2e float routines. It may not work
|
||||
% with other packages that modify the LaTeX2e float routines. The latest
|
||||
% version and documentation can be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/sttools/
|
||||
% Documentation is contained in the stfloats.sty comments as well as in the
|
||||
% presfull.pdf file. Do not use the stfloats baselinefloat ability as IEEE
|
||||
% does not allow \baselineskip to stretch. Authors submitting work to the
|
||||
% IEEE should note that IEEE rarely uses double column equations and
|
||||
% that authors should try to avoid such use. Do not be tempted to use the
|
||||
% cuted.sty or midfloat.sty packages (also by Sigitas Tolusis) as IEEE does
|
||||
% not format its papers in such ways.
|
||||
|
||||
|
||||
|
||||
|
||||
%\ifCLASSOPTIONcaptionsoff
|
||||
% \usepackage[nomarkers]{endfloat}
|
||||
% \let\MYoriglatexcaption\caption
|
||||
% \renewcommand{\caption}[2][\relax]{\MYoriglatexcaption[#2]{#2}}
|
||||
%\fi
|
||||
% endfloat.sty was written by James Darrell McCauley and Jeff Goldberg.
|
||||
% This package may be useful when used in conjunction with IEEEtran.cls'
|
||||
% captionsoff option. Some IEEE journals/societies require that submissions
|
||||
% have lists of figures/tables at the end of the paper and that
|
||||
% figures/tables without any captions are placed on a page by themselves at
|
||||
% the end of the document. If needed, the draftcls IEEEtran class option or
|
||||
% \CLASSINPUTbaselinestretch interface can be used to increase the line
|
||||
% spacing as well. Be sure and use the nomarkers option of endfloat to
|
||||
% prevent endfloat from "marking" where the figures would have been placed
|
||||
% in the text. The two hack lines of code above are a slight modification of
|
||||
% that suggested by in the endfloat docs (section 8.3.1) to ensure that
|
||||
% the full captions always appear in the list of figures/tables - even if
|
||||
% the user used the short optional argument of \caption[]{}.
|
||||
% IEEE papers do not typically make use of \caption[]'s optional argument,
|
||||
% so this should not be an issue. A similar trick can be used to disable
|
||||
% captions of packages such as subfig.sty that lack options to turn off
|
||||
% the subcaptions:
|
||||
% For subfig.sty:
|
||||
% \let\MYorigsubfloat\subfloat
|
||||
% \renewcommand{\subfloat}[2][\relax]{\MYorigsubfloat[]{#2}}
|
||||
% For subfigure.sty:
|
||||
% \let\MYorigsubfigure\subfigure
|
||||
% \renewcommand{\subfigure}[2][\relax]{\MYorigsubfigure[]{#2}}
|
||||
% However, the above trick will not work if both optional arguments of
|
||||
% the \subfloat/subfig command are used. Furthermore, there needs to be a
|
||||
% description of each subfigure *somewhere* and endfloat does not add
|
||||
% subfigure captions to its list of figures. Thus, the best approach is to
|
||||
% avoid the use of subfigure captions (many IEEE journals avoid them anyway)
|
||||
% and instead reference/explain all the subfigures within the main caption.
|
||||
% The latest version of endfloat.sty and its documentation can obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/endfloat/
|
||||
%
|
||||
% The IEEEtran \ifCLASSOPTIONcaptionsoff conditional can also be used
|
||||
% later in the document, say, to conditionally put the References on a
|
||||
% page by themselves.
|
||||
|
||||
|
||||
|
||||
|
||||
% *** PDF, URL AND HYPERLINK PACKAGES ***
|
||||
%
|
||||
%\usepackage{url}
|
||||
% url.sty was written by Donald Arseneau. It provides better support for
|
||||
% handling and breaking URLs. url.sty is already installed on most LaTeX
|
||||
% systems. The latest version can be obtained at:
|
||||
% http://www.ctan.org/tex-archive/macros/latex/contrib/misc/
|
||||
% Read the url.sty source comments for usage information. Basically,
|
||||
% \url{my_url_here}.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% *** Do not adjust lengths that control margins, column widths, etc. ***
|
||||
% *** Do not use packages that alter fonts (such as pslatex). ***
|
||||
% There should be no need to do such things with IEEEtran.cls V1.6 and later.
|
||||
% (Unless specifically asked to do so by the journal or conference you plan
|
||||
% to submit to, of course. )
|
||||
|
||||
|
||||
% correct bad hyphenation here
|
||||
\hyphenation{op-tical net-works semi-conduc-tor}
|
||||
|
||||
|
||||
\begin{document}
|
||||
%
|
||||
% paper title
|
||||
% can use linebreaks \\ within to get better formatting as desired
|
||||
\title{Bare Demo of IEEEtran.cls\\ for Computer Society Journals}
|
||||
%
|
||||
%
|
||||
% author names and IEEE memberships
|
||||
% note positions of commas and nonbreaking spaces ( ~ ) LaTeX will not break
|
||||
% a structure at a ~ so this keeps an author's name from being broken across
|
||||
% two lines.
|
||||
% use \thanks{} to gain access to the first footnote area
|
||||
% a separate \thanks must be used for each paragraph as LaTeX2e's \thanks
|
||||
% was not built to handle multiple paragraphs
|
||||
%
|
||||
%
|
||||
%\IEEEcompsocitemizethanks is a special \thanks that produces the bulleted
|
||||
% lists the Computer Society journals use for "first footnote" author
|
||||
% affiliations. Use \IEEEcompsocthanksitem which works much like \item
|
||||
% for each affiliation group. When not in compsoc mode,
|
||||
% \IEEEcompsocitemizethanks becomes like \thanks and
|
||||
% \IEEEcompsocthanksitem becomes a line break with idention. This
|
||||
% facilitates dual compilation, although admittedly the differences in the
|
||||
% desired content of \author between the different types of papers makes a
|
||||
% one-size-fits-all approach a daunting prospect. For instance, compsoc
|
||||
% journal papers have the author affiliations above the "Manuscript
|
||||
% received ..." text while in non-compsoc journals this is reversed. Sigh.
|
||||
|
||||
\author{Michael~Shell,~\IEEEmembership{Member,~IEEE,}
|
||||
John~Doe,~\IEEEmembership{Fellow,~OSA,}
|
||||
and~Jane~Doe,~\IEEEmembership{Life~Fellow,~IEEE}% <-this % stops a space
|
||||
\IEEEcompsocitemizethanks{\IEEEcompsocthanksitem M. Shell is with the Department
|
||||
of Electrical and Computer Engineering, Georgia Institute of Technology, Atlanta,
|
||||
GA, 30332.\protect\\
|
||||
% note need leading \protect in front of \\ to get a newline within \thanks as
|
||||
% \\ is fragile and will error, could use \hfil\break instead.
|
||||
E-mail: see http://www.michaelshell.org/contact.html
|
||||
\IEEEcompsocthanksitem J. Doe and J. Doe are with Anonymous University.}% <-this % stops a space
|
||||
\thanks{Manuscript received April 19, 2005; revised January 11, 2007.}}
|
||||
|
||||
% note the % following the last \IEEEmembership and also \thanks -
|
||||
% these prevent an unwanted space from occurring between the last author name
|
||||
% and the end of the author line. i.e., if you had this:
|
||||
%
|
||||
% \author{....lastname \thanks{...} \thanks{...} }
|
||||
% ^------------^------------^----Do not want these spaces!
|
||||
%
|
||||
% a space would be appended to the last name and could cause every name on that
|
||||
% line to be shifted left slightly. This is one of those "LaTeX things". For
|
||||
% instance, "\textbf{A} \textbf{B}" will typeset as "A B" not "AB". To get
|
||||
% "AB" then you have to do: "\textbf{A}\textbf{B}"
|
||||
% \thanks is no different in this regard, so shield the last } of each \thanks
|
||||
% that ends a line with a % and do not let a space in before the next \thanks.
|
||||
% Spaces after \IEEEmembership other than the last one are OK (and needed) as
|
||||
% you are supposed to have spaces between the names. For what it is worth,
|
||||
% this is a minor point as most people would not even notice if the said evil
|
||||
% space somehow managed to creep in.
|
||||
|
||||
|
||||
|
||||
% The paper headers
|
||||
\markboth{Journal of \LaTeX\ Class Files,~Vol.~6, No.~1, January~2007}%
|
||||
{Shell \MakeLowercase{\textit{et al.}}: Bare Demo of IEEEtran.cls for Computer Society Journals}
|
||||
% The only time the second header will appear is for the odd numbered pages
|
||||
% after the title page when using the twoside option.
|
||||
%
|
||||
% *** Note that you probably will NOT want to include the author's ***
|
||||
% *** name in the headers of peer review papers. ***
|
||||
% You can use \ifCLASSOPTIONpeerreview for conditional compilation here if
|
||||
% you desire.
|
||||
|
||||
|
||||
|
||||
% The publisher's ID mark at the bottom of the page is less important with
|
||||
% Computer Society journal papers as those publications place the marks
|
||||
% outside of the main text columns and, therefore, unlike regular IEEE
|
||||
% journals, the available text space is not reduced by their presence.
|
||||
% If you want to put a publisher's ID mark on the page you can do it like
|
||||
% this:
|
||||
%\IEEEpubid{0000--0000/00\$00.00~\copyright~2007 IEEE}
|
||||
% or like this to get the Computer Society new two part style.
|
||||
%\IEEEpubid{\makebox[\columnwidth]{\hfill 0000--0000/00/\$00.00~\copyright~2007 IEEE}%
|
||||
%\hspace{\columnsep}\makebox[\columnwidth]{Published by the IEEE Computer Society\hfill}}
|
||||
% Remember, if you use this you must call \IEEEpubidadjcol in the second
|
||||
% column for its text to clear the IEEEpubid mark (Computer Society jorunal
|
||||
% papers don't need this extra clearance.)
|
||||
|
||||
|
||||
|
||||
% use for special paper notices
|
||||
%\IEEEspecialpapernotice{(Invited Paper)}
|
||||
|
||||
|
||||
|
||||
% for Computer Society papers, we must declare the abstract and index terms
|
||||
% PRIOR to the title within the \IEEEcompsoctitleabstractindextext IEEEtran
|
||||
% command as these need to go into the title area created by \maketitle.
|
||||
\IEEEcompsoctitleabstractindextext{%
|
||||
\begin{abstract}
|
||||
%\boldmath
|
||||
The abstract goes here.
|
||||
\end{abstract}
|
||||
% IEEEtran.cls defaults to using nonbold math in the Abstract.
|
||||
% This preserves the distinction between vectors and scalars. However,
|
||||
% if the journal you are submitting to favors bold math in the abstract,
|
||||
% then you can use LaTeX's standard command \boldmath at the very start
|
||||
% of the abstract to achieve this. Many IEEE journals frown on math
|
||||
% in the abstract anyway. In particular, the Computer Society does
|
||||
% not want either math or citations to appear in the abstract.
|
||||
|
||||
% Note that keywords are not normally used for peerreview papers.
|
||||
\begin{IEEEkeywords}
|
||||
Computer Society, IEEEtran, journal, \LaTeX, paper, template.
|
||||
\end{IEEEkeywords}}
|
||||
|
||||
|
||||
% make the title area
|
||||
\maketitle
|
||||
|
||||
|
||||
% To allow for easy dual compilation without having to reenter the
|
||||
% abstract/keywords data, the \IEEEcompsoctitleabstractindextext text will
|
||||
% not be used in maketitle, but will appear (i.e., to be "transported")
|
||||
% here as \IEEEdisplaynotcompsoctitleabstractindextext when compsoc mode
|
||||
% is not selected <OR> if conference mode is selected - because compsoc
|
||||
% conference papers position the abstract like regular (non-compsoc)
|
||||
% papers do!
|
||||
\IEEEdisplaynotcompsoctitleabstractindextext
|
||||
% \IEEEdisplaynotcompsoctitleabstractindextext has no effect when using
|
||||
% compsoc under a non-conference mode.
|
||||
|
||||
|
||||
% For peer review papers, you can put extra information on the cover
|
||||
% page as needed:
|
||||
% \ifCLASSOPTIONpeerreview
|
||||
% \begin{center} \bfseries EDICS Category: 3-BBND \end{center}
|
||||
% \fi
|
||||
%
|
||||
% For peerreview papers, this IEEEtran command inserts a page break and
|
||||
% creates the second title. It will be ignored for other modes.
|
||||
\IEEEpeerreviewmaketitle
|
||||
|
||||
|
||||
|
||||
\section{Introduction}
|
||||
% Computer Society journal papers do something a tad strange with the very
|
||||
% first section heading (almost always called "Introduction"). They place it
|
||||
% ABOVE the main text! IEEEtran.cls currently does not do this for you.
|
||||
% However, You can achieve this effect by making LaTeX jump through some
|
||||
% hoops via something like:
|
||||
%
|
||||
%\ifCLASSOPTIONcompsoc
|
||||
% \noindent\raisebox{2\baselineskip}[0pt][0pt]%
|
||||
% {\parbox{\columnwidth}{\section{Introduction}\label{sec:introduction}%
|
||||
% \global\everypar=\everypar}}%
|
||||
% \vspace{-1\baselineskip}\vspace{-\parskip}\par
|
||||
%\else
|
||||
% \section{Introduction}\label{sec:introduction}\par
|
||||
%\fi
|
||||
%
|
||||
% Admittedly, this is a hack and may well be fragile, but seems to do the
|
||||
% trick for me. Note the need to keep any \label that may be used right
|
||||
% after \section in the above as the hack puts \section within a raised box.
|
||||
|
||||
|
||||
|
||||
% The very first letter is a 2 line initial drop letter followed
|
||||
% by the rest of the first word in caps (small caps for compsoc).
|
||||
%
|
||||
% form to use if the first word consists of a single letter:
|
||||
% \IEEEPARstart{A}{demo} file is ....
|
||||
%
|
||||
% form to use if you need the single drop letter followed by
|
||||
% normal text (unknown if ever used by IEEE):
|
||||
% \IEEEPARstart{A}{}demo file is ....
|
||||
%
|
||||
% Some journals put the first two words in caps:
|
||||
% \IEEEPARstart{T}{his demo} file is ....
|
||||
%
|
||||
% Here we have the typical use of a "T" for an initial drop letter
|
||||
% and "HIS" in caps to complete the first word.
|
||||
\IEEEPARstart{T}{his} demo file is intended to serve as a ``starter file''
|
||||
for IEEE Computer Society journal papers produced under \LaTeX\ using
|
||||
IEEEtran.cls version 1.7 and later.
|
||||
% You must have at least 2 lines in the paragraph with the drop letter
|
||||
% (should never be an issue)
|
||||
I wish you the best of success.
|
||||
|
||||
\hfill mds
|
||||
|
||||
\hfill January 11, 2007
|
||||
|
||||
\subsection{Subsection Heading Here}
|
||||
Subsection text here.
|
||||
|
||||
% needed in second column of first page if using \IEEEpubid
|
||||
%\IEEEpubidadjcol
|
||||
|
||||
\subsubsection{Subsubsection Heading Here}
|
||||
Subsubsection text here.
|
||||
|
||||
|
||||
% An example of a floating figure using the graphicx package.
|
||||
% Note that \label must occur AFTER (or within) \caption.
|
||||
% For figures, \caption should occur after the \includegraphics.
|
||||
% Note that IEEEtran v1.7 and later has special internal code that
|
||||
% is designed to preserve the operation of \label within \caption
|
||||
% even when the captionsoff option is in effect. However, because
|
||||
% of issues like this, it may be the safest practice to put all your
|
||||
% \label just after \caption rather than within \caption{}.
|
||||
%
|
||||
% Reminder: the "draftcls" or "draftclsnofoot", not "draft", class
|
||||
% option should be used if it is desired that the figures are to be
|
||||
% displayed while in draft mode.
|
||||
%
|
||||
%\begin{figure}[!t]
|
||||
%\centering
|
||||
%\includegraphics[width=2.5in]{myfigure}
|
||||
% where an .eps filename suffix will be assumed under latex,
|
||||
% and a .pdf suffix will be assumed for pdflatex; or what has been declared
|
||||
% via \DeclareGraphicsExtensions.
|
||||
%\caption{Simulation Results}
|
||||
%\label{fig_sim}
|
||||
%\end{figure}
|
||||
|
||||
% Note that IEEE typically puts floats only at the top, even when this
|
||||
% results in a large percentage of a column being occupied by floats.
|
||||
% However, the Computer Society has been known to put floats at the bottom.
|
||||
|
||||
|
||||
% An example of a double column floating figure using two subfigures.
|
||||
% (The subfig.sty package must be loaded for this to work.)
|
||||
% The subfigure \label commands are set within each subfloat command, the
|
||||
% \label for the overall figure must come after \caption.
|
||||
% \hfil must be used as a separator to get equal spacing.
|
||||
% The subfigure.sty package works much the same way, except \subfigure is
|
||||
% used instead of \subfloat.
|
||||
%
|
||||
%\begin{figure*}[!t]
|
||||
%\centerline{\subfloat[Case I]\includegraphics[width=2.5in]{subfigcase1}%
|
||||
%\label{fig_first_case}}
|
||||
%\hfil
|
||||
%\subfloat[Case II]{\includegraphics[width=2.5in]{subfigcase2}%
|
||||
%\label{fig_second_case}}}
|
||||
%\caption{Simulation results}
|
||||
%\label{fig_sim}
|
||||
%\end{figure*}
|
||||
%
|
||||
% Note that often IEEE papers with subfigures do not employ subfigure
|
||||
% captions (using the optional argument to \subfloat), but instead will
|
||||
% reference/describe all of them (a), (b), etc., within the main caption.
|
||||
|
||||
|
||||
% An example of a floating table. Note that, for IEEE style tables, the
|
||||
% \caption command should come BEFORE the table. Table text will default to
|
||||
% \footnotesize as IEEE normally uses this smaller font for tables.
|
||||
% The \label must come after \caption as always.
|
||||
%
|
||||
%\begin{table}[!t]
|
||||
%% increase table row spacing, adjust to taste
|
||||
%\renewcommand{\arraystretch}{1.3}
|
||||
% if using array.sty, it might be a good idea to tweak the value of
|
||||
% \extrarowheight as needed to properly center the text within the cells
|
||||
%\caption{An Example of a Table}
|
||||
%\label{table_example}
|
||||
%\centering
|
||||
%% Some packages, such as MDW tools, offer better commands for making tables
|
||||
%% than the plain LaTeX2e tabular which is used here.
|
||||
%\begin{tabular}{|c||c|}
|
||||
%\hline
|
||||
%One & Two\\
|
||||
%\hline
|
||||
%Three & Four\\
|
||||
%\hline
|
||||
%\end{tabular}
|
||||
%\end{table}
|
||||
|
||||
|
||||
% Note that IEEE does not put floats in the very first column - or typically
|
||||
% anywhere on the first page for that matter. Also, in-text middle ("here")
|
||||
% positioning is not used. Most IEEE journals use top floats exclusively.
|
||||
% However, Computer Society journals sometimes do use bottom floats - bear
|
||||
% this in mind when choosing appropriate optional arguments for the
|
||||
% figure/table environments.
|
||||
% Note that, LaTeX2e, unlike IEEE journals, places footnotes above bottom
|
||||
% floats. This can be corrected via the \fnbelowfloat command of the
|
||||
% stfloats package.
|
||||
|
||||
|
||||
|
||||
\section{Conclusion}
|
||||
The conclusion goes here.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% if have a single appendix:
|
||||
%\appendix[Proof of the Zonklar Equations]
|
||||
% or
|
||||
%\appendix % for no appendix heading
|
||||
% do not use \section anymore after \appendix, only \section*
|
||||
% is possibly needed
|
||||
|
||||
% use appendices with more than one appendix
|
||||
% then use \section to start each appendix
|
||||
% you must declare a \section before using any
|
||||
% \subsection or using \label (\appendices by itself
|
||||
% starts a section numbered zero.)
|
||||
%
|
||||
|
||||
|
||||
\appendices
|
||||
\section{Proof of the First Zonklar Equation}
|
||||
Appendix one text goes here.
|
||||
|
||||
% you can choose not to have a title for an appendix
|
||||
% if you want by leaving the argument blank
|
||||
\section{}
|
||||
Appendix two text goes here.
|
||||
|
||||
|
||||
% use section* for acknowledgement
|
||||
\ifCLASSOPTIONcompsoc
|
||||
% The Computer Society usually uses the plural form
|
||||
\section*{Acknowledgments}
|
||||
\else
|
||||
% regular IEEE prefers the singular form
|
||||
\section*{Acknowledgment}
|
||||
\fi
|
||||
|
||||
|
||||
The authors would like to thank...
|
||||
|
||||
|
||||
% Can use something like this to put references on a page
|
||||
% by themselves when using endfloat and the captionsoff option.
|
||||
\ifCLASSOPTIONcaptionsoff
|
||||
\newpage
|
||||
\fi
|
||||
|
||||
|
||||
|
||||
% trigger a \newpage just before the given reference
|
||||
% number - used to balance the columns on the last page
|
||||
% adjust value as needed - may need to be readjusted if
|
||||
% the document is modified later
|
||||
%\IEEEtriggeratref{8}
|
||||
% The "triggered" command can be changed if desired:
|
||||
%\IEEEtriggercmd{\enlargethispage{-5in}}
|
||||
|
||||
% references section
|
||||
|
||||
% can use a bibliography generated by BibTeX as a .bbl file
|
||||
% BibTeX documentation can be easily obtained at:
|
||||
% http://www.ctan.org/tex-archive/biblio/bibtex/contrib/doc/
|
||||
% The IEEEtran BibTeX style support page is at:
|
||||
% http://www.michaelshell.org/tex/ieeetran/bibtex/
|
||||
%\bibliographystyle{IEEEtran}
|
||||
% argument is your BibTeX string definitions and bibliography database(s)
|
||||
%\bibliography{IEEEabrv,../bib/paper}
|
||||
%
|
||||
% <OR> manually copy in the resultant .bbl file
|
||||
% set second argument of \begin to the number of references
|
||||
% (used to reserve space for the reference number labels box)
|
||||
\begin{thebibliography}{1}
|
||||
|
||||
\bibitem{IEEEhowto:kopka}
|
||||
H.~Kopka and P.~W. Daly, \emph{A Guide to \LaTeX}, 3rd~ed.\hskip 1em plus
|
||||
0.5em minus 0.4em\relax Harlow, England: Addison-Wesley, 1999.
|
||||
|
||||
\end{thebibliography}
|
||||
|
||||
% biography section
|
||||
%
|
||||
% If you have an EPS/PDF photo (graphicx package needed) extra braces are
|
||||
% needed around the contents of the optional argument to biography to prevent
|
||||
% the LaTeX parser from getting confused when it sees the complicated
|
||||
% \includegraphics command within an optional argument. (You could create
|
||||
% your own custom macro containing the \includegraphics command to make things
|
||||
% simpler here.)
|
||||
%\begin{biography}[{\includegraphics[width=1in,height=1.25in,clip,keepaspectratio]{mshell}}]{Michael Shell}
|
||||
% or if you just want to reserve a space for a photo:
|
||||
|
||||
\begin{IEEEbiography}{Michael Shell}
|
||||
Biography text here.
|
||||
\end{IEEEbiography}
|
||||
|
||||
% if you will not have a photo at all:
|
||||
\begin{IEEEbiographynophoto}{John Doe}
|
||||
Biography text here.
|
||||
\end{IEEEbiographynophoto}
|
||||
|
||||
% insert where needed to balance the two columns on the last page with
|
||||
% biographies
|
||||
%\newpage
|
||||
|
||||
\begin{IEEEbiographynophoto}{Jane Doe}
|
||||
Biography text here.
|
||||
\end{IEEEbiographynophoto}
|
||||
|
||||
% You can push biographies down or up by placing
|
||||
% a \vfill before or after them. The appropriate
|
||||
% use of \vfill depends on what kind of text is
|
||||
% on the last page and whether or not the columns
|
||||
% are being equalized.
|
||||
|
||||
%\vfill
|
||||
|
||||
% Can be used to pull up biographies so that the bottom of the last one
|
||||
% is flush with the other column.
|
||||
%\enlargethispage{-5in}
|
||||
|
||||
|
||||
|
||||
% that's all folks
|
||||
\end{document}
|
||||
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
%% For dual Beta
|
||||
|
||||
if(show_plots)
|
||||
h_fig = figure;
|
||||
else
|
||||
h_fig = figure('color',[1 1 1],'position',[178 1 934 708],'Visible','off');
|
||||
end
|
||||
|
||||
semilogy(SINR_eff_dual_beta,BLER_meas,plot_style{m+1})
|
||||
hold on
|
||||
grid on
|
||||
semilogy(snr,bler,'m-x');
|
||||
xlim([-15 20])
|
||||
ylim([1e-3 1])
|
||||
if (tx_mode == 5)
|
||||
if (abs_mode==0)
|
||||
s = strcat('LTE TM 5 M2-MIESM MCS ', num2str(mcs(m)), ',beta1= ',num2str(dual_Optimum_Beta1(m)),',beta2= ',num2str(dual_Optimum_Beta2(m)), ', MSE= ',num2str(MSE_final_dual_beta(m)));
|
||||
ss = 'training_tm5_m2miesm_dual_beta';
|
||||
pathname = M2_path;
|
||||
else
|
||||
if (abs_mode ==2)
|
||||
s = strcat('LTE TM 5 M1-MIESM MCS ', num2str(mcs(m)), ',beta1= ',num2str(dual_Optimum_Beta1(m)),',beta2= ',num2str(dual_Optimum_Beta2(m)), ', MSE= ',num2str(MSE_final_dual_beta(m)));
|
||||
ss = 'training_tm5_m1miesm_dual_beta_noMF';
|
||||
pathname = M1_path;
|
||||
else
|
||||
s = strcat('LTE TM 5 EESM MCS ', num2str(mcs(m)), ',beta1= ',num2str(dual_Optimum_Beta1(m)),',beta2= ',num2str(dual_Optimum_Beta2(m)), ', MSE= ',num2str(MSE_final_dual_beta(m)));
|
||||
ss = 'training_tm5_eesm_dual_beta';
|
||||
pathname = EESM_path;
|
||||
end
|
||||
end
|
||||
else
|
||||
if (abs_mode==0)
|
||||
s = strcat('LTE TM ', num2str(tx_mode), ' MIESM MCS ', num2str(mcs(m)), ',beta1= ',num2str(dual_Optimum_Beta1(m)),',beta2= ',num2str(dual_Optimum_Beta2(m)), ', MSE= ',num2str(MSE_final_dual_beta(m)));
|
||||
ss = strcat('training_tm',num2str(tx_mode), '_miesm_dual_beta');
|
||||
pathname = MIESM_path;
|
||||
else
|
||||
s = strcat('LTE TM ', num2str(tx_mode), ' EESM MCS ', num2str(mcs(m)), ',beta1= ',num2str(dual_Optimum_Beta1(m)),',beta2= ',num2str(dual_Optimum_Beta2(m)), ', MSE= ',num2str(MSE_final_dual_beta(m)));
|
||||
ss = strcat('training_tm',num2str(tx_mode), '_eesm_dual_beta');
|
||||
pathname = EESM_path;
|
||||
end
|
||||
end
|
||||
|
||||
title(s);
|
||||
ylabel 'BLER'
|
||||
xlabel 'SINR_{effective}'
|
||||
s2 = strcat('BLER_{meas} MCS ', num2str(mcs(m)));
|
||||
s3 = strcat('BLER_{AWGN} MCS ', num2str(mcs(m)));
|
||||
legend(s2,s3, 'Location', 'SouthWest');
|
||||
|
||||
if(save_out)
|
||||
print(fullfile(pathname,strcat(ss, '_mcs', num2str(mcs(m)),'.eps')),'-dDEVICE','epsc2');
|
||||
print(fullfile(pathname,strcat(ss, '_mcs', num2str(mcs(m)),'.fig')),'-dDEVICE','fig');
|
||||
print(fullfile(pathname,strcat(ss, '_mcs', num2str(mcs(m)),'.jpg')),'-dDEVICE','jpg');
|
||||
|
||||
fprintf(fid,'\\begin{figure}[htbp]\n');
|
||||
fprintf(fid,'\\centering\n');
|
||||
fprintf(fid,'\\includegraphics[scale=0.4]{%s}\n',fullfile(pathname,strcat(ss, '_mcs', num2str(mcs(m)),'.eps')));
|
||||
fprintf(fid,'\\caption{\\scriptsize{%s}}\n',s);
|
||||
fprintf(fid,'\\label{fig:mcs%d}\n',mcs(m));
|
||||
fprintf(fid,'\\end{figure}\n\n');
|
||||
|
||||
end
|
||||
%% For Single Beta
|
||||
|
||||
if(show_plots)
|
||||
h_fig = figure;
|
||||
else
|
||||
h_fig = figure('color',[1 1 1],'position',[178 1 934 708],'Visible','off');
|
||||
end
|
||||
|
||||
semilogy(SINR_eff_single_beta,BLER_meas,plot_style{m+1})
|
||||
hold on
|
||||
grid on
|
||||
semilogy(snr,bler,'m-x');
|
||||
xlim([-15 20])
|
||||
ylim([1e-3 1])
|
||||
if (tx_mode == 5)
|
||||
if (abs_mode==0)
|
||||
s = strcat('LTE TM 5 M2-MIESM MCS ', num2str(mcs(m)), ',beta1= beta2= ',num2str(single_Optimum_Beta(m)),', MSE= ',num2str(MSE_final_single_beta(m)));
|
||||
ss = 'training_tm5_m2miesm_single_beta';
|
||||
pathname = M2_path;
|
||||
else
|
||||
if (abs_mode ==2)
|
||||
s = strcat('LTE TM 5 M1-MIESM MCS ', num2str(mcs(m)), ',beta1= beta2= ',num2str(single_Optimum_Beta(m)),', MSE= ',num2str(MSE_final_single_beta(m)));
|
||||
ss = 'training_tm5_m1miesm_single_beta_noMF';
|
||||
pathname = M1_path;
|
||||
else
|
||||
s = strcat('LTE TM 5 EESM MCS ', num2str(mcs(m)), ',beta1= beta2= ',num2str(single_Optimum_Beta(m)),', MSE= ',num2str(MSE_final_single_beta(m)));
|
||||
ss = 'training_tm5_eesm_single_beta';
|
||||
pathname = EESM_path;
|
||||
end
|
||||
end
|
||||
else
|
||||
if (abs_mode==0)
|
||||
s = strcat('LTE TM ', num2str(tx_mode), ' MIESM MCS ', num2str(mcs(m)), ',beta1= beta2= ',num2str(single_Optimum_Beta(m)),', MSE= ',num2str(MSE_final_single_beta(m)));
|
||||
ss = strcat('training_tm',num2str(tx_mode), '_miesm_single_beta');
|
||||
pathname = MIESM_path;
|
||||
else
|
||||
s = strcat('LTE TM ', num2str(tx_mode), ' EESM MCS ', num2str(mcs(m)), ',beta1= beta2= ',num2str(single_Optimum_Beta(m)),', MSE= ',num2str(MSE_final_single_beta(m)));
|
||||
ss = strcat('training_tm',num2str(tx_mode), '_eesm_single_beta');
|
||||
pathname = EESM_path;
|
||||
end
|
||||
end
|
||||
|
||||
title(s);
|
||||
ylabel 'BLER'
|
||||
xlabel 'SINR_{effective}'
|
||||
s2 = strcat('BLER_{meas} MCS ', num2str(mcs(m)));
|
||||
s3 = strcat('BLER_{AWGN} MCS ', num2str(mcs(m)));
|
||||
legend(s2,s3, 'Location', 'SouthWest');
|
||||
|
||||
if(save_out)
|
||||
print(fullfile(pathname,strcat(ss, '_mcs', num2str(mcs(m)),'.eps')),'-dDEVICE','epsc2');
|
||||
print(fullfile(pathname,strcat(ss, '_mcs', num2str(mcs(m)),'.fig')),'-dDEVICE','fig');
|
||||
print(fullfile(pathname,strcat(ss, '_mcs', num2str(mcs(m)),'.jpg')),'-dDEVICE','jpg');
|
||||
|
||||
fprintf(fid,'\\begin{figure}[htbp]\n');
|
||||
fprintf(fid,'\\centering\n');
|
||||
fprintf(fid,'\\includegraphics[scale=0.4]{%s}\n',fullfile(pathname,strcat(ss, '_mcs', num2str(mcs(m)),'.eps')));
|
||||
fprintf(fid,'\\caption{\\scriptsize{%s}}\n',s);
|
||||
fprintf(fid,'\\label{fig:mcs%d}\n',mcs(m));
|
||||
fprintf(fid,'\\end{figure}\n\n');
|
||||
if (rem(m,2)==0)
|
||||
fprintf(fid,'\\clearpage\n\n');
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
function delta=delta_BLER_1(beta)
|
||||
global SINR_p SINR_awgn abs_mode modu Pm tx_mode alpha seta p mi_file mi_2_file
|
||||
|
||||
if(length(beta)==2)
|
||||
if(abs_mode==0) %MIESM Mapping
|
||||
|
||||
eval('load(mi_file)')
|
||||
|
||||
[x y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
%SINR_eff = [];
|
||||
for t=1:1:x
|
||||
s = SINR_p(t,:);
|
||||
s(s<-10)=-10;
|
||||
s(s>49)=49;
|
||||
|
||||
eval(['SI_p = interp1(newSNR,newC_siso_' num2str(modu) 'QAM,s, ''linear'' , ''extrap'');']);
|
||||
RBIR(t) = (sum(SI_p/beta(1))/Pm);
|
||||
end
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear');
|
||||
SINR_eff = SINR_eff * beta(2);
|
||||
|
||||
elseif(abs_mode==2)
|
||||
|
||||
eval('load(mi_file)')
|
||||
|
||||
if(tx_mode~=5)
|
||||
error('IA-MIESM only for LTE TM5!!!')
|
||||
end
|
||||
|
||||
eval('load(mi_2_file)')
|
||||
|
||||
[x y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
for t=1:1:x
|
||||
s = SINR_p(t,:);
|
||||
s(s<-10)=-10;
|
||||
s(s>38)=38;
|
||||
|
||||
a = round(alpha(t,:)*100);
|
||||
a(a==0) = 1;
|
||||
a(a>200)=200;
|
||||
b = round(seta(t,:)*100);
|
||||
b(b==0) = 1;
|
||||
b(b>200)=200;
|
||||
|
||||
for u=1:length(a)
|
||||
if(modu==16)
|
||||
SI_p(u) = data_mode5_16_16(b(u) ,a(u), round(s(u) + 11));
|
||||
else
|
||||
SI_p(u) = data_mode5_4_4(b(u) ,a(u), round(s(u) + 11));
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
RBIR(t) = (sum(SI_p/beta(1))/Pm);
|
||||
|
||||
end
|
||||
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear','extrap');
|
||||
SINR_eff = SINR_eff .* beta(2);
|
||||
%SINR_eff = 10*log10((10.^(SINR_eff/10)) * beta(2));
|
||||
else %% EESM Mapping
|
||||
|
||||
|
||||
SINR_eff= 10*log10(-1*beta(2)*log((1/p)*sum(exp((-10.^(SINR_p'./10))./beta(1)))));
|
||||
|
||||
|
||||
end
|
||||
|
||||
else %when beta2=beta1=beta
|
||||
if(abs_mode==0) %MIESM Mapping
|
||||
|
||||
eval('load(mi_file)')
|
||||
|
||||
[x y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
%SINR_eff = [];
|
||||
for t=1:1:x
|
||||
s = SINR_p(t,:);
|
||||
s(s<-10)=-10;
|
||||
s(s>49)=49;
|
||||
|
||||
eval(['SI_p = interp1(newSNR,newC_siso_' num2str(modu) 'QAM,s, ''linear'' , ''extrap'');']);
|
||||
RBIR(t) = (sum(SI_p/beta)/Pm);
|
||||
end
|
||||
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear');
|
||||
SINR_eff = SINR_eff * beta;
|
||||
|
||||
elseif(abs_mode==2)
|
||||
|
||||
eval('load(mi_file)')
|
||||
|
||||
if(tx_mode~=5)
|
||||
error('IA-MIESM only for LTE TM5!!!')
|
||||
end
|
||||
|
||||
eval('load(mi_2_file)')
|
||||
|
||||
[x y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
for t=1:1:x
|
||||
s = SINR_p(t,:);
|
||||
s(s<-10)=-10;
|
||||
s(s>38)=38;
|
||||
|
||||
a = round(alpha(t,:)*100);
|
||||
a(a==0) = 1;
|
||||
a(a>200)=200;
|
||||
b = round(seta(t,:)*100);
|
||||
b(b==0) = 1;
|
||||
b(b>200)=200;
|
||||
|
||||
for u=1:length(a)
|
||||
if(modu==16)
|
||||
SI_p(u) = data_mode5_16_16(b(u) ,a(u), round(s(u) + 11));
|
||||
else
|
||||
SI_p(u) = data_mode5_4_4(b(u) ,a(u), round(s(u) + 11));
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
RBIR(t) = (sum(SI_p/beta)/Pm);
|
||||
|
||||
end
|
||||
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear','extrap');
|
||||
SINR_eff = SINR_eff .* beta;
|
||||
%SINR_eff = 10*log10((10.^(SINR_eff/10)) * beta(2));
|
||||
else %% EESM Mapping
|
||||
|
||||
|
||||
SINR_eff= 10*log10(-1*beta*log((1/p)*sum(exp((-10.^(SINR_p'./10))./beta))));
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
delta = mean((abs(SINR_awgn) - abs(SINR_eff)).^2);
|
||||
@@ -0,0 +1,347 @@
|
||||
%***************************************************************************************
|
||||
% Calibration of Adjustment Factors for Exponential Effective SINR Mapping Methdology
|
||||
% For 3GPP Long Term Evolution (LTE)
|
||||
% Eurecom Institute
|
||||
% (c) Imran Latif, Communications Mobile, 2012
|
||||
%***************************************************************************************
|
||||
%close all
|
||||
%clear all
|
||||
|
||||
%***************************************************************************************
|
||||
% Some basic initializations
|
||||
%***************************************************************************************
|
||||
global SINR_p BLER_meas abs_mode modu Pm tx_mode alpha seta
|
||||
warning on
|
||||
set(0, 'DefaultLineMarkerSize', 10);
|
||||
set(0, 'Defaultaxesfontsize', 10);
|
||||
set(0, 'DefaultLineLineWidth', 2);
|
||||
set(0, 'DefaultAxesFontName', 'Helvetica');
|
||||
set(0, 'DefaultTextFontName', 'Helvetica');
|
||||
|
||||
plot_style = {'b*';'r*';'g*';'y*';'k*';...
|
||||
'bo';'ro';'go';'yo';'ko';...
|
||||
'bs';'rs';'gs';'ys';'ks';...
|
||||
'bd';'rd';'gd';'yd';'kd';...
|
||||
'bx';'rx';'gx';'yx';'kx';...
|
||||
'b+';'r+';'g+';'y+';'k+'};
|
||||
|
||||
echo off;
|
||||
pathname = '/homes/latif/devel/trunk/openair1/SIMULATION/LTE_PHY/TM5_ideal_CE/MIESM/M1/Polyfit';
|
||||
%root_path = '/homes/latif/OpenAirPlatform/test_devel/openair1_multi_eNb_UE/SIMULATION/LTE_PHY/BLER_SIMULATIONS/awgn_bler_new/';
|
||||
%%
|
||||
%***************************************************************************************
|
||||
% Input Parameters used for the training of adjustment Factors (betas)
|
||||
%***************************************************************************************
|
||||
mcs = [0 2 4 6 7 8 9];
|
||||
% An array which hold the number of LTE MCS which is to be calibrated for
|
||||
% abstraction
|
||||
|
||||
s2=[];
|
||||
s3=[];
|
||||
% String arrays used for printing in plots
|
||||
|
||||
tx_mode=5;
|
||||
%1--> SISO, 2 --> Alamouti, 5 --> MU-MIMO ,6 --> TX Beamforming
|
||||
% tells which transmission mode is to be abstracted.
|
||||
|
||||
abs_mode=2; % 0:MIESM (M2-MIESM), 1:EESM, 2:IA-MIESM (M1-MIESM)
|
||||
%tells which abstraction methodology is to be used.
|
||||
|
||||
Pm=100; %2*50 QPSK
|
||||
% Used for calculating RBIR
|
||||
|
||||
modu=4;
|
||||
% Modulation used.
|
||||
|
||||
p=50;
|
||||
save_out=1;
|
||||
|
||||
|
||||
if(save_out)
|
||||
fid = fopen('IA_polyfit_M1_MIESM.tex','w');
|
||||
fprintf(fid,'\\documentclass[english,12pt,a4paper]{article}\n\n');
|
||||
fprintf(fid,'\\usepackage{times}\n');
|
||||
fprintf(fid,'\\usepackage{babel}\n');
|
||||
fprintf(fid,'\\usepackage{graphicx}\n');
|
||||
fprintf(fid,'\\usepackage{hyperref}\n\n');
|
||||
fprintf(fid,'\\begin{document}\n\n');
|
||||
fprintf(fid,'\\title{%s}\n\n','MU-MIMO with IA: Results of Abstraction using Polynomial fitting for M1-MIESM');
|
||||
fprintf(fid,'\\maketitle\n\n');
|
||||
fprintf(fid,'\\newpage\n\n');
|
||||
fprintf(fid,'\\listoffigures\n\n');
|
||||
fprintf(fid,'\\listoftables\n\n');
|
||||
fprintf(fid,'\\newpage\n\n');
|
||||
end
|
||||
|
||||
disp('*******************************************************************\n')
|
||||
%printf('TX Mode = %d, Abstraction Mode = %d\n',tx_mode,abs_mode);
|
||||
disp('*******************************************************************\n')
|
||||
%***************************************************************************************
|
||||
% Main Execution Loop starts from here:
|
||||
%***************************************************************************************
|
||||
for m=1:1:length(mcs)
|
||||
|
||||
ss = strcat('LTE TM5 M1 MIESM MCS ', num2str(mcs(m)));
|
||||
|
||||
if(mcs(m) >9 && mcs(m) < 17)
|
||||
modu=16;
|
||||
Pm=200; %4*50 16QAM
|
||||
else if(mcs(m) > 16 && mcs(m) < 28)
|
||||
modu = 64;
|
||||
Pm=300; %6 *50 64QAM
|
||||
end
|
||||
end
|
||||
%%
|
||||
% %***************************************************************************************
|
||||
% %Reference AWGN Curves
|
||||
% %***************************************************************************************
|
||||
% data = dlmread(sprintf('/homes/latif/devel/trunk/openair1/SIMULATION/LTE_PHY/awgn_bler_tx1_mcs%d.csv',mcs(m)),';',1,0);
|
||||
% snr = data(:,1);
|
||||
% ble = data(:,5)./data(:,6); % round 1
|
||||
%
|
||||
% blerr = ble(ble<0.99);
|
||||
% bler = blerr(blerr>0.001);
|
||||
%
|
||||
% snr = snr(ble<0.99);
|
||||
% snr = snr(blerr>0.001);
|
||||
%
|
||||
% % snr_interp = snr(1):0.001:snr(end);
|
||||
% % bler_interp = interp1(snr,bler,snr_interp,'linear');
|
||||
% % snr = snr_interp;
|
||||
% % bler = bler_interp;
|
||||
%
|
||||
% %***************************************************************************************
|
||||
% % Data Extraction on Sub carrier basis data file saved using dlsim and reference
|
||||
% % SINR Calculation based on Reference AWGN Curve
|
||||
% %***************************************************************************************
|
||||
eval(['data_all = data_all' num2str(mcs(m)) ';']);
|
||||
BLER_meas = data_all(:,end);
|
||||
%
|
||||
% SINR_awgn = interp1(bler, snr, BLER_meas,'linear','extrap');
|
||||
% SINR_awgn = SINR_awgn';
|
||||
%%
|
||||
%***************************************************************************************
|
||||
% Calculation of SINR per subcarrier
|
||||
%***************************************************************************************
|
||||
%for SISO
|
||||
switch(tx_mode)
|
||||
case 1
|
||||
ch_tmp = data_all(:,2:51);
|
||||
abs_channel = (abs(ch_tmp).^2);
|
||||
input_snr = 10.^(data_all(:,1)/10);
|
||||
input_snr = repmat(input_snr,1,50);
|
||||
SINR_p = 10*log10(input_snr.*abs_channel);
|
||||
|
||||
case 2
|
||||
ch1_tmp = data_all(:,2:2:100);
|
||||
ch2_tmp = data_all(:,3:2:101);
|
||||
abs_channel1 = (abs(ch1_tmp).^2)/2;
|
||||
abs_channel2 = (abs(ch2_tmp).^2)/2;
|
||||
input_snr = 10.^(data_all(:,1)/10);
|
||||
input_snr = repmat(input_snr,1,50);
|
||||
SINR_p = 10*log10(input_snr.*abs_channel1 + input_snr.*abs_channel2);%- 10*log10(2);
|
||||
|
||||
case 5
|
||||
prec1_tmp = data_all(:,203:end-1);
|
||||
prec2_tmp = arrayfun(@opposite_q,prec1_tmp);
|
||||
q1 = arrayfun(@demap_q,prec1_tmp);
|
||||
%q2 = q1;
|
||||
q2 = arrayfun(@demap_q,prec2_tmp);
|
||||
ch1_tmp = data_all(:,2:2:100);
|
||||
ch2_tmp = data_all(:,3:2:101);
|
||||
snr_tmp = 10.^(data_all(:,1)/10);
|
||||
snr_tmp = repmat(snr_tmp,1,50);
|
||||
|
||||
alpha =(1/2)*abs(ch1_tmp + q1.*ch2_tmp);
|
||||
seta = (1/2)*((abs(ch1_tmp + q2.*ch2_tmp)));
|
||||
|
||||
if (abs_mode==2 )
|
||||
SINR_p = 10*log10(snr_tmp.*(alpha.^2));%-10*log10(2);
|
||||
else
|
||||
SINR_p = 10*log10((snr_tmp.*(alpha.^2)) ./ ((snr_tmp.*(seta.^2)) + 1));
|
||||
end
|
||||
|
||||
case 6
|
||||
prec_tmp = data_all(:,203:end-1);
|
||||
q = arrayfun(@demap_q,prec_tmp);
|
||||
ch1_tmp = data_all(:,2:2:100);
|
||||
ch2_tmp = data_all(:,3:2:101);
|
||||
snr_tmp = 10.^(data_all(:,1)/10);
|
||||
snr_tmp = repmat(snr_tmp,1,50);
|
||||
ch_composite = (abs(ch1_tmp + q.*ch2_tmp))/sqrt(2);
|
||||
SINR_p = 10*log10((snr_tmp.*((ch_composite).^2)));
|
||||
|
||||
end
|
||||
|
||||
%***************************************************************************************
|
||||
% for coarse beta calculation:
|
||||
%***************************************************************************************
|
||||
% beta_vec = 1:0.1:30;
|
||||
% delta = zeros(size(beta_vec));
|
||||
% for beta=1:length(beta_vec)
|
||||
% delta(beta)=delta_BLER_1((beta_vec(beta)));
|
||||
% end
|
||||
% [val ind] = min(delta);
|
||||
% opt_beta_new(mcs(m)) = beta_vec(ind);
|
||||
%***************************************************************************************
|
||||
% for optmimized betas calculation using fminsearch
|
||||
%***************************************************************************************
|
||||
%beta_out=[1.0151 1.0565];
|
||||
beta_out=zeros(1,2);
|
||||
%[opt_beta(mcs(m)), MSE] = fminsearch(@delta_BLER_1,opt_beta_new(mcs(m)))
|
||||
[beta_out, std_deviat] = fminsearch(@polyfit_delta_BLER,[1 1])
|
||||
|
||||
%***************************************************************************************
|
||||
% Calculation of Effective SINR based on optimized beta values
|
||||
%***************************************************************************************
|
||||
|
||||
if(abs_mode==0) %MIESM Mapping
|
||||
|
||||
eval(['load ' '/homes/latif/devel/trunk/openair1/SIMULATION/LTE_PHY/Abstraction/siso_MI_abs_' num2str(modu) 'Qam.mat'])
|
||||
|
||||
[xize y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
for t=1:1:xize
|
||||
s = SINR_p(t,:);
|
||||
s(s<-10)=-10;
|
||||
s(s>49)=49;
|
||||
eval(['SI_p = interp1(newSNR,newC_siso_' num2str(modu) 'QAM,s, ''linear'' , ''extrap'');']);
|
||||
RBIR(t) = (sum(SI_p/beta_out(1))/Pm);
|
||||
%RBIR(t) = (sum(SI_p)/Pm);
|
||||
end
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear');
|
||||
SINR_eff = SINR_eff .* beta_out(2);
|
||||
|
||||
|
||||
elseif(abs_mode==2)
|
||||
|
||||
eval(['load ' '/homes/latif/devel/trunk/openair1/SIMULATION/LTE_PHY/Abstraction/siso_MI_abs_' num2str(modu) 'Qam.mat'])
|
||||
|
||||
|
||||
if(tx_mode~=5)
|
||||
error('IA-MIESM only for LTE TM5!!!')
|
||||
end
|
||||
|
||||
if(modu==4)
|
||||
eval(['load ' '/homes/latif/devel/trunk/openair1/EMOS/LTE/POST_PROCESSING/Mode_5/mat_Files/data_mode5_4_' num2str(modu) '_morerealizations.mat'])
|
||||
else
|
||||
if(modu==16)
|
||||
eval(['load ' '/homes/latif/devel/trunk/openair1/EMOS/LTE/POST_PROCESSING/Mode_5/mat_Files/data_mode5_16_16.mat'])
|
||||
end
|
||||
end
|
||||
|
||||
[xize y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
for t=1:1:xize
|
||||
s = SINR_p(t,:);
|
||||
s(s<-10)=-10;
|
||||
s(s>49)=49;
|
||||
|
||||
a = round(alpha(t,:)*100);
|
||||
a(a==0) = 1;
|
||||
a(a>200)=200;
|
||||
b = round(seta(t,:)*100);
|
||||
b(b==0) = 1;
|
||||
b(b>200)=200;
|
||||
|
||||
for u=1:length(a)
|
||||
if(modu==16)
|
||||
SI_p(u) = data_mode5_16_16(b(u) ,a(u), round(s(u) + 11));
|
||||
else
|
||||
SI_p(u) = data_mode5_4_4(b(u) ,a(u), round(s(u) + 11));
|
||||
end
|
||||
end
|
||||
RBIR(t) = (sum(SI_p/beta_out(1))/Pm);
|
||||
end
|
||||
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear');
|
||||
SINR_eff = SINR_eff .* beta_out(2);
|
||||
%SINR_eff = 10*log10((10.^(SINR_eff/10)) .* beta_out(2));
|
||||
|
||||
else %% EESM Mapping
|
||||
|
||||
SINR_eff= 10*log10(-1*beta_out(2)*log((1/p)*sum(exp((-10.^(SINR_p'./10))./beta_out(1)))));
|
||||
end
|
||||
|
||||
%***************************************************************************************
|
||||
% PolyNomial Calculation
|
||||
%***************************************************************************************
|
||||
|
||||
[po s mu] = polyfit(SINR_eff,((BLER_meas))',3);
|
||||
[f] = polyval(po,SINR_eff,s,mu);
|
||||
|
||||
%***************************************************************************************
|
||||
%MSE Calculation
|
||||
%***************************************************************************************
|
||||
% MSE_final(mcs(m)+1) = mean((SINR_awgn - SINR_eff).^2);
|
||||
Optimum_beta1(mcs(m)+1) = beta_out(1);
|
||||
Optimum_beta2(mcs(m)+1) = beta_out(2);
|
||||
%***************************************************************************************
|
||||
% BLER Plot w.r.t Mean Effective SINR
|
||||
%***************************************************************************************
|
||||
% figure;
|
||||
% avg_SINR_p = mean(SINR_p');
|
||||
% hist(avg_SINR_p)
|
||||
% s = strcat('Average_SINR_p, MCS = ',num2str(mcs(m)));
|
||||
% title(2)
|
||||
% figure;
|
||||
% grid on
|
||||
% semilogy(avg_SINR_p,BLER_meas,plot_style{m+1})
|
||||
% xlim([-8 15])
|
||||
% ylim([1e-3 1])
|
||||
% s = strcat('LTE TM1 Avergae Abstraction MCS ', num2str(mcs(m)));
|
||||
% title(s);
|
||||
% ylabel 'BLER'
|
||||
% xlabel 'SINR_{average}'
|
||||
% s2 = strcat('BLER_{meas} MCS ', num2str(mcs(m)));
|
||||
% legend(s2, 'Location', 'Best');
|
||||
|
||||
%***************************************************************************************
|
||||
% BLER Plot w.r.t Effective SINR
|
||||
%***************************************************************************************
|
||||
% figure;
|
||||
% hist(SINR_eff)
|
||||
% s = strcat('SINR_eff, MCS = ',num2str(mcs(m)));
|
||||
% title(s)
|
||||
h_fig = figure;
|
||||
semilogy(SINR_eff,BLER_meas,plot_style{m+1})
|
||||
hold on
|
||||
grid on
|
||||
semilogy(SINR_eff,f,'mx');
|
||||
xlim([-20 20])
|
||||
ylim([1e-3 1])
|
||||
s = strcat(ss, ',beta1= ', num2str(Optimum_beta1(mcs(m)+1)),', beta2= ',num2str(Optimum_beta2(mcs(m)+1)));
|
||||
title(s);
|
||||
ylabel 'BLER'
|
||||
xlabel 'SINR_{effective}'
|
||||
s2 = strcat('BLER_{meas} MCS ', num2str(mcs(m)));
|
||||
s3 = strcat('BLER_{AWGN} MCS ', num2str(mcs(m)));
|
||||
legend(s2,s3, 'Location', 'Best');
|
||||
|
||||
if(save_out==1)
|
||||
saveas(h_fig,fullfile(pathname,strcat('IA_RX_M1-MIESM_TX5_mcs',num2str(mcs(m)) ,'.eps')),'epsc2');
|
||||
saveas(h_fig,fullfile(pathname,strcat('IA_RX_M1-MIESM_TX5_mcs',num2str(mcs(m)) ,'.fig')),'fig');
|
||||
saveas(h_fig,fullfile(pathname,strcat('IA_RX_M1-MIESM_TX5_mcs',num2str(mcs(m)) ,'.jpg')),'jpg');
|
||||
|
||||
fprintf(fid,'\\begin{figure}[!h]\n');
|
||||
fprintf(fid,'\\centering\n');
|
||||
fprintf(fid,'\\includegraphics[scale=0.5]{%s}\n',fullfile(pathname,strcat('IA_RX_M1_MIESM_TX5_mcs', num2str(mcs(m)),'.eps')));
|
||||
fprintf(fid,'\\caption{%s}\n',s);
|
||||
fprintf(fid,'\\label{fig:mcs%d}\n',mcs(m));
|
||||
fprintf(fid,'\\end{figure}\n\n');
|
||||
end
|
||||
end
|
||||
if(save_out)
|
||||
fprintf(fid,'\\end{document}\n');
|
||||
fclose(fid);
|
||||
end
|
||||
|
||||
%***************************************************************************************
|
||||
%For saving the files
|
||||
%***************************************************************************************
|
||||
% if(save_out)
|
||||
% save(strcat('opt_beta_mcs',num2str(mcs(m)),'.dat'),'Optimum_beta*')
|
||||
% save(strcat('MSE_mcs',num2str(mcs(m)),'.dat'),'MSE_final')
|
||||
% end
|
||||
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
function std_deviat=polyfit_delta_BLER(beta)
|
||||
global SINR_p BLER_meas abs_mode modu Pm tx_mode alpha seta
|
||||
|
||||
p = 50;
|
||||
if(abs_mode==0) %MIESM Mapping
|
||||
|
||||
eval(['load ' '/homes/latif/devel/trunk/openair1/SIMULATION/LTE_PHY/Abstraction/siso_MI_abs_' num2str(modu) 'Qam.mat'])
|
||||
|
||||
[x y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
%SINR_eff = [];
|
||||
for t=1:1:x
|
||||
s = SINR_p(t,:);
|
||||
s(s<-10)=-10;
|
||||
s(s>49)=49;
|
||||
|
||||
eval(['SI_p = interp1(newSNR,newC_siso_' num2str(modu) 'QAM,s, ''linear'' , ''extrap'');']);
|
||||
RBIR(t) = (sum(SI_p/beta(1))/Pm);
|
||||
end
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear');
|
||||
SINR_eff = SINR_eff .* beta(2);
|
||||
|
||||
elseif(abs_mode==2)
|
||||
|
||||
eval(['load ' '/homes/latif/devel/trunk/openair1/SIMULATION/LTE_PHY/Abstraction/siso_MI_abs_' num2str(modu) 'Qam.mat'])
|
||||
|
||||
if(tx_mode~=5)
|
||||
error('IA-MIESM only for LTE TM5!!!')
|
||||
end
|
||||
|
||||
if(modu==4)
|
||||
eval(['load ' '/homes/latif/devel/trunk/openair1/EMOS/LTE/POST_PROCESSING/Mode_5/mat_Files/data_mode5_4_' num2str(modu) '_morerealizations.mat'])
|
||||
else
|
||||
if(modu==16)
|
||||
eval(['load ' '/homes/latif/devel/trunk/openair1/EMOS/LTE/POST_PROCESSING/Mode_5/mat_Files/data_mode5_16_16.mat'])
|
||||
end
|
||||
end
|
||||
|
||||
[x y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
for t=1:1:x
|
||||
s = SINR_p(t,:);
|
||||
s(s<-10)=-10;
|
||||
s(s>49)=49;
|
||||
|
||||
a = round(alpha(t,:)*100);
|
||||
a(a==0) = 1;
|
||||
a(a>200)=200;
|
||||
b = round(seta(t,:)*100);
|
||||
b(b==0) = 1;
|
||||
b(b>200)=200;
|
||||
|
||||
for u=1:length(a)
|
||||
if(modu==16)
|
||||
SI_p(u) = data_mode5_16_16(b(u) ,a(u), round(s(u) + 11));
|
||||
else
|
||||
SI_p(u) = data_mode5_4_4(b(u) ,a(u), round(s(u) + 11));
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
RBIR(t) = (sum(SI_p/beta(1))/Pm);
|
||||
|
||||
end
|
||||
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear','extrap');
|
||||
SINR_eff = SINR_eff .* beta(2);
|
||||
%SINR_eff = 10*log10((10.^(SINR_eff/10)) .* beta(2));
|
||||
else %% EESM Mapping
|
||||
|
||||
SINR_eff= 10*log10(-1*beta(2)*log((1/p)*sum(exp((-10.^(SINR_p'./10))./beta(1)))));
|
||||
|
||||
|
||||
end
|
||||
[po s mu] = polyfit(SINR_eff,((BLER_meas))',3);
|
||||
[f] = polyval(po,SINR_eff,s,mu);
|
||||
|
||||
std_deviat = mean(((BLER_meas)' - f).^2);
|
||||
@@ -0,0 +1,132 @@
|
||||
function [SINR_eff]=sinr_Eff_Calc(beta)
|
||||
global SINR_p abs_mode modu Pm tx_mode alpha seta p mi_file mi_2_file
|
||||
|
||||
|
||||
if(length(beta)==2)
|
||||
|
||||
if(abs_mode==0) %MIESM Mapping
|
||||
|
||||
|
||||
eval('load(mi_file)')
|
||||
|
||||
[xize y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
for t=1:1:xize
|
||||
s = SINR_p(t,:);
|
||||
s(s<-10)=-10;
|
||||
s(s>49)=49;
|
||||
eval(['SI_p = interp1(newSNR,newC_siso_' num2str(modu) 'QAM,s, ''linear'' , ''extrap'');']);
|
||||
RBIR(t) = (sum(SI_p/beta(1))/Pm);
|
||||
%RBIR(t) = (sum(SI_p)/Pm);
|
||||
end
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear');
|
||||
SINR_eff = SINR_eff * beta(2);
|
||||
|
||||
|
||||
elseif(abs_mode==2)
|
||||
|
||||
eval('load(mi_file)')
|
||||
|
||||
if(tx_mode~=5)
|
||||
error('IA-MIESM only for LTE TM5!!!')
|
||||
end
|
||||
|
||||
eval('load(mi_2_file)')
|
||||
|
||||
[xize y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
for t=1:1:xize
|
||||
s = SINR_p(t,:);
|
||||
s(s<-10)=-10;
|
||||
s(s>37)=38;
|
||||
|
||||
a = round(alpha(t,:)*100);
|
||||
a(a==0) = 1;
|
||||
a(a>200)=200;
|
||||
b = round(seta(t,:)*100);
|
||||
b(b==0) = 1;
|
||||
b(b>200)=200;
|
||||
|
||||
for u=1:length(a)
|
||||
if(modu==16)
|
||||
SI_p(u) = data_mode5_16_16(b(u) ,a(u), round(s(u) + 11));
|
||||
else
|
||||
SI_p(u) = data_mode5_4_4(b(u) ,a(u), round(s(u) + 11));
|
||||
end
|
||||
end
|
||||
RBIR(t) = (sum(SI_p/beta(1))/Pm);
|
||||
end
|
||||
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear','extrap');
|
||||
SINR_eff = SINR_eff .* beta(2);
|
||||
%SINR_eff = 10*log10((10.^(SINR_eff/10)) * beta_out(2));
|
||||
|
||||
else %% EESM Mapping
|
||||
|
||||
SINR_eff= 10*log10(-1*beta(2)*log((1/p)*sum(exp((-10.^(SINR_p'./10))./beta(1)))));
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
if(abs_mode==0) %MIESM Mapping
|
||||
|
||||
|
||||
eval('load(mi_file)')
|
||||
|
||||
[xize y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
for t=1:1:xize
|
||||
s = SINR_p(t,:);
|
||||
s(s<-10)=-10;
|
||||
s(s>49)=49;
|
||||
eval(['SI_p = interp1(newSNR,newC_siso_' num2str(modu) 'QAM,s, ''linear'' , ''extrap'');']);
|
||||
RBIR(t) = (sum(SI_p/beta)/Pm);
|
||||
%RBIR(t) = (sum(SI_p)/Pm);
|
||||
end
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear');
|
||||
SINR_eff = SINR_eff * beta;
|
||||
|
||||
|
||||
elseif(abs_mode==2)
|
||||
|
||||
eval('load(mi_file)')
|
||||
|
||||
if(tx_mode~=5)
|
||||
error('IA-MIESM only for LTE TM5!!!')
|
||||
end
|
||||
|
||||
eval('load(mi_2_file)')
|
||||
|
||||
[xize y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
for t=1:1:xize
|
||||
s = SINR_p(t,:);
|
||||
s(s<-10)=-10;
|
||||
s(s>37)=38;
|
||||
|
||||
a = round(alpha(t,:)*100);
|
||||
a(a==0) = 1;
|
||||
a(a>200)=200;
|
||||
b = round(seta(t,:)*100);
|
||||
b(b==0) = 1;
|
||||
b(b>200)=200;
|
||||
|
||||
for u=1:length(a)
|
||||
if(modu==16)
|
||||
SI_p(u) = data_mode5_16_16(b(u) ,a(u), round(s(u) + 11));
|
||||
else
|
||||
SI_p(u) = data_mode5_4_4(b(u) ,a(u), round(s(u) + 11));
|
||||
end
|
||||
end
|
||||
RBIR(t) = (sum(SI_p/beta)/Pm);
|
||||
end
|
||||
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear','extrap');
|
||||
SINR_eff = SINR_eff .* beta;
|
||||
%SINR_eff = 10*log10((10.^(SINR_eff/10)) * beta_out(2));
|
||||
|
||||
else %% EESM Mapping
|
||||
|
||||
SINR_eff= 10*log10(-1*beta*log((1/p)*sum(exp((-10.^(SINR_p'./10))./beta))));
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,317 @@
|
||||
%***************************************************************************************
|
||||
% Some basic initializations
|
||||
%***************************************************************************************
|
||||
global SINR_p BLER_meas snr bler SINR_awgn abs_mode modu Pm tx_mode alpha seta mi_file mi_2_file p
|
||||
|
||||
set(0, 'DefaultLineMarkerSize', 10);
|
||||
set(0, 'Defaultaxesfontsize', 10);
|
||||
set(0, 'DefaultLineLineWidth', 2);
|
||||
set(0, 'DefaultAxesFontName', 'Helvetica');
|
||||
set(0, 'DefaultTextFontName', 'Helvetica');
|
||||
|
||||
plot_style = {'b*';'r*';'g*';'y*';'k*';...
|
||||
'bo';'ro';'go';'yo';'ko';...
|
||||
'bs';'rs';'gs';'ys';'ks';...
|
||||
'bd';'rd';'gd';'yd';'kd';...
|
||||
'bx';'rx';'gx';'yx';'kx';...
|
||||
'b+';'r+';'g+';'y+';'k+'};
|
||||
|
||||
echo off;
|
||||
|
||||
%***************************************************************************************
|
||||
% Input Parameters used for the training of adjustment Factors (betas)
|
||||
%***************************************************************************************
|
||||
s2=[]; s3=[]; ss=[];
|
||||
|
||||
tx_mode=transmission_mode;
|
||||
%1--> SISO, 2 --> Alamouti, 5 --> MU-MIMO ,6 --> TX Beamforming
|
||||
% tells which transmission mode is to be abstracted.
|
||||
|
||||
abs_mode=abstraction_mode;
|
||||
% 0:MIESM (M2-MIESM), 1:EESM, 2:IA-MIESM (M1-MIESM)
|
||||
%tells which abstraction methodology is to be used.
|
||||
|
||||
Pm=100;
|
||||
%2*50 QPSK
|
||||
% Used for calculating RBIR
|
||||
|
||||
modu=4;
|
||||
mi_file = strcat(userdir,'/SIMULATION/LTE_PHY/Abstraction/matFiles/siso_MI_abs_4Qam.mat');
|
||||
mi_2_file = strcat(userdir,'/SIMULATION/LTE_PHY/Abstraction/matFiles/data_mode5_4_4_morerealizations.mat');
|
||||
% Modulation used.
|
||||
|
||||
p=50;
|
||||
save_out=save_output;
|
||||
|
||||
out_s1 = strcat(' Training for Transmission Mode = ', num2str(tx_mode));
|
||||
out_s2 = strcat(' Training for Abstraction Mode = ', num2str(abs_mode));
|
||||
out_s3 = strcat(' Saving Results = ', num2str(save_out));
|
||||
|
||||
disp('*******************************************************************');
|
||||
disp(out_s1);
|
||||
disp(out_s2);
|
||||
disp(out_s3);
|
||||
disp('*******************************************************************');
|
||||
|
||||
if (save_out)
|
||||
|
||||
if(tx_mode==5)
|
||||
if(abs_mode==0)
|
||||
out_fname= fullfile(M2_path, strcat('tx_', num2str(tx_mode), '_abs_M2_MIESM'));
|
||||
out_s = 'M2 MIESM';
|
||||
else
|
||||
if (abs_mode==2)
|
||||
out_fname= fullfile(M1_path, strcat('tx_', num2str(tx_mode), '_abs_M1_MIESM'));
|
||||
out_s = 'M1 MIESM';
|
||||
else
|
||||
out_fname= fullfile(EESM_path, strcat('tx_', num2str(tx_mode), '_abs_EESM'));
|
||||
out_s = 'EESM';
|
||||
end
|
||||
end
|
||||
else
|
||||
if(abs_mode == 1)
|
||||
out_fname= fullfile(EESM_path, strcat('tx_', num2str(tx_mode), '_abs_EESM'));
|
||||
out_s = 'EESM';
|
||||
else
|
||||
out_fname= fullfile(MIESM_path, strcat('tx_', num2str(tx_mode), '_abs_MIESM'));
|
||||
out_s = 'MIESM';
|
||||
end
|
||||
end
|
||||
|
||||
fid = fopen(strcat(out_fname, '.tex'),'w');
|
||||
fprintf(fid,'\\documentclass[a4paper,conference]{IEEEtran}\n');
|
||||
fprintf(fid,'\\usepackage{epsfig}\n');
|
||||
fprintf(fid,'\\usepackage{rotating}\n');
|
||||
fprintf(fid,'\\usepackage{amsmath}\n');
|
||||
fprintf(fid,'\\usepackage{amsfonts}\n');
|
||||
fprintf(fid,'\\usepackage{amssymb}\n');
|
||||
fprintf(fid,'\\usepackage{graphics}\n');
|
||||
fprintf(fid,'\\usepackage{mathtools}\n');
|
||||
fprintf(fid,'\\IEEEoverridecommandlockouts\n');
|
||||
fprintf(fid,'\\title{%s}\n',sprintf('Results of %s for LTE Transmission Mode %d',out_s, tx_mode));
|
||||
fprintf(fid,'\\author{\\IEEEauthorblockN{Imran Latif}\n');
|
||||
fprintf(fid,'\\IEEEauthorblockA{Eurecom\\\\\n');
|
||||
fprintf(fid,'2229, Route des Cretes, B.P. 193\\\\\n');
|
||||
fprintf(fid,'06904 Sophia Antipolis, France\\\\\n');
|
||||
fprintf(fid,'Email: (first name.last name)@eurecom.fr}\n');
|
||||
fprintf(fid,'}\n');
|
||||
fprintf(fid,'\\begin{document}\n');
|
||||
fprintf(fid,'\\maketitle\n');
|
||||
fprintf(fid,'\\begin{abstract}\n');
|
||||
fprintf(fid,'\\end{abstract}\n');
|
||||
fprintf(fid,'\\section{Results}\n');
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
%***************************************************************************************
|
||||
% Main Execution Loop starts from here:
|
||||
%***************************************************************************************
|
||||
for m=1:1:length(mcs)
|
||||
|
||||
if(mcs(m) >9 && mcs(m) < 17)
|
||||
modu=16;
|
||||
Pm=200; %4*50 16QAM
|
||||
mi_file = strcat(userdir,'/SIMULATION/LTE_PHY/Abstraction/siso_MI_abs_16Qam.mat');
|
||||
mi_2_file = strcat(userdir,'/SIMULATION/LTE_PHY/Abstraction/matFiles/data_mode5_16_16.mat');
|
||||
else if(mcs(m) > 16 && mcs(m) < 28)
|
||||
modu = 64;
|
||||
Pm=300; %6 *50 64QAM
|
||||
mi_file = strcat(userdir,'/SIMULATION/LTE_PHY/Abstraction/siso_MI_abs_64Qam.mat');
|
||||
end
|
||||
end
|
||||
%***************************************************************************************
|
||||
%Reference AWGN Curves
|
||||
%***************************************************************************************
|
||||
data = dlmread(fullfile(awgn_path, strcat('awgn_bler_tx1_mcs', num2str(mcs(m)), '.csv')),';',1,0);
|
||||
A = data(:,1);
|
||||
B = data(:,5)./data(:,6); % round 1
|
||||
|
||||
[bler I J] = unique(B);
|
||||
bler = sort(bler,1,'descend');
|
||||
I = sort(I,1,'ascend');
|
||||
snr = A(I);
|
||||
|
||||
|
||||
%***************************************************************************************
|
||||
% Data Extraction on Sub carrier basis data file saved using dlsim and reference
|
||||
% SINR Calculation based on Reference AWGN Curve
|
||||
%***************************************************************************************
|
||||
eval(['data_all = data_all' num2str(mcs(m)) ';']);
|
||||
data_all = data_all(data_all(:,end)<bler(1),:);
|
||||
data_all = data_all(data_all(:,end)>=bler(end),:);
|
||||
|
||||
|
||||
|
||||
BLER_meas = data_all(:,end);
|
||||
|
||||
SINR_awgn = interp1(bler, snr, BLER_meas,'linear','extrap');
|
||||
SINR_awgn = SINR_awgn';
|
||||
|
||||
%***************************************************************************************
|
||||
% Calculation of SINR per subcarrier
|
||||
%***************************************************************************************
|
||||
%for SISO
|
||||
switch(tx_mode)
|
||||
case 1
|
||||
ch_tmp = data_all(:,2:51);
|
||||
abs_channel = (abs(ch_tmp).^2);
|
||||
input_snr = 10.^(data_all(:,1)/10);
|
||||
input_snr = repmat(input_snr,1,50);
|
||||
SINR_p = 10*log10(input_snr.*abs_channel);
|
||||
|
||||
case 2
|
||||
ch1_tmp = data_all(:,2:2:100);
|
||||
ch2_tmp = data_all(:,3:2:101);
|
||||
abs_channel1 = (abs(ch1_tmp).^2)/2;
|
||||
abs_channel2 = (abs(ch2_tmp).^2)/2;
|
||||
input_snr = 10.^(data_all(:,1)/10);
|
||||
input_snr = repmat(input_snr,1,50);
|
||||
SINR_p = 10*log10(input_snr.*abs_channel1 + input_snr.*abs_channel2);%- 10*log10(2);
|
||||
|
||||
case 5
|
||||
prec1_tmp = data_all(:,203:end-1);
|
||||
prec2_tmp = arrayfun(@opposite_q,prec1_tmp);
|
||||
q1 = arrayfun(@demap_q,prec1_tmp);
|
||||
q2 = arrayfun(@demap_q,prec2_tmp);
|
||||
ch1_tmp = data_all(:,2:2:100);
|
||||
ch2_tmp = data_all(:,3:2:101);
|
||||
snr_tmp = 10.^(data_all(:,1)/10);
|
||||
snr_tmp = repmat(snr_tmp,1,50);
|
||||
% h1 = [ch1_tmp ch2_tmp];
|
||||
% p1 = [1; q1];
|
||||
% p2 = [1; q2];
|
||||
|
||||
alpha =(1/2)*abs(ch1_tmp + q1.*ch2_tmp);
|
||||
%seta = abs(((conj(h1*p1))*(h1*p2))/(abs(h1*p1)));
|
||||
|
||||
%seta = (1/2)*abs(((conj(ch1_tmp + q1.*ch2_tmp)).*(ch1_tmp + q2.*ch2_tmp))./(abs(ch1_tmp + q1.*ch2_tmp)));
|
||||
|
||||
|
||||
%alpha =sqrt(1/2)*abs(ch1_tmp + q1.*ch2_tmp);
|
||||
seta = (1/2)*((abs(ch1_tmp + q2.*ch2_tmp)));
|
||||
% alpha =abs(ch1_tmp + q1.*ch2_tmp);
|
||||
|
||||
if (abs_mode==2 )
|
||||
SINR_p = 10*log10(snr_tmp.*(alpha.^2));%-10*log10(2);
|
||||
else
|
||||
SINR_p = 10*log10((snr_tmp.*(alpha.^2)) ./ ((snr_tmp.*(seta.^2)) + 1));
|
||||
end
|
||||
|
||||
case 6
|
||||
prec_tmp = data_all(:,203:end-1);
|
||||
q = arrayfun(@demap_q,prec_tmp);
|
||||
ch1_tmp = data_all(:,2:2:100);
|
||||
ch2_tmp = data_all(:,3:2:101);
|
||||
snr_tmp = 10.^(data_all(:,1)/10);
|
||||
snr_tmp = repmat(snr_tmp,1,50);
|
||||
ch_composite = (abs(ch1_tmp + q.*ch2_tmp))/sqrt(2);
|
||||
SINR_p = 10*log10((snr_tmp.*((ch_composite).^2)));
|
||||
|
||||
end
|
||||
|
||||
%***************************************************************************************
|
||||
% for coarse beta calculation:
|
||||
%***************************************************************************************
|
||||
% beta_vec = 1:0.1:30;
|
||||
% delta = zeros(size(beta_vec));
|
||||
% for beta=1:length(beta_vec)
|
||||
% delta(beta)=delta_BLER_1((beta_vec(beta)));
|
||||
% end
|
||||
% [val ind] = min(delta);
|
||||
% opt_beta_new(mcs(m)) = beta_vec(ind);
|
||||
|
||||
|
||||
%***************************************************************************************
|
||||
% for optmimized betas calculation using fminsearch
|
||||
%***************************************************************************************
|
||||
opt_beta=0;
|
||||
beta_out=ones(1,2);
|
||||
[opt_beta, MSE1] = fminsearch(@delta_BLER_1,1);
|
||||
|
||||
[beta_out, MSE2] = fminsearch(@delta_BLER_1,[1 1]);
|
||||
|
||||
%***************************************************************************************
|
||||
% Calculation of Effective SINR based on optimized beta values
|
||||
%***************************************************************************************
|
||||
|
||||
SINR_eff_single_beta = sinr_Eff_Calc(opt_beta);
|
||||
SINR_eff_dual_beta = sinr_Eff_Calc(beta_out);
|
||||
|
||||
%***************************************************************************************
|
||||
%MSE Calculation
|
||||
%***************************************************************************************
|
||||
MSE_final_single_beta(m) = mean((SINR_awgn - SINR_eff_single_beta).^2);
|
||||
MSE_final_dual_beta(m) = mean((SINR_awgn - SINR_eff_dual_beta).^2);
|
||||
single_Optimum_Beta(m) = opt_beta;
|
||||
dual_Optimum_Beta1(m) = beta_out(1);
|
||||
dual_Optimum_Beta2(m) = beta_out(2);
|
||||
%***************************************************************************************
|
||||
% BLER Plot w.r.t Mean Effective SINR
|
||||
%***************************************************************************************
|
||||
% figure;
|
||||
% avg_SINR_p = mean(SINR_p');
|
||||
% hist(avg_SINR_p)
|
||||
% s = strcat('Average_SINR_p, MCS = ',num2str(mcs(m)));
|
||||
% title(2)
|
||||
% figure;
|
||||
% grid on
|
||||
% semilogy(avg_SINR_p,BLER_meas,plot_style{m+1})
|
||||
% xlim([-8 15])
|
||||
% ylim([1e-3 1])
|
||||
% s = strcat('LTE TM1 Avergae Abstraction MCS ', num2str(mcs(m)));
|
||||
% title(s);
|
||||
% ylabel 'BLER'
|
||||
% xlabel 'SINR_{average}'
|
||||
% s2 = strcat('BLER_{meas} MCS ', num2str(mcs(m)));
|
||||
% legend(s2, 'Location', 'Best');
|
||||
|
||||
%***************************************************************************************
|
||||
% BLER Plot w.r.t Effective SINR
|
||||
%***************************************************************************************
|
||||
% figure;
|
||||
% hist(SINR_eff)
|
||||
% s = strcat('SINR_eff, MCS = ',num2str(mcs(m)));
|
||||
% title(s)
|
||||
|
||||
|
||||
create_plots;
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
disp(' MCS dual_Beta1 dual_Beta2 MSE beta2=beta1 MSE');
|
||||
disp([mcs' dual_Optimum_Beta1' dual_Optimum_Beta2' MSE_final_dual_beta' single_Optimum_Beta' MSE_final_single_beta'])
|
||||
%***************************************************************************************
|
||||
%For saving the files
|
||||
%***************************************************************************************
|
||||
if(save_out)
|
||||
|
||||
fprintf(fid,'\\begin{table}[t]\n');
|
||||
fprintf(fid,'\\centering\n');
|
||||
fprintf(fid,'\\caption{beta1, beta2 and Mean Squared Error (MSE) Values for abstraction}\n');
|
||||
fprintf(fid,'\\begin{tabular}{ | c | c | c | c | c | c |}\n');
|
||||
fprintf(fid,'\\hline\n');
|
||||
fprintf(fid,'\\textbf{MCS} & \\textbf{Beta1} & \\textbf{Beta2} & \\textbf{MSE} & \\textbf{Beta1=Beta2} & \\textbf{MSE} \\\\ \\hline');
|
||||
for in=1:length(mcs)
|
||||
fprintf(fid,'%d & %3.5f & %3.5f & %01.5f & %3.5f & %01.5f \\\\ \\hline\n',mcs(in), dual_Optimum_Beta1(in), dual_Optimum_Beta2(in), MSE_final_dual_beta(in), single_Optimum_Beta(in), MSE_final_single_beta(in));
|
||||
end
|
||||
fprintf(fid,'\\end{tabular}\n');
|
||||
fprintf(fid,'\\end{table}\n');
|
||||
|
||||
dlmwrite(fullfile(pathname,strcat(ss, '_beta1.csv')), dual_Optimum_Beta1, 'delimiter', ';');
|
||||
dlmwrite(fullfile(pathname,strcat(ss, '_beta2.csv')), dual_Optimum_Beta2, 'delimiter', ';');
|
||||
dlmwrite(fullfile(pathname,strcat(ss, '.csv')), single_Optimum_Beta, 'delimiter', ';');
|
||||
dlmwrite(fullfile(pathname,strcat(ss, '_mse.csv')), MSE_final_dual_beta, 'delimiter', ';');
|
||||
dlmwrite(fullfile(pathname,strcat(ss, '_mse.csv')), MSE_final_single_beta, 'delimiter', ';');
|
||||
fprintf(fid,'\\end{document}\n');
|
||||
fclose(fid);
|
||||
|
||||
%system(sprintf('latex %s.tex', out_fname));
|
||||
%system(sprintf('dvipdf %s.dvi', out_fname));
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
%**************************************************************************
|
||||
% Calibration of Adjustment Factors for Exponential Effective SINR Mapping
|
||||
% Methdology for 3GPP Long Term Evolution (LTE)
|
||||
% Eurecom Institute
|
||||
% (c) Imran Latif, Communications Mobile, 2012
|
||||
%**************************************************************************
|
||||
|
||||
close all
|
||||
clear all
|
||||
|
||||
|
||||
userdir= getenv('OPENAIR1_DIR');
|
||||
|
||||
addpath(strcat(userdir, '/SIMULATION/LTE_PHY'))
|
||||
|
||||
root_path = strcat(userdir, '/SIMULATION/LTE_PHY/data/TM1_ideal_CE');
|
||||
|
||||
awgn_path = strcat(userdir, '/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/Ideal');
|
||||
|
||||
transmission_mode = 1;
|
||||
|
||||
abstraction_mode = 0;
|
||||
|
||||
save_output = 1;
|
||||
|
||||
show_plots = 0;
|
||||
|
||||
m_path = strcat(root_path, '/mFiles');
|
||||
|
||||
if ~exist(m_path,'dir')
|
||||
mkdir(fullfile(root_path,'mFiles'));
|
||||
error('there are no M Files for the specified folder');
|
||||
end
|
||||
|
||||
EESM_path = strcat(root_path, '/EESM');
|
||||
if ~exist(EESM_path,'dir')
|
||||
mkdir(fullfile(root_path,'EESM'));
|
||||
end
|
||||
|
||||
MIESM_path = strcat(root_path, '/MIESM');
|
||||
if ~exist(MIESM_path,'dir')
|
||||
mkdir(fullfile(root_path,'MIESM'));
|
||||
end
|
||||
|
||||
if (transmission_mode == 5)
|
||||
M1_path = strcat(MIESM_path, '/M1');
|
||||
if ~exist(M1_path,'dir')
|
||||
mkdir(fullfile(MIESM_path,'M1'));
|
||||
end
|
||||
|
||||
M2_path = strcat(MIESM_path, '/M2');
|
||||
if ~exist(M2_path,'dir')
|
||||
mkdir(fullfile(MIESM_path,'M2'));
|
||||
end
|
||||
end
|
||||
|
||||
d = dir(fullfile(m_path, '*.mat'));
|
||||
|
||||
% if (isempty(d))
|
||||
% d = dir(fullfile(m_path, '*.m'));
|
||||
% dir_names = {d.name};
|
||||
% for d_idx=1:length(dir_names)
|
||||
% pathname = fullfile(m_path,dir_names{d_idx})
|
||||
%
|
||||
% end
|
||||
%
|
||||
% save(fullfile(m_path,'data_rayleigh.mat'))
|
||||
%
|
||||
% else
|
||||
load(fullfile(m_path, d.name));
|
||||
% end
|
||||
|
||||
work_Space_Variables = who('data_all*');
|
||||
|
||||
mcs = [];
|
||||
for s = 1: length(work_Space_Variables)
|
||||
c = regexprep(work_Space_Variables(s),'data_all',' ');
|
||||
mcs = [mcs str2double(c)];
|
||||
end
|
||||
|
||||
mcs = sort(mcs);
|
||||
|
||||
|
||||
training_abstraction
|
||||
|
||||
|
||||
@@ -0,0 +1,299 @@
|
||||
%***************************************************************************************
|
||||
% Calibration of Adjustment Factors for Exponential Effective SINR Mapping Methdology
|
||||
% For 3GPP Long Term Evolution (LTE)
|
||||
% Eurecom Institute
|
||||
% (c) Imran Latif, Communications Mobile, 2012
|
||||
%***************************************************************************************
|
||||
%close all
|
||||
%clear all
|
||||
|
||||
%***************************************************************************************
|
||||
% Some basic initializations
|
||||
%***************************************************************************************
|
||||
global SINR_p BLER_meas snr bler SINR_awgn abs_mode modu Pm tx_mode alpha seta
|
||||
|
||||
set(0, 'DefaultLineMarkerSize', 10);
|
||||
set(0, 'Defaultaxesfontsize', 10);
|
||||
set(0, 'DefaultLineLineWidth', 2);
|
||||
set(0, 'DefaultAxesFontName', 'Helvetica');
|
||||
set(0, 'DefaultTextFontName', 'Helvetica');
|
||||
|
||||
plot_style = {'b*';'r*';'g*';'y*';'k*';...
|
||||
'bo';'ro';'go';'yo';'ko';...
|
||||
'bs';'rs';'gs';'ys';'ks';...
|
||||
'bd';'rd';'gd';'yd';'kd';...
|
||||
'bx';'rx';'gx';'yx';'kx';...
|
||||
'b+';'r+';'g+';'y+';'k+'};
|
||||
|
||||
echo off;
|
||||
%pathname = '/homes/latif/devel/trunk/openair1/SIMULATION/LTE_PHY/results/SCMC/results_TX5_M1_MIESM';
|
||||
%root_path = '/homes/latif/OpenAirPlatform/test_devel/openair1_multi_eNb_UE/SIMULATION/LTE_PHY/BLER_SIMULATIONS/awgn_bler_new/';
|
||||
%%
|
||||
%***************************************************************************************
|
||||
% Input Parameters used for the training of adjustment Factors (betas)
|
||||
%***************************************************************************************
|
||||
mcs = [0];
|
||||
% An array which hold the number of LTE MCS which is to be calibrated for
|
||||
% abstraction
|
||||
|
||||
s2=[];
|
||||
s3=[];
|
||||
% String arrays used for printing in plots
|
||||
|
||||
tx_mode=5;
|
||||
%1--> SISO, 2 --> Alamouti, 5 --> MU-MIMO ,6 --> TX Beamforming
|
||||
% tells which transmission mode is to be abstracted.
|
||||
|
||||
abs_mode=1; % 0:MIESM (M2-MIESM), 1:EESM, 2:IA-MIESM (M1-MIESM)
|
||||
%tells which abstraction methodology is to be used.
|
||||
|
||||
Pm=100; %2*50 QPSK
|
||||
% Used for calculating RBIR
|
||||
|
||||
modu=4;
|
||||
% Modulation used.
|
||||
|
||||
p=50;
|
||||
save_out=0;
|
||||
%***************************************************************************************
|
||||
% Main Execution Loop starts from here:
|
||||
%***************************************************************************************
|
||||
for m=1:1:length(mcs)
|
||||
|
||||
if(mcs(m) >9 && mcs(m) < 17)
|
||||
modu=16;
|
||||
Pm=200; %4*50 16QAM
|
||||
else if(mcs(m) > 16 && mcs(m) < 28)
|
||||
modu = 64;
|
||||
Pm=300; %6 *50 64QAM
|
||||
end
|
||||
end
|
||||
%***************************************************************************************
|
||||
%Reference AWGN Curves
|
||||
%***************************************************************************************
|
||||
data = dlmread(sprintf('../awgn_bler_tx1_mcs%d.csv',mcs(m)),';',1,0);
|
||||
snr = data(:,1);
|
||||
ble = data(:,5)./data(:,6); % round 1
|
||||
|
||||
blerr = ble(ble<0.99);
|
||||
bler = blerr(blerr>0.001);
|
||||
|
||||
snr = snr(ble<0.99);
|
||||
snr = snr(blerr>0.001);
|
||||
|
||||
snr_interp = snr(1):0.001:snr(end);
|
||||
bler_interp = interp1(snr,bler,snr_interp,'linear');
|
||||
snr = snr_interp;
|
||||
bler = bler_interp;
|
||||
|
||||
%***************************************************************************************
|
||||
% Data Extraction on Sub carrier basis data file saved using dlsim and reference
|
||||
% SINR Calculation based on Reference AWGN Curve
|
||||
%***************************************************************************************
|
||||
eval(['data_all = data_all' num2str(mcs(m)) ';']);
|
||||
BLER_meas = data_all(:,end);
|
||||
|
||||
SINR_awgn = interp1(bler, snr, BLER_meas,'linear','extrap');
|
||||
SINR_awgn = SINR_awgn';
|
||||
|
||||
%***************************************************************************************
|
||||
% Calculation of SINR per subcarrier
|
||||
%***************************************************************************************
|
||||
%for SISO
|
||||
switch(tx_mode)
|
||||
case 1
|
||||
ch_tmp = data_all(:,2:51);
|
||||
abs_channel = (abs(ch_tmp).^2);
|
||||
input_snr = 10.^(data_all(:,1)/10);
|
||||
input_snr = repmat(input_snr,1,50);
|
||||
SINR_p = 10*log10(input_snr.*abs_channel);
|
||||
|
||||
case 2
|
||||
ch1_tmp = data_all(:,2:2:100);
|
||||
ch2_tmp = data_all(:,3:2:101);
|
||||
abs_channel1 = (abs(ch1_tmp).^2)/2;
|
||||
abs_channel2 = (abs(ch2_tmp).^2)/2;
|
||||
input_snr = 10.^(data_all(:,1)/10);
|
||||
input_snr = repmat(input_snr,1,50);
|
||||
SINR_p = 10*log10(input_snr.*abs_channel1 + input_snr.*abs_channel2);%- 10*log10(2);
|
||||
|
||||
case 5
|
||||
prec1_tmp = data_all(:,203:end-1);
|
||||
prec2_tmp = arrayfun(@opposite_q,prec1_tmp);
|
||||
q1 = arrayfun(@demap_q,prec1_tmp);
|
||||
%q2 = q1;
|
||||
q2 = arrayfun(@demap_q,prec2_tmp);
|
||||
ch1_tmp = data_all(:,2:2:100);
|
||||
ch2_tmp = data_all(:,3:2:101);
|
||||
snr_tmp = 10.^(data_all(:,1)/10);
|
||||
snr_tmp = repmat(snr_tmp,1,50);
|
||||
|
||||
alpha =sqrt(1/2)*abs(ch1_tmp + q1.*ch2_tmp);
|
||||
seta = sqrt(1/2)*((abs(ch1_tmp + q2.*ch2_tmp)));
|
||||
|
||||
if (abs_mode==2 )
|
||||
SINR_p = 10*log10(snr_tmp.*(alpha.^2));%-10*log10(2);
|
||||
else
|
||||
SINR_p = 10*log10((snr_tmp.*(alpha.^2)) ./ ((snr_tmp.*(seta.^2)) + 1));
|
||||
end
|
||||
|
||||
case 6
|
||||
prec_tmp = data_all(:,203:end-1);
|
||||
q = arrayfun(@demap_q,prec_tmp);
|
||||
ch1_tmp = data_all(:,2:2:100);
|
||||
ch2_tmp = data_all(:,3:2:101);
|
||||
snr_tmp = 10.^(data_all(:,1)/10);
|
||||
snr_tmp = repmat(snr_tmp,1,50);
|
||||
ch_composite = (abs(ch1_tmp + q.*ch2_tmp))/sqrt(2);
|
||||
SINR_p = 10*log10((snr_tmp.*((ch_composite).^2)));
|
||||
|
||||
end
|
||||
|
||||
%***************************************************************************************
|
||||
% for coarse beta calculation:
|
||||
%***************************************************************************************
|
||||
% beta_vec = 1:0.1:30;
|
||||
% delta = zeros(size(beta_vec));
|
||||
% for beta=1:length(beta_vec)
|
||||
% delta(beta)=delta_BLER_1((beta_vec(beta)));
|
||||
% end
|
||||
% [val ind] = min(delta);
|
||||
% opt_beta_new(mcs(m)) = beta_vec(ind);
|
||||
%***************************************************************************************
|
||||
% for optmimized betas calculation using fminsearch
|
||||
%***************************************************************************************
|
||||
%keyboard()
|
||||
beta_out=[1.6962 0.7522];
|
||||
%beta_out=[1.8112 1.0771];
|
||||
%beta_out = zeros(1,2);
|
||||
%[opt_beta(mcs(m)), MSE] = fminsearch(@delta_BLER_1,opt_beta_new(mcs(m)))
|
||||
%[beta_out, MSE] = fminsearch(@delta_BLER_1,[1 1])
|
||||
|
||||
%***************************************************************************************
|
||||
% Calculation of Effective SINR based on optimized beta values
|
||||
%***************************************************************************************
|
||||
|
||||
if(abs_mode==0) %MIESM Mapping
|
||||
|
||||
eval(['load ' '/root/DEVEL/trunk/openair1/SIMULATION/LTE_PHY/Abstraction/siso_MI_abs_' num2str(modu) 'Qam.mat'])
|
||||
|
||||
[xize y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
for t=1:1:xize
|
||||
s = SINR_p(t,:);
|
||||
s(s<-10)=-10;
|
||||
s(s>49)=49;
|
||||
eval(['SI_p = interp1(newSNR,newC_siso_' num2str(modu) 'QAM,s, ''linear'' , ''extrap'');']);
|
||||
RBIR(t) = (sum(SI_p/beta_out(1))/Pm);
|
||||
end
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear');
|
||||
SINR_eff = SINR_eff .* beta_out(2);
|
||||
|
||||
|
||||
elseif(abs_mode==2)
|
||||
|
||||
eval(['load ' '/root/DEVEL/trunk/openair1/SIMULATION/LTE_PHY/Abstraction/siso_MI_abs_' num2str(modu) 'Qam.mat'])
|
||||
|
||||
if(tx_mode~=5)
|
||||
error('IA-MIESM only for LTE TM5!!!')
|
||||
end
|
||||
|
||||
if(modu==4)
|
||||
eval(['load ' '/root/DEVEL/trunk/openair1/SIMULATION/LTE_PHY/Abstraction/data_mode5_4_' num2str(modu) '_morerealizations.mat'])
|
||||
else
|
||||
if(modu==16)
|
||||
eval(['load ' '/root/DEVEL/trunk/openair1/SIMULATION/LTE_PHY/Abstraction/data_mode5_16_16.mat'])
|
||||
end
|
||||
end
|
||||
|
||||
[xize y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
for t=1:1:xize
|
||||
s = SINR_p(t,:);
|
||||
s(s<-10)=-10;
|
||||
s(s>49)=49;
|
||||
|
||||
a = round(alpha(t,:)*100);
|
||||
a(a==0) = 1;
|
||||
a(a>200)=200;
|
||||
b = round(seta(t,:)*100);
|
||||
b(b==0) = 1;
|
||||
b(b>200)=200;
|
||||
|
||||
for u=1:length(a)
|
||||
if(modu==16)
|
||||
SI_p(u) = data_mode5_16_16(b(u) ,a(u), round(s(u) + 11));
|
||||
else
|
||||
SI_p(u) = data_mode5_4_4(b(u) ,a(u), round(s(u) + 11));
|
||||
end
|
||||
end
|
||||
RBIR(t) = (sum(SI_p/beta_out(1))/Pm);
|
||||
end
|
||||
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear');
|
||||
SINR_eff = SINR_eff .* beta_out(2);
|
||||
|
||||
else %% EESM Mapping
|
||||
|
||||
SINR_eff= 10*log10(-1*beta_out(2)*log((1/p)*sum(exp((-10.^(SINR_p'./10))./beta_out(1)))));
|
||||
end
|
||||
%***************************************************************************************
|
||||
%MSE Calculation
|
||||
%***************************************************************************************
|
||||
MSE_final(mcs(m)+1) = mean((SINR_awgn - SINR_eff).^2);
|
||||
Optimum_beta1(mcs(m)+1) = beta_out(1);
|
||||
Optimum_beta2(mcs(m)+1) = beta_out(2);
|
||||
%***************************************************************************************
|
||||
% BLER Plot w.r.t Mean Effective SINR
|
||||
%***************************************************************************************
|
||||
%figure;
|
||||
%avg_SINR_p = mean(SINR_p');
|
||||
%hist(avg_SINR_p)
|
||||
%figure;
|
||||
%grid on
|
||||
%semilogy(avg_SINR_p,BLER_meas,plot_style{m+1})
|
||||
%xlim([-8 15])
|
||||
%ylim([1e-3 1])
|
||||
%s = strcat('LTE TM1 Avergae Abstraction MCS ', num2str(mcs(m)));
|
||||
% title(s);
|
||||
% ylabel 'BLER'
|
||||
% xlabel 'SINR_{average}'
|
||||
% s2 = strcat('BLER_{meas} MCS ', num2str(mcs(m)));
|
||||
|
||||
% legend(s2, 'Location', 'Best');
|
||||
|
||||
%***************************************************************************************
|
||||
% BLER Plot w.r.t Effective SINR
|
||||
%***************************************************************************************
|
||||
% figure;
|
||||
% hist(SINR_eff)
|
||||
figure;
|
||||
semilogy(SINR_eff,BLER_meas,plot_style{m+1})
|
||||
hold on
|
||||
grid on
|
||||
semilogy(snr,bler,'m-');
|
||||
xlim([-20 15])
|
||||
ylim([1e-3 1])
|
||||
s = strcat('LTE TM5 MIESM MCS ', num2str(mcs(m)), ',beta1= ',num2str(Optimum_beta1(mcs(m)+1)),',beta2= ',num2str(Optimum_beta2(mcs(m)+1)), ', MSE= ',num2str(MSE_final(mcs(m)+1)));
|
||||
title(s);
|
||||
ylabel 'BLER'
|
||||
xlabel 'SINR_{effective}'
|
||||
s2 = strcat('BLER_{meas} MCS ', num2str(mcs(m)));
|
||||
s3 = strcat('BLER_{AWGN} MCS ', num2str(mcs(m)));
|
||||
legend(s2,s3, 'Location', 'Best');
|
||||
|
||||
% if(save_out==1)
|
||||
% saveas(h_fig,fullfile(pathname,strcat('IA_RX_M1_MIESM_TX5_mcs',num2str(mcs(m)) ,'.eps')),'epsc2');
|
||||
% saveas(h_fig,fullfile(pathname,strcat('IA_RX_M1_MIESM_TX5_mcs',num2str(mcs(m)) ,'.fig')),'fig');
|
||||
% saveas(h_fig,fullfile(pathname,strcat('IA_RX_M1_MIESM_TX5_mcs',num2str(mcs(m)) ,'.jpg')),'jpg');
|
||||
% end
|
||||
end
|
||||
%***************************************************************************************
|
||||
%For saving the files
|
||||
%***************************************************************************************
|
||||
if(save_out)
|
||||
save(strcat('opt_beta_mcs',num2str(mcs(m)),'.dat'),'Optimum_beta*')
|
||||
save(strcat('MSE_mcs',num2str(mcs(m)),'.dat'),'MSE_final')
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
close all;
|
||||
clear all;
|
||||
warning on;
|
||||
data_mode5 = zeros(200,200,50);
|
||||
cnt = 1;
|
||||
for f = 1:5
|
||||
eval(['load ''QPSK_QPSK_noMF_lte_Mode5_''' num2str(f) '.mat']);
|
||||
|
||||
for i = 1:10
|
||||
[gx, gy, gz] = gridfit(abs(alpha_1(i,:)).',abs(beta_2(i,:)).',chcap_lte_sch1(i,:).',0.01:0.01:2, 0.01:0.01:2 );
|
||||
gx(gx<0) = 0;
|
||||
gx(gx>2) = 2;
|
||||
data_mode5(:,:,cnt) = gx;
|
||||
cnt = cnt+1;
|
||||
end
|
||||
end
|
||||
|
||||
save('data_mode5.mat', 'data_mode5');
|
||||
@@ -0,0 +1,147 @@
|
||||
% close all
|
||||
% clear all
|
||||
|
||||
global SINR_p BLER_meas snr bler SINR_awgn abs_mode modu Pm
|
||||
|
||||
set(0, 'DefaultLineMarkerSize', 10);
|
||||
set(0, 'Defaultaxesfontsize', 10);
|
||||
set(0, 'DefaultLineLineWidth', 2);
|
||||
set(0, 'DefaultAxesFontName', 'Helvetica');
|
||||
set(0, 'DefaultTextFontName', 'Helvetica');
|
||||
|
||||
% plot_style = {'b*';'r*';'g*';'y*';'k*';...
|
||||
% 'bo';'ro';'go';'yo';'ko';...
|
||||
% 'bs';'rs';'gs';'ys';'ks';...
|
||||
% 'bd';'rd';'gd';'yd';'kd';...
|
||||
% 'bx';'rx';'gx';'yx';'kx';...
|
||||
% 'b+';'r+';'g+';'y+';'k+'};
|
||||
|
||||
echo off;
|
||||
load '/homes/latif/devel/trunk/openair1/SIMULATION/LTE_PHY/ideal_dataout_tx1.mat'
|
||||
% load '/extras/kaltenbe/L2S_map_results/Perfect_CE_MIESM/Mat_Files/siso_MI_16Qam.mat'
|
||||
% load '/extras/kaltenbe/L2S_map_results/Perfect_CE_MIESM/Mat_Files/siso_MI_64Qam.mat'
|
||||
%load '/extras/kaltenbe/L2S_map_results/Real_CE_EESM/matfiles/mcs_channel.mat';
|
||||
%pathname = '/extras/kaltenbe/L2S_map_results/Real_CE_EESM/results_scmc/';
|
||||
%root_path = '/homes/latif/OpenAirPlatform/test_devel/openair1_multi_eNb_UE/SIMULATION/LTE_PHY/BLER_SIMULATIONS/awgn_bler_new/';
|
||||
%%
|
||||
mcs = [4 7 9 13 16 19 22 24];
|
||||
s2=[];
|
||||
s3=[];
|
||||
abs_mode=0;
|
||||
Pm=100;
|
||||
modu=4; %2*50
|
||||
for m=1:1:length(mcs)
|
||||
if(mcs(m) >9 && mcs(m) < 17)
|
||||
modu=16;
|
||||
Pm=200; %4*50
|
||||
else if(mcs(m) > 16 && mcs(m) < 28)
|
||||
modu = 64;
|
||||
Pm=300; %6 *50
|
||||
end
|
||||
end
|
||||
|
||||
%% SINR_P Extraction per Sub carrier basis
|
||||
eval(['data_all = data_all' num2str(mcs(m)) ';']);
|
||||
data_all = data_all(data_all(:,end)<0.9,:);
|
||||
data_all = data_all(data_all(:,end)>0.01,:);
|
||||
%
|
||||
SINR_p = data_all(:,2:51);
|
||||
data = dlmread(sprintf('/homes/latif/devel/trunk/openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN_SISO_IDEAL_03082011/ideal_ce_bler_tx1_mcs%d.csv',mcs(m)),';',1,0);
|
||||
snr = data(:,1);
|
||||
bler = data(:,5)./data(:,6); % round 1
|
||||
BLER_meas = data_all(:,end);
|
||||
p=50;
|
||||
|
||||
%% for coarse beta calculation:
|
||||
beta_vec = 0:1:30;
|
||||
delta = zeros(size(beta_vec));
|
||||
for beta=1:length(beta_vec)
|
||||
delta(beta)=delta_BLER(beta_vec(beta));
|
||||
end
|
||||
[val ind] = min(delta);
|
||||
opt_beta_new(mcs(m)) = beta_vec(ind);
|
||||
%% for optmimized beta calculation
|
||||
opt_beta(mcs(m)) = fminsearch(@delta_BLER,opt_beta_new(mcs(m)));
|
||||
|
||||
%% MIESM Mapping
|
||||
% if(mcs(i) >=1 || mcs(i) < 10)
|
||||
% load '/extras/kaltenbe/L2S_map_results/Perfect_CE_MIESM/Mat_Files/siso_MI_4Qam.mat'
|
||||
% sum_m = 600; %2*300 4QAM
|
||||
% else if(mcs(i) >=10 || mcs(i) < 17)
|
||||
% load '/extras/kaltenbe/L2S_map_results/Perfect_CE_MIESM/Mat_Files/siso_MI_16Qam.mat'
|
||||
% sum_m = 1200; %4*300 16QAM
|
||||
% else
|
||||
% load '/extras/kaltenbe/L2S_map_results/Perfect_CE_MIESM/Mat_Files/siso_MI_64Qam.mat'
|
||||
% sum_m = 1800; %6*300 64QAM
|
||||
% end
|
||||
% end
|
||||
% %data = dlmread(fullfile(root_path,sprintf('scmc_bler_%d.csv',mcs(m))),';',1,0);
|
||||
% %data = dlmread(fullfile(root_path,sprintf('bler_tx1_mcs%d.csv',mcs(m))),';',1,0);
|
||||
if(abs_mode==0)
|
||||
|
||||
eval(['load ' '/homes/latif/devel/trunk/openair1/SIMULATION/LTE_PHY/siso_MI_abs_' num2str(modu) 'Qam.mat'])
|
||||
[x y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
for t=1:1:x
|
||||
s = SINR_p(t,:);
|
||||
eval(['SI_p = interp1(newSNR,newC_siso_' num2str(modu) 'QAM,s, ''linear'' , ''extrap'');']);
|
||||
%SI_p = interp1(newSNR,newC_siso_4QAM,s, 'linear','extrap');
|
||||
RBIR(t) = sum(SI_p/opt_beta(mcs(m)))/Pm;
|
||||
end
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear');
|
||||
else
|
||||
SINR_eff= 10*log10(-1*opt_beta(mcs(m))*log((1/p)*sum(exp((-10.^(SINR_p'./10))./opt_beta(mcs(m))))));
|
||||
end
|
||||
|
||||
|
||||
|
||||
%% EESM Mapping
|
||||
% p=50;
|
||||
% %data = dlmread(fullfile(root_path,sprintf('scmc_bler_%d.csv',mcs(m))),';',1,0);
|
||||
% %data = dlmread(fullfile(root_path,sprintf('bler_tx1_mcs%d.csv',mcs(m))),';',1,0);
|
||||
% data = dlmread(sprintf('ideal_ce_bler_tx1_mcs%d.csv',mcs(m)),';',1,0);
|
||||
% snr = data(:,1);
|
||||
% bler = data(:,5)./data(:,6); % round 1
|
||||
% BLER_meas = data_all(:,end);
|
||||
%
|
||||
% %% SNR Method
|
||||
% % SINR_awgn = interp1(bler, snr, BLER_meas,'cubic');
|
||||
% % SINR_awgn = SINR_awgn';
|
||||
%
|
||||
% %% for coarse beta calculation:
|
||||
% beta_vec = 0:1:30;
|
||||
% delta = zeros(size(beta_vec));
|
||||
% for beta=1:length(beta_vec)
|
||||
% delta(beta)=delta_BLER(beta_vec(beta));
|
||||
% end
|
||||
% [val ind] = min(delta);
|
||||
% opt_beta_new(mcs(m)) = beta_vec(ind);
|
||||
% %% for optmimized beta calculation
|
||||
% opt_beta(mcs(m)) = fminsearch(@delta_BLER,opt_beta_new(mcs(m)));
|
||||
|
||||
%% BLER Plot w.r.t Effective SINR
|
||||
%opt_beta(mcs(m)) = 1.125;
|
||||
%SINR_eff= 10*log10(-1*opt_beta(mcs(m))*log((1/p)*sum(exp((-10.^(SINR_p'./10))./opt_beta(mcs(m))))));
|
||||
%SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear');
|
||||
h_fig = figure(m);
|
||||
hold off
|
||||
semilogy(SINR_eff,BLER_meas,'rd')
|
||||
hold on
|
||||
grid on
|
||||
semilogy(snr,bler,'y-*');
|
||||
xlim([-10 20])
|
||||
ylim([1e-3 1])
|
||||
s = strcat('L2S Map using EESM for LTE MCS ', num2str(mcs(m)), ' and beta= ',num2str(opt_beta(mcs(m))));
|
||||
title(s);
|
||||
ylabel 'BLER'
|
||||
xlabel 'SINR_{effective}'
|
||||
s2 = strcat('BLER_{meas} MCS ', num2str(mcs(m)));
|
||||
s3 = strcat('BLER_{AWGN} MCS ', num2str(mcs(m)));
|
||||
legend(s2,s3, 'Location', 'Best');
|
||||
% saveas(h_fig,fullfile(pathname,strcat('mcs',num2str(mcs(m)) ,'.eps')),'epsc2');
|
||||
% saveas(h_fig,fullfile(pathname,strcat('mcs',num2str(mcs(m)) ,'.fig')),'fig');
|
||||
% saveas(h_fig,fullfile(pathname,strcat('mcs',num2str(mcs(m)) ,'.jpg')),'jpg');
|
||||
|
||||
end
|
||||
%% Saving adjustment factor (beta)
|
||||
% save(fullfile(pathname, 'opt_beta.dat'),'opt_beta');
|
||||
@@ -0,0 +1,60 @@
|
||||
function delta=delta_BLER(beta)
|
||||
|
||||
beta1 =beta(1);
|
||||
beta2 =beta(2);
|
||||
global SINR_p BLER_meas snr bler SINR_awgn abs_mode modu Pm tx_mode alpha seta
|
||||
|
||||
p = 50;
|
||||
if(abs_mode==1)
|
||||
SINR_eff= 10*log10(-1*beta1*log((1/p)*sum(exp((-10.^(SINR_p'./10))./beta2))));
|
||||
else
|
||||
|
||||
eval(['load ' '/homes/latif/devel/trunk/openair1/SIMULATION/LTE_PHY/siso_MI_abs_' num2str(modu) 'Qam.mat'])
|
||||
if(tx_mode==5)
|
||||
eval(['load ' '/homes/latif/devel/trunk/openair1/EMOS/LTE/POST_PROCESSING/Mode_5/mat_Files/data_mode5_4_' num2str(modu) '_new.mat'])
|
||||
end
|
||||
[x y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
for t=1:1:x
|
||||
s = SINR_p(t,:);
|
||||
% s = (10.^(s/10))./beta1;
|
||||
% s = 10*log10(s);
|
||||
if(tx_mode~=5)
|
||||
eval(['SI_p = interp1(newSNR,newC_siso_' num2str(modu) 'QAM,s, ''linear'' , ''extrap'');']);
|
||||
|
||||
else
|
||||
s(s<-10) = -10;
|
||||
a = round(alpha(t,:)*100);
|
||||
a(a==0) = 1;
|
||||
a(a>200)=200;
|
||||
b = round(seta(t,:)*100);
|
||||
b(b==0) = 1;
|
||||
b(b>200)=200;
|
||||
|
||||
for u=1:length(a)
|
||||
SI_p(u) = data_mode5_4_4_2(b(u) ,a(u), round(s(u) + 11));
|
||||
end
|
||||
end
|
||||
%I(t) = mean(SI_p);
|
||||
RBIR(t) = sum(SI_p/beta1)/Pm;
|
||||
end
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear');
|
||||
%SINR_eff = interp1(newC_siso_16QAM,newSNR,I, 'linear' , 'extrap');
|
||||
|
||||
%SINR_eff = 10*log10(beta1.*(10.^SINR_eff/10));
|
||||
end
|
||||
|
||||
BLER_pred = interp1(snr,bler,SINR_eff,'linear','extrap');
|
||||
BLER_pred(SINR_eff<snr(1)) = 1;
|
||||
BLER_pred(SINR_eff>snr(end)) = 0;
|
||||
%if any(isnan(BLER_pred))
|
||||
% error('shold never happen')
|
||||
%end
|
||||
|
||||
BLER_pred =BLER_pred';
|
||||
|
||||
delta=sum((BLER_pred - BLER_meas).^2);
|
||||
|
||||
% SINR_eff= 10*log10(-1*beta1*log((1/p)*sum(exp((-10.^(SINR_p'./10))./beta2))));
|
||||
%
|
||||
% delta = mean((SINR_awgn - SINR_eff).^2);
|
||||
@@ -0,0 +1,81 @@
|
||||
function delta=delta_BLER_1(beta)
|
||||
global SINR_p BLER_meas snr bler SINR_awgn abs_mode modu Pm tx_mode alpha seta
|
||||
|
||||
if (any(beta==0))
|
||||
delta=Inf;
|
||||
return
|
||||
end
|
||||
|
||||
p = 50;
|
||||
if(abs_mode==0) %MIESM Mapping
|
||||
|
||||
eval(['load ' 'siso_MI_abs_' num2str(modu) 'Qam.mat'])
|
||||
|
||||
[x y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
%SINR_eff = [];
|
||||
for t=1:1:x
|
||||
s = SINR_p(t,:);
|
||||
%s(s<-10)=-10;
|
||||
%s(s>49)=49;
|
||||
|
||||
eval(['SI_p = interp1(newSNR,newC_siso_' num2str(modu) 'QAM,s, ''linear'' , ''extrap'');']);
|
||||
RBIR(t) = (sum(SI_p/beta(1))/Pm);
|
||||
|
||||
end
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear');
|
||||
SINR_eff = SINR_eff .* beta(2);
|
||||
|
||||
elseif(abs_mode==2)
|
||||
|
||||
eval(['load ' '/root/DEVEL/trunk/openair1/SIMULATION/LTE_PHY/Abstraction/siso_MI_abs_' num2str(modu) 'Qam.mat'])
|
||||
|
||||
if(tx_mode~=5)
|
||||
error('IA-MIESM only for LTE TM5!!!')
|
||||
end
|
||||
|
||||
if(modu==4)
|
||||
eval(['load ' '/root/DEVEL/trunk/openair1/SIMULATION/LTE_PHY/Abstraction/data_mode5_4_' num2str(modu) '_morerealizations.mat'])
|
||||
else
|
||||
if(modu==16)
|
||||
eval(['load ' '/root/DEVEL/trunk/openair1/SIMULATION/LTE_PHY/Abstraction/data_mode5_16_16.mat'])
|
||||
end
|
||||
end
|
||||
|
||||
[x y]= size(SINR_p);
|
||||
RBIR = [];
|
||||
for t=1:1:x
|
||||
s = SINR_p(t,:);
|
||||
s(s<-10)=-10;
|
||||
s(s>49)=49;
|
||||
|
||||
a = round(alpha(t,:)*100);
|
||||
a(a==0) = 1;
|
||||
a(a>200)=200;
|
||||
b = round(seta(t,:)*100);
|
||||
b(b==0) = 1;
|
||||
b(b>200)=200;
|
||||
|
||||
for u=1:length(a)
|
||||
if(modu==16)
|
||||
SI_p(u) = data_mode5_16_16(b(u) ,a(u), round(s(u) + 11));
|
||||
else
|
||||
SI_p(u) = data_mode5_4_4(b(u) ,a(u), round(s(u) + 11));
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
RBIR(t) = (sum(SI_p/beta(1))/Pm);
|
||||
|
||||
end
|
||||
|
||||
SINR_eff = interp1(newRBIR, newSNR, RBIR,'linear','extrap');
|
||||
SINR_eff = SINR_eff .* beta(2);
|
||||
else %% EESM Mapping
|
||||
|
||||
|
||||
SINR_eff= 10*log10(-1*beta(2)*log((1/p)*sum(exp((-10.^(SINR_p'./10))./beta(1)))));
|
||||
|
||||
|
||||
end
|
||||
delta = mean((SINR_awgn - SINR_eff).^2);
|
||||
@@ -0,0 +1,16 @@
|
||||
function [q] = demap_q(qq)
|
||||
|
||||
if (qq == 1)
|
||||
q = -1;
|
||||
else
|
||||
if(qq == 2)
|
||||
q = 1i;
|
||||
else
|
||||
if(qq == 3)
|
||||
q = -1i;
|
||||
else
|
||||
q = 1;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,16 @@
|
||||
function q = opposite_q(qq)
|
||||
|
||||
switch qq
|
||||
case 0
|
||||
q=1;
|
||||
case 1
|
||||
q=0;
|
||||
case 2
|
||||
q=3;
|
||||
case 3
|
||||
q=2;
|
||||
|
||||
otherwise
|
||||
disp('input must be between 0-3');
|
||||
end
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
set(0, 'DefaultLineMarkerSize', 10);
|
||||
set(0, 'Defaultaxesfontsize', 14);
|
||||
set(0, 'DefaultLineLineWidth', 2);
|
||||
|
||||
%%
|
||||
%root_path = '../AWGN_SISO_Winter_School';
|
||||
|
||||
plot_style = {'b-*';'r-*';'g-*';'y-*';'k-*';...
|
||||
'b-o';'r-o';'g-o';'y-o';'k-o';...
|
||||
'b-s';'r-s';'g-s';'y-s';'k-s';...
|
||||
'b-d';'r-d';'g-d';'y-d';'k-d';...
|
||||
'b-x';'r-x';'g-x';'y-x';'k-x';...
|
||||
'b-+';'r-+';'g-+';'y-+';'k-+'};
|
||||
|
||||
figure
|
||||
hold off
|
||||
legend_str = {};
|
||||
i=1;
|
||||
for mcs=10:16
|
||||
%file = fullfile(root_path,sprintf('awgn_bler_tx1_mcs%d.csv',mcs));
|
||||
file = sprintf('awgn_bler_tx5_mcs%d_u0.csv',mcs);
|
||||
data = dlmread(file,';',1,0);
|
||||
snr = data(:,1);
|
||||
bler = data(:,5)./data(:,6); % round 1
|
||||
|
||||
snr_tmp = snr(bler<0.1);
|
||||
c_rate(i) = data(1,4);
|
||||
snr_10p(i) = snr_tmp(1);
|
||||
bler_10p(i) = bler(snr==snr_10p(i));
|
||||
figure(1)
|
||||
semilogy(snr,bler(:,1),plot_style{mcs+1});
|
||||
hold on
|
||||
legend_str{i} = sprintf('mcs %d',mcs);
|
||||
i=i+1;
|
||||
end
|
||||
|
||||
%%
|
||||
|
||||
figure(1);
|
||||
h_leg = legend(legend_str,'location','eastoutside');
|
||||
set(h_leg,'FontSize',10);
|
||||
title('AWGN Performance Curves for LTE 5 MhZ');
|
||||
ylabel 'BLER'
|
||||
xlabel 'SNR'
|
||||
ylim([0.001 1])
|
||||
grid on
|
||||
|
||||
%figure;
|
||||
%plot(c_rate(1:10), snr_10p(1:10),'r-x');
|
||||
%hold on
|
||||
%grid on
|
||||
%plot(c_rate(11:17), snr_10p(11:17),'b-x');
|
||||
%plot(c_rate(18:26), snr_10p(18:26),'g-x');
|
||||
%set(gca,'YTick',[-5:16])
|
||||
%set(gca,'XTick',[0.1:0.05:1])
|
||||
%title('SNR (dB) needed to achieve BLER of 10% in AWGN');
|
||||
%ylabel 'SNR'
|
||||
%xlabel 'code rate'
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err
|
||||
-10.000000;0;680;0.110461;502;502;0;502;0;0;0;0;0
|
||||
-9.900000;0;680;0.110461;502;502;0;502;0;0;0;0;0
|
||||
-9.800000;0;680;0.110461;502;502;0;502;0;0;0;0;0
|
||||
-9.700000;0;680;0.110461;501;502;0;502;0;0;0;0;0
|
||||
-9.600000;0;680;0.110461;501;502;0;502;0;0;0;0;0
|
||||
-9.500000;0;680;0.110461;501;502;0;502;0;0;0;0;0
|
||||
-9.400000;0;680;0.110461;497;502;0;502;0;0;0;0;0
|
||||
-9.300000;0;680;0.110461;484;502;0;502;0;0;0;0;0
|
||||
-9.200000;0;680;0.110461;485;502;0;502;0;0;0;0;0
|
||||
-9.100000;0;680;0.110461;457;502;0;502;0;0;0;0;0
|
||||
-9.000000;0;680;0.110461;428;502;0;502;0;0;0;0;0
|
||||
-8.900000;0;680;0.110461;391;502;0;502;0;0;0;0;0
|
||||
-8.800000;0;680;0.110461;330;502;0;502;0;0;0;0;0
|
||||
-8.700000;0;680;0.110461;264;502;0;502;0;0;0;0;0
|
||||
-8.600000;0;680;0.110461;187;502;0;502;0;0;0;0;0
|
||||
-8.500000;0;680;0.110461;127;502;0;502;0;0;0;0;0
|
||||
-8.400000;0;680;0.110461;100;546;0;546;0;0;0;0;0
|
||||
-8.300000;0;680;0.110461;80;1000;0;1000;0;0;0;0;0
|
||||
-8.200000;0;680;0.110461;47;1000;0;1000;0;0;0;0;0
|
||||
-8.100000;0;680;0.110461;23;1000;0;1000;0;0;0;0;0
|
||||
-8.000000;0;680;0.110461;9;1000;0;1000;0;0;0;0;0
|
||||
|
@@ -0,0 +1,24 @@
|
||||
SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err
|
||||
-9.000000;1;904;0.146849;502;502;0;502;0;0;0;0;0
|
||||
-8.900000;1;904;0.146849;502;502;0;502;0;0;0;0;0
|
||||
-8.800000;1;904;0.146849;502;502;0;502;0;0;0;0;0
|
||||
-8.700000;1;904;0.146849;502;502;0;502;0;0;0;0;0
|
||||
-8.600000;1;904;0.146849;502;502;0;502;0;0;0;0;0
|
||||
-8.500000;1;904;0.146849;502;502;0;502;0;0;0;0;0
|
||||
-8.400000;1;904;0.146849;502;502;0;502;0;0;0;0;0
|
||||
-8.300000;1;904;0.146849;501;502;0;502;0;0;0;0;0
|
||||
-8.200000;1;904;0.146849;499;502;0;502;0;0;0;0;0
|
||||
-8.100000;1;904;0.146849;500;502;0;502;0;0;0;0;0
|
||||
-8.000000;1;904;0.146849;489;502;0;502;0;0;0;0;0
|
||||
-7.900000;1;904;0.146849;468;502;0;502;0;0;0;0;0
|
||||
-7.800000;1;904;0.146849;436;502;0;502;0;0;0;0;0
|
||||
-7.700000;1;904;0.146849;394;502;0;502;0;0;0;0;0
|
||||
-7.600000;1;904;0.146849;354;502;0;502;0;0;0;0;0
|
||||
-7.500000;1;904;0.146849;275;502;0;502;0;0;0;0;0
|
||||
-7.400000;1;904;0.146849;182;502;0;502;0;0;0;0;0
|
||||
-7.300000;1;904;0.146849;126;502;0;502;0;0;0;0;0
|
||||
-7.200000;1;904;0.146849;100;553;0;553;0;0;0;0;0
|
||||
-7.100000;1;904;0.146849;84;1000;0;1000;0;0;0;0;0
|
||||
-7.000000;1;904;0.146849;41;1000;0;1000;0;0;0;0;0
|
||||
-6.900000;1;904;0.146849;17;1000;0;1000;0;0;0;0;0
|
||||
-6.800000;1;904;0.146849;6;1000;0;1000;0;0;0;0;0
|
||||
|
@@ -0,0 +1,22 @@
|
||||
SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err
|
||||
-5.000000;10;4008;0.325536;502;502;502;502;0;0;0;0;0
|
||||
-3.500000;10;4008;0.325536;502;502;502;502;0;0;0;0;0
|
||||
-2.000000;10;4008;0.325536;502;502;501;502;0;0;0;0;0
|
||||
-0.500000;10;4008;0.325536;502;502;0;502;0;0;0;0;0
|
||||
-0.400000;10;4008;0.325536;502;502;0;502;0;0;0;0;0
|
||||
-0.300000;10;4008;0.325536;502;502;0;502;0;0;0;0;0
|
||||
-0.200000;10;4008;0.325536;502;502;0;502;0;0;0;0;0
|
||||
-0.100000;10;4008;0.325536;502;502;0;502;0;0;0;0;0
|
||||
-0.000000;10;4008;0.325536;502;502;0;502;0;0;0;0;0
|
||||
0.100000;10;4008;0.325536;502;502;0;502;0;0;0;0;0
|
||||
0.200000;10;4008;0.325536;502;502;0;502;0;0;0;0;0
|
||||
0.300000;10;4008;0.325536;502;502;0;502;0;0;0;0;0
|
||||
0.400000;10;4008;0.325536;502;502;0;502;0;0;0;0;0
|
||||
0.500000;10;4008;0.325536;494;502;0;502;0;0;0;0;0
|
||||
0.600000;10;4008;0.325536;458;502;0;502;0;0;0;0;0
|
||||
0.700000;10;4008;0.325536;389;502;0;502;0;0;0;0;0
|
||||
0.800000;10;4008;0.325536;252;502;0;502;0;0;0;0;0
|
||||
0.900000;10;4008;0.325536;109;502;0;502;0;0;0;0;0
|
||||
1.000000;10;4008;0.325536;70;1000;0;1000;0;0;0;0;0
|
||||
1.100000;10;4008;0.325536;15;1000;0;1000;0;0;0;0;0
|
||||
1.200000;10;4008;0.325536;5;1000;0;1000;0;0;0;0;0
|
||||
|
@@ -0,0 +1,18 @@
|
||||
SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err
|
||||
-4.000000;11;4392;0.356725;502;502;502;502;0;0;0;0;0
|
||||
-2.500000;11;4392;0.356725;502;502;502;502;0;0;0;0;0
|
||||
-1.000000;11;4392;0.356725;502;502;83;502;0;0;0;0;0
|
||||
0.500000;11;4392;0.356725;502;502;0;502;0;0;0;0;0
|
||||
0.600000;11;4392;0.356725;502;502;0;502;0;0;0;0;0
|
||||
0.700000;11;4392;0.356725;502;502;0;502;0;0;0;0;0
|
||||
0.800000;11;4392;0.356725;502;502;0;502;0;0;0;0;0
|
||||
0.900000;11;4392;0.356725;501;502;0;502;0;0;0;0;0
|
||||
1.000000;11;4392;0.356725;501;502;0;502;0;0;0;0;0
|
||||
1.100000;11;4392;0.356725;490;502;0;502;0;0;0;0;0
|
||||
1.200000;11;4392;0.356725;455;502;0;502;0;0;0;0;0
|
||||
1.300000;11;4392;0.356725;375;502;0;502;0;0;0;0;0
|
||||
1.400000;11;4392;0.356725;232;502;0;502;0;0;0;0;0
|
||||
1.500000;11;4392;0.356725;100;507;0;507;0;0;0;0;0
|
||||
1.600000;11;4392;0.356725;63;1000;0;1000;0;0;0;0;0
|
||||
1.700000;11;4392;0.356725;15;1000;0;1000;0;0;0;0;0
|
||||
1.800000;11;4392;0.356725;4;1000;0;1000;0;0;0;0;0
|
||||
|
@@ -0,0 +1,30 @@
|
||||
SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err
|
||||
-3.000000;12;4968;0.403509;502;502;502;502;0;0;0;0;0
|
||||
-1.500000;12;4968;0.403509;502;502;502;502;0;0;0;0;0
|
||||
0.000000;12;4968;0.403509;502;502;3;502;0;0;0;0;0
|
||||
0.100000;12;4968;0.403509;502;502;0;502;0;0;0;0;0
|
||||
0.200000;12;4968;0.403509;502;502;0;502;0;0;0;0;0
|
||||
0.300000;12;4968;0.403509;502;502;0;502;0;0;0;0;0
|
||||
0.400000;12;4968;0.403509;502;502;0;502;0;0;0;0;0
|
||||
0.500000;12;4968;0.403509;502;502;0;502;0;0;0;0;0
|
||||
0.600000;12;4968;0.403509;502;502;0;502;0;0;0;0;0
|
||||
0.700000;12;4968;0.403509;502;502;0;502;0;0;0;0;0
|
||||
0.800000;12;4968;0.403509;502;502;0;502;0;0;0;0;0
|
||||
0.900000;12;4968;0.403509;502;502;0;502;0;0;0;0;0
|
||||
1.000000;12;4968;0.403509;502;502;0;502;0;0;0;0;0
|
||||
1.100000;12;4968;0.403509;502;502;0;502;0;0;0;0;0
|
||||
1.200000;12;4968;0.403509;502;502;0;502;0;0;0;0;0
|
||||
1.300000;12;4968;0.403509;502;502;0;502;0;0;0;0;0
|
||||
1.400000;12;4968;0.403509;502;502;0;502;0;0;0;0;0
|
||||
1.500000;12;4968;0.403509;502;502;0;502;0;0;0;0;0
|
||||
1.600000;12;4968;0.403509;502;502;0;502;0;0;0;0;0
|
||||
1.700000;12;4968;0.403509;501;502;0;502;0;0;0;0;0
|
||||
1.800000;12;4968;0.403509;501;502;0;502;0;0;0;0;0
|
||||
1.900000;12;4968;0.403509;500;502;0;502;0;0;0;0;0
|
||||
2.000000;12;4968;0.403509;483;502;0;502;0;0;0;0;0
|
||||
2.100000;12;4968;0.403509;439;502;0;502;0;0;0;0;0
|
||||
2.200000;12;4968;0.403509;307;502;0;502;0;0;0;0;0
|
||||
2.300000;12;4968;0.403509;179;502;0;502;0;0;0;0;0
|
||||
2.400000;12;4968;0.403509;100;856;0;856;0;0;0;0;0
|
||||
2.500000;12;4968;0.403509;35;1000;0;1000;0;0;0;0;0
|
||||
2.600000;12;4968;0.403509;7;1000;0;1000;0;0;0;0;0
|
||||
|
@@ -0,0 +1,30 @@
|
||||
SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err
|
||||
-2.000000;13;5736;0.465887;502;502;502;502;0;0;0;0;0
|
||||
-0.500000;13;5736;0.465887;502;502;502;502;0;0;0;0;0
|
||||
1.000000;13;5736;0.465887;502;502;4;502;0;0;0;0;0
|
||||
1.100000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
1.200000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
1.300000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
1.400000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
1.500000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
1.600000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
1.700000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
1.800000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
1.900000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
2.000000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
2.100000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
2.200000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
2.300000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
2.400000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
2.500000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
2.600000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
2.700000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
2.800000;13;5736;0.465887;502;502;0;502;0;0;0;0;0
|
||||
2.900000;13;5736;0.465887;501;502;0;502;0;0;0;0;0
|
||||
3.000000;13;5736;0.465887;490;502;0;502;0;0;0;0;0
|
||||
3.100000;13;5736;0.465887;445;502;0;502;0;0;0;0;0
|
||||
3.200000;13;5736;0.465887;347;502;0;502;0;0;0;0;0
|
||||
3.300000;13;5736;0.465887;197;502;0;502;0;0;0;0;0
|
||||
3.400000;13;5736;0.465887;100;608;0;608;0;0;0;0;0
|
||||
3.500000;13;5736;0.465887;40;1000;0;1000;0;0;0;0;0
|
||||
3.600000;13;5736;0.465887;10;1000;0;1000;0;0;0;0;0
|
||||
|
@@ -0,0 +1,30 @@
|
||||
SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err
|
||||
-1.000000;14;6456;0.524366;502;502;502;502;0;0;0;0;0
|
||||
0.500000;14;6456;0.524366;502;502;502;502;0;0;0;0;0
|
||||
2.000000;14;6456;0.524366;502;502;1;502;0;0;0;0;0
|
||||
2.100000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
2.200000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
2.300000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
2.400000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
2.500000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
2.600000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
2.700000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
2.800000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
2.900000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
3.000000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
3.100000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
3.200000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
3.300000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
3.400000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
3.500000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
3.600000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
3.700000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
3.800000;14;6456;0.524366;502;502;0;502;0;0;0;0;0
|
||||
3.900000;14;6456;0.524366;499;502;0;502;0;0;0;0;0
|
||||
4.000000;14;6456;0.524366;469;502;0;502;0;0;0;0;0
|
||||
4.100000;14;6456;0.524366;414;502;0;502;0;0;0;0;0
|
||||
4.200000;14;6456;0.524366;290;502;0;502;0;0;0;0;0
|
||||
4.300000;14;6456;0.524366;161;502;0;502;0;0;0;0;0
|
||||
4.400000;14;6456;0.524366;100;781;0;781;0;0;0;0;0
|
||||
4.500000;14;6456;0.524366;43;1000;0;1000;0;0;0;0;0
|
||||
4.600000;14;6456;0.524366;7;1000;0;1000;0;0;0;0;0
|
||||
|
@@ -0,0 +1,31 @@
|
||||
SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err
|
||||
0.000000;15;7224;0.586745;502;502;502;502;0;0;0;0;0
|
||||
1.500000;15;7224;0.586745;502;502;502;502;0;0;0;0;0
|
||||
3.000000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
3.100000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
3.200000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
3.300000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
3.400000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
3.500000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
3.600000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
3.700000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
3.800000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
3.900000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
4.000000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
4.100000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
4.200000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
4.300000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
4.400000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
4.500000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
4.600000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
4.700000;15;7224;0.586745;502;502;0;502;0;0;0;0;0
|
||||
4.800000;15;7224;0.586745;501;502;0;502;0;0;0;0;0
|
||||
4.900000;15;7224;0.586745;500;502;0;502;0;0;0;0;0
|
||||
5.000000;15;7224;0.586745;478;502;0;502;0;0;0;0;0
|
||||
5.100000;15;7224;0.586745;416;502;0;502;0;0;0;0;0
|
||||
5.200000;15;7224;0.586745;306;502;0;502;0;0;0;0;0
|
||||
5.300000;15;7224;0.586745;172;502;0;502;0;0;0;0;0
|
||||
5.400000;15;7224;0.586745;100;703;0;703;0;0;0;0;0
|
||||
5.500000;15;7224;0.586745;50;1000;0;1000;0;0;0;0;0
|
||||
5.600000;15;7224;0.586745;15;1000;0;1000;0;0;0;0;0
|
||||
5.700000;15;7224;0.586745;5;1000;0;1000;0;0;0;0;0
|
||||
|
@@ -0,0 +1,28 @@
|
||||
SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err
|
||||
1.000000;16;7736;0.628330;502;502;502;502;0;0;0;0;0
|
||||
2.500000;16;7736;0.628330;502;502;502;502;0;0;0;0;0
|
||||
4.000000;16;7736;0.628330;502;502;0;502;0;0;0;0;0
|
||||
4.100000;16;7736;0.628330;502;502;0;502;0;0;0;0;0
|
||||
4.200000;16;7736;0.628330;502;502;0;502;0;0;0;0;0
|
||||
4.300000;16;7736;0.628330;502;502;0;502;0;0;0;0;0
|
||||
4.400000;16;7736;0.628330;502;502;0;502;0;0;0;0;0
|
||||
4.500000;16;7736;0.628330;502;502;0;502;0;0;0;0;0
|
||||
4.600000;16;7736;0.628330;502;502;0;502;0;0;0;0;0
|
||||
4.700000;16;7736;0.628330;502;502;0;502;0;0;0;0;0
|
||||
4.800000;16;7736;0.628330;502;502;0;502;0;0;0;0;0
|
||||
4.900000;16;7736;0.628330;502;502;0;502;0;0;0;0;0
|
||||
5.000000;16;7736;0.628330;502;502;0;502;0;0;0;0;0
|
||||
5.100000;16;7736;0.628330;502;502;0;502;0;0;0;0;0
|
||||
5.200000;16;7736;0.628330;502;502;0;502;0;0;0;0;0
|
||||
5.300000;16;7736;0.628330;502;502;0;502;0;0;0;0;0
|
||||
5.400000;16;7736;0.628330;502;502;0;502;0;0;0;0;0
|
||||
5.500000;16;7736;0.628330;502;502;0;502;0;0;0;0;0
|
||||
5.600000;16;7736;0.628330;496;502;0;502;0;0;0;0;0
|
||||
5.700000;16;7736;0.628330;470;502;0;502;0;0;0;0;0
|
||||
5.800000;16;7736;0.628330;400;502;0;502;0;0;0;0;0
|
||||
5.900000;16;7736;0.628330;286;502;0;502;0;0;0;0;0
|
||||
6.000000;16;7736;0.628330;147;502;0;502;0;0;0;0;0
|
||||
6.100000;16;7736;0.628330;100;909;0;909;0;0;0;0;0
|
||||
6.200000;16;7736;0.628330;31;1000;0;1000;0;0;0;0;0
|
||||
6.300000;16;7736;0.628330;13;1000;0;1000;0;0;0;0;0
|
||||
6.400000;16;7736;0.628330;3;1000;0;1000;0;0;0;0;0
|
||||
|
@@ -0,0 +1,27 @@
|
||||
SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err
|
||||
2.000000;17;7736;0.418887;502;502;502;502;0;0;0;0;0
|
||||
3.500000;17;7736;0.418887;502;502;502;502;0;0;0;0;0
|
||||
5.000000;17;7736;0.418887;502;502;2;502;0;0;0;0;0
|
||||
5.100000;17;7736;0.418887;502;502;0;502;0;0;0;0;0
|
||||
5.200000;17;7736;0.418887;502;502;0;502;0;0;0;0;0
|
||||
5.300000;17;7736;0.418887;502;502;0;502;0;0;0;0;0
|
||||
5.400000;17;7736;0.418887;502;502;0;502;0;0;0;0;0
|
||||
5.500000;17;7736;0.418887;502;502;0;502;0;0;0;0;0
|
||||
5.600000;17;7736;0.418887;502;502;0;502;0;0;0;0;0
|
||||
5.700000;17;7736;0.418887;502;502;0;502;0;0;0;0;0
|
||||
5.800000;17;7736;0.418887;502;502;0;502;0;0;0;0;0
|
||||
5.900000;17;7736;0.418887;502;502;0;502;0;0;0;0;0
|
||||
6.000000;17;7736;0.418887;502;502;0;502;0;0;0;0;0
|
||||
6.100000;17;7736;0.418887;502;502;0;502;0;0;0;0;0
|
||||
6.200000;17;7736;0.418887;502;502;0;502;0;0;0;0;0
|
||||
6.300000;17;7736;0.418887;502;502;0;502;0;0;0;0;0
|
||||
6.400000;17;7736;0.418887;502;502;0;502;0;0;0;0;0
|
||||
6.500000;17;7736;0.418887;501;502;0;502;0;0;0;0;0
|
||||
6.600000;17;7736;0.418887;482;502;0;502;0;0;0;0;0
|
||||
6.700000;17;7736;0.418887;434;502;0;502;0;0;0;0;0
|
||||
6.800000;17;7736;0.418887;323;502;0;502;0;0;0;0;0
|
||||
6.900000;17;7736;0.418887;197;502;0;502;0;0;0;0;0
|
||||
7.000000;17;7736;0.418887;100;533;0;533;0;0;0;0;0
|
||||
7.100000;17;7736;0.418887;68;1000;0;1000;0;0;0;0;0
|
||||
7.200000;17;7736;0.418887;27;1000;0;1000;0;0;0;0;0
|
||||
7.300000;17;7736;0.418887;4;1000;0;1000;0;0;0;0;0
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user