setting Nc at the command line on fdmdv_demod
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 2 Mar 2013 06:08:57 +0000 (06:08 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 2 Mar 2013 06:08:57 +0000 (06:08 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1181 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/octave/fdmdv.m
codec2-dev/octave/fdmdv_demod.m

index 8af361de3a5ff36c8e54467e251a1fc1a4386490..2a8da1e8549c17ad9be262b0e9785ad9c7fbbc68 100644 (file)
@@ -20,7 +20,11 @@ global T  = 1/Fs;      % sample period in seconds
 global Rs;
        Rs = 50;        % symbol rate in Hz
 global Nc;             % number of carriers
+if isempty(NumCarriers)
        Nc = 14;
+else
+       Nc = NumCarriers;
+end
 global Nb;
        Nb = 2;         % Bits/symbol for PSK modulation
 global Rb;
@@ -855,7 +859,6 @@ function [track state bad_sync] = freq_state(sync_bit, state, bad_sync)
     if sync_bit == 0
       bad_sync = 0;
     else
-      printf("inc ");
       bad_sync++;
       if bad_sync > 2
         next_state = 0;
@@ -868,7 +871,6 @@ function [track state bad_sync] = freq_state(sync_bit, state, bad_sync)
     if sync_bit == 1
       bad_sync = 0;
     else
-      printf("inc ");
       bad_sync++;
       if bad_sync > 2
         next_state = 0;
index 0675285b5768881eec7bcd288ff9980cc277fef0..b0e313f2c1e579025cad257778664e5106bfd4ae 100644 (file)
@@ -8,10 +8,10 @@
 % Version 2
 %
 
-function fdmdv_demod(rawfilename, nbits, errorpatternfilename)
+function fdmdv_demod(rawfilename, nbits, NumCarriers, errorpatternfilename)
 
   fdmdv; % include modem code
-
+  
   modulation = 'dqpsk';
 
   fin = fopen(rawfilename, "rb");
@@ -243,7 +243,7 @@ function fdmdv_demod(rawfilename, nbits, errorpatternfilename)
       plot(0.30 + p + 0.25*error_pattern_log(p*2:Nc*Nb:lep),'r')
     end
     hold off;
-    axis([1 lep/(Nc*Nb) 0 15])
+    axis([1 lep/(Nc*Nb) 0 Nc])
   end
 
   figure(7)
@@ -282,12 +282,12 @@ if 0
     plot(0.30 + p + 0.25*error_pattern_log_inter(p*2:Nc*Nb:lep),'r')
   end
   hold off;
-  axis([1 lep/(Nc*Nb) 0 15])
+  axis([1 lep/(Nc*Nb) 0 Nc])
 end
 
   % save error pattern file
 
-  if nargin == 3
+  if nargin == 4
     fout = fopen(errorpatternfilename, "wb");
     fwrite(fout, error_pattern_log, "short");
     fclose(fout);