Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
littleBu
OpenXG-RAN
Commits
a8f65630
Commit
a8f65630
authored
Jan 16, 2025
by
Laurent THOMAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove a complex and not very usefull trace in replay_node
parent
e7e01f75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
37 deletions
+2
-37
radio/rfsimulator/stored_node.c
radio/rfsimulator/stored_node.c
+2
-37
No files found.
radio/rfsimulator/stored_node.c
View file @
a8f65630
...
...
@@ -45,41 +45,6 @@ int fullread(int fd, void *_buf, int count) {
return
ret
;
}
#define shift 4
int32_t
signal_energy
(
int32_t
*
input
,
uint32_t
length
)
{
int32_t
i
;
int32_t
temp
,
temp2
;
register
simde__m64
mm0
,
mm1
,
mm2
,
mm3
;
simde__m64
*
in
=
(
simde__m64
*
)
input
;
mm0
=
simde_mm_setzero_si64
();
// pxor(mm0,mm0);
mm3
=
simde_mm_setzero_si64
();
// pxor(mm3,mm3);
for
(
i
=
0
;
i
<
length
>>
1
;
i
++
)
{
mm1
=
in
[
i
];
mm2
=
mm1
;
mm1
=
_m_pmaddwd
(
mm1
,
mm1
);
mm1
=
_m_psradi
(
mm1
,
shift
);
// shift any 32 bits blocs of the word by the value shift
mm0
=
_m_paddd
(
mm0
,
mm1
);
// add the two 64 bits words 4 bytes by 4 bytes
// mm2 = _m_psrawi(mm2,shift_DC);
mm3
=
_m_paddw
(
mm3
,
mm2
);
// add the two 64 bits words 2 bytes by 2 bytes
}
mm1
=
mm0
;
mm0
=
_m_psrlqi
(
mm0
,
32
);
mm0
=
_m_paddd
(
mm0
,
mm1
);
temp
=
_m_to_int
(
mm0
);
temp
/=
length
;
temp
<<=
shift
;
// this is the average of x^2
// now remove the DC component
mm2
=
_m_psrlqi
(
mm3
,
32
);
mm2
=
_m_paddw
(
mm2
,
mm3
);
mm2
=
_m_pmaddwd
(
mm2
,
mm2
);
temp2
=
_m_to_int
(
mm2
);
temp2
/=
(
length
*
length
);
// temp2<<=(2*shift_DC);
temp
-=
temp2
;
return
((
temp
>
0
)
?
temp
:
1
);
}
void
fullwrite
(
int
fd
,
void
*
_buf
,
int
count
)
{
char
*
buf
=
_buf
;
...
...
@@ -238,8 +203,8 @@ int main(int argc, char *argv[]) {
((
int16_t
*
)
buff
)[
i
]
/=
16
;
usleep
(
1000
);
printf
(
"sending at ts: %lu, number of samples: %d
, energy: %d
\n
"
,
header
.
timestamp
,
header
.
size
,
signal_energy
(
buff
,
header
.
size
)
);
printf
(
"sending at ts: %lu, number of samples: %d
\n
"
,
header
.
timestamp
,
header
.
size
);
fullwrite
(
serviceSock
,
buff
,
dataSize
);
// Purge incoming samples
setblocking
(
serviceSock
,
notBlocking
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment