Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
math
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nats
math
Commits
1d1ac225
Commit
1d1ac225
authored
5 years ago
by
Mehdi Khairy
Browse files
Options
Downloads
Patches
Plain Diff
added split offset for simulation
parent
a72ffda8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
FT8/mod_sim.m
+21
-14
21 additions, 14 deletions
FT8/mod_sim.m
with
21 additions
and
14 deletions
FT8/mod_sim.m
+
21
−
14
View file @
1d1ac225
...
...
@@ -13,11 +13,24 @@ function sig = modulate(msg, syms)
end
endfunction
% To be included in an other file
% Generate a signal with power 1 by default
function
sym_array
=
gen_sym_array
(
nb_freq
,
FS
,
freq_step
,
nb_sample
,
tx_offset
)
sym_array
=
zeros
(
nb_freq
,
nb_sample
);
t
=
(
1
:
nb_sample
);
for
i
=
1
:
nb_freq
fstart
=
0
-
(
nb_freq
-
1
)
/
2
;
findex
=
(
fstart
+
i
)
*
freq_step
;
sym_freq
=
exp
(
j
*
2
*
pi
*
((
findex
+
tx_offset
)/
FS
)
*
t
);
sym_array
(
i
,
1
:
nb_sample
)
=
sym_freq
;
end
endfunction
function
np
=
gennoise
(
power
,
len
)
np
=
(
sqrt
(
1
/
2
)
*
randn
(
1
,
len
)
+
j
*
sqrt
(
1
/
2
)
*
randn
(
1
,
len
))
*
sqrt
(
power
);
endfunction
function
symlist
=
symgen
()
%
function symlist = symgen()
freq_step
=
6.25
;
% 50Hz / 8
nb_freq
=
8
;
...
...
@@ -25,20 +38,11 @@ nb_freq = 8;
FS
=
100
;
nb_sample
=
16
;
% Some information talk about 160ms symbol duration
% Generating the 8 frequencies
sym_array
=
zeros
(
nb_freq
,
nb_sample
);
t
=
(
1
:
nb_sample
);
% TX Offset
tx_offset
=
0
;
% Generate a signal with power SQRT(2) by default
for
i
=
1
:
nb_freq
fstart
=
0
-
(
nb_freq
-
1
)
/
2
;
findex
=
(
fstart
+
i
)
*
freq_step
;
sym_freq
=
exp
(
j
*
2
*
pi
*
((
findex
+
tx_offset
)/
FS
)
*
t
);
sym_array
(
i
,
1
:
nb_sample
)
=
sym_freq
;
end
% Generating the 8 frequencies
sym_array
=
gen_sym_array
(
nb_freq
,
FS
,
freq_step
,
nb_sample
,
tx_offset
);
% FT8 is 79 symbol: 7 + 29 + 7 + 29 + 7
costas
=
[
2
5
6
0
4
1
3
];
...
...
@@ -56,11 +60,14 @@ total_samples = msg_len * nb_sample;
signal
=
zeros
(
1
,
total_samples
);
signal
=
modulate
(
msg
,
sym_array
);
% Generating the 8 frequencies with 0 offset
sym_array
=
gen_sym_array
(
nb_freq
,
FS
,
freq_step
,
nb_sample
,
0
);
costas_mod
=
modulate
(
costas
,
sym_array
);
% signal is now containing a fake frame of FT8
% needs to add noise power calculation
Pn
=
1
0
;
% Noise power relative to signal power
Pn
=
0
.1
;
% Noise power relative to signal power
signoise
=
signal
+
gennoise
(
Pn
,
length
(
signal
));
corresigcost
=
xcorr
(
signoise
,
costas_mod
);
plot
(
abs
(
corresigcost
));
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment