Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rdma-mwe
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
Titouan Soulard
rdma-mwe
Commits
28952c5f
Commit
28952c5f
authored
Jan 25, 2024
by
Titouan Soulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
example: add an utility for generating binary IQ sample files
parent
b97dbf8e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
5 deletions
+35
-5
Makefile
Makefile
+8
-5
example/generate_iq_samples.c
example/generate_iq_samples.c
+27
-0
No files found.
Makefile
View file @
28952c5f
CFLAGS
=
-Wall
-O3
INCLUDE_FLAGS
=
-I
./include
LIB_FLAGS
=
-lc
-ldl
-l
ibverbs
-lpthread
LIB_FLAGS
=
-lc
-ldl
-l
m
-libverbs
-lpthread
-L
./out
# Libraries after `--no-as-needed` are forcefully loaded: they are required by Amarisoft libraries
FORCE_LIB_FLAGS
=
-Wl
,--no-as-needed
-lm
-lpthread
all
:
out/libcapulet.so out/libpotoml.so out/libtrx_rdma.so out/libtrx_play.so out/rdma_standalone out/trx-bridge
all
:
out/libcapulet.so out/libpotoml.so out/libtrx_rdma.so out/libtrx_play.so out/rdma_standalone out/
generate_iq_samples out/
trx-bridge
install
:
all
ln
-sfr
out/libcapulet.so /usr/local/lib/
...
...
@@ -32,13 +32,16 @@ out/libpotoml.so: common/hashtable.lo libpotoml/toml.lo
gcc
-shared
-fPIC
-DPIC
-o
$@
$^
$(LIB_FLAGS)
out/libtrx_rdma.so
:
libtrx/trx_rdma.lo out/libcapulet.so
gcc
-shared
-fPIC
-DPIC
-o
$@
$<
$(LIB_FLAGS)
-
L
./out
-
lcapulet
gcc
-shared
-fPIC
-DPIC
-o
$@
$<
$(LIB_FLAGS)
-lcapulet
out/libtrx_play.so
:
libtrx/trx_play.lo
gcc
-shared
-fPIC
-DPIC
-o
$@
$<
$(LIB_FLAGS)
out/rdma_standalone
:
example/rdma_standalone.o out/libcapulet.so
gcc
$(CFLAGS)
-o
$@
$<
$(LIB_FLAGS)
-L
./out
-lcapulet
gcc
$(CFLAGS)
-o
$@
$<
$(LIB_FLAGS)
-lcapulet
out/generate_iq_samples
:
example/generate_iq_samples.o
gcc
$(CFLAGS)
-o
$@
$^
$(LIB_FLAGS)
out/trx-bridge
:
trx-bridge/bridge.o out/libpotoml.so
gcc
$(CFLAGS)
-o
$@
$<
$(LIB_FLAGS)
-
L
./out
-
lpotoml
$(FORCE_LIB_FLAGS)
gcc
$(CFLAGS)
-o
$@
$<
$(LIB_FLAGS)
-lpotoml
$(FORCE_LIB_FLAGS)
example/generate_iq_samples.c
0 → 100644
View file @
28952c5f
#include <stdio.h>
#include <stdint.h>
#include <math.h>
#define SAMPLE_COUNT 1536
int
main
(
void
)
{
FILE
*
outfile
;
uint64_t
i
;
float
samples
[
SAMPLE_COUNT
*
2
];
float
time
;
for
(
i
=
0
;
i
<
SAMPLE_COUNT
;
i
++
)
{
fflush
(
stdout
);
time
=
(
float
)
i
/
((
float
)
SAMPLE_COUNT
);
samples
[
i
*
2
]
=
cos
(
6
.
28318530718
*
time
);
samples
[
i
*
2
+
1
]
=
0
.
0
;
printf
(
"
\r
Generating sample %lu: %f"
,
i
+
1
,
samples
[
i
*
2
]);
}
printf
(
"
\n
Writing...
\n
"
);
outfile
=
fopen
(
"pure_sine.bin"
,
"w"
);
fwrite
(
samples
,
SAMPLE_COUNT
*
sizeof
(
float
),
1
,
outfile
);
fclose
(
outfile
);
return
0
;
}
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