From: drowe67 Date: Wed, 30 Dec 2015 22:55:06 +0000 (+0000) Subject: found 100Hz offset introduced while using for sm2000, that had broken Horus rtty X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=56055e7f779d3881ff687df1f357a49add6564a3;p=freetel-svn-tracking.git found 100Hz offset introduced while using for sm2000, that had broken Horus rtty git-svn-id: https://svn.code.sf.net/p/freetel/code@2584 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/octave/fsk_horus.m b/codec2-dev/octave/fsk_horus.m index 965f163b..4627d181 100644 --- a/codec2-dev/octave/fsk_horus.m +++ b/codec2-dev/octave/fsk_horus.m @@ -70,7 +70,7 @@ function states = fsk_horus_init(Fs,Rs) states.uw = [mapped_db zeros(1,npad) mapped_db zeros(1,npad) mapped_db zeros(1,npad) mapped_db zeros(1,npad) mapped_db zeros(1,npad)]; - states.uw_thresh = 5*7 - 4; % allow 24bit errors when looking for UW + states.uw_thresh = 5*7 - 4; % allow a few bit errors when looking for UW states.df = 0; states.f1 = 0; @@ -136,7 +136,7 @@ function [rx_bits states] = fsk_horus_demod(states, sf) h = hanning(nin); Sf = fft(sf .* h, Ndft); - [m1 m1_index] = max(Sf(100:Ndft/2)); + [m1 m1_index] = max(Sf(1:Ndft/2)); % zero out region 100Hz either side of max so we can find second highest peak @@ -151,7 +151,7 @@ function [rx_bits states] = fsk_horus_demod(states, sf) end Sf2(st:en) = 0; - [m2 m2_index] = max(Sf2(100:Ndft/2)); + [m2 m2_index] = max(Sf2(1:Ndft/2)); % f1 always the lower tone @@ -699,8 +699,9 @@ endfunction function rx_bits_log = demod_file(filename, test_frame_mode, noplot) fin = fopen(filename,"rb"); more off; - states = fsk_horus_init(96000, 1200); - states.verbose = 0x1 + 0x4; + %states = fsk_horus_init(96000, 1200); + states = fsk_horus_init(8000, 100); + states.verbose = 0x1 + 0x8; N = states.N; P = states.P; Rs = states.Rs; @@ -828,10 +829,10 @@ endfunction if exist("fsk_horus_as_a_lib") == 0 %run_sim; - %rx_bits = demod_file("~/Desktop/vk5arg-3-1.wav",4); + rx_bits = demod_file("horus.raw",4); %rx_bits = demod_file("~/Desktop/fsk_horus_10dB_1000ppm.wav",4); %rx_bits = demod_file("~/Desktop/fsk_horus_6dB_0ppm.wav",4); - rx_bits = demod_file("test.raw",1,1); + % rx_bits = demod_file("test.raw",1,1); %rx_bits = demod_file("/dev/ttyACM0",1); %rx_bits = demod_file("fsk_horus_rx_1200_96k.raw",1); %rx_bits = demod_file("mp.raw",4);