Skip to content
Snippets Groups Projects
Commit a63d651d authored by nats's avatar nats
Browse files

FT8 demod

parent 4c544086
No related branches found
No related tags found
No related merge requests found
clear;
pkg load signal;
% To be included in an other file
function sig = modulate(msg, syms)
nb_sample = columns(syms);
......@@ -12,29 +12,30 @@ function sig = modulate(msg, syms)
end
endfunction
function np = gennoise(power, len)
np = (sqrt(1/2)*randn(1,len)+j*sqrt(1/2)*randn(1,len)) * sqrt(power);
endfunction
freq_step = 6.25; % 50Hz / 8
nb_freq = 8;
FS = 625;
nb_sample = 100; % Some information talk about 160ms symbol duration
FS = 50;
nb_sample = 8; % 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 = 2.5;
for i = 1:nb_freq
fstart = 0 - (nb_freq-1) / 2;
findex = (fstart + i) * freq_step;
sym_freq = exp(j*2*pi*(findex/FS)*t);
sym_freq = exp(j*2*pi*((findex+tx_offset)/FS)*t);
sym_array(i,1:nb_sample) = sym_freq;
end
plot(real(sym_array(1,:)));
hold on;
plot(real(sym_array(2,:)));
plot(real(sym_array(3,:)));
plot(real(sym_array(4,:)));
% FT8 is 79 symbol: 7 + 29 + 7 + 29 + 7
costas = [2 5 6 0 4 1 3];
costas = costas + 1; % Avoid 0 indexing
......@@ -53,11 +54,6 @@ signal = modulate(msg, sym_array);
costas_mod = modulate(costas, sym_array);
%for i = 1:length(msg)
% sym_index = msg(i);
% l_index = 1 + (i-1) * nb_sample;
% h_index = i * nb_sample;
% signal(l_index:h_index) = sym_array(sym_index,:);
%end
% signal is now containing a fake frame of FT8
% needs to add noise power calculation
signoise = signal + gennoise(1, length(signal));
\ No newline at end of file
No preview for this file type
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment