changed amplitde scaling to prevent clipping with noise
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 4 May 2017 05:35:38 +0000 (05:35 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 4 May 2017 05:35:38 +0000 (05:35 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@3121 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/octave/ofdm_rx.m
codec2-dev/octave/ofdm_tx.m

index dd275ff086c4144db44e3ec11ec5a47683ddc43f..b2401b13075845bacdce52ee2fa94131293eb1b0 100644 (file)
@@ -3,6 +3,12 @@
 %
 % OFDM file based rx.
 
+#{
+  TODO: 
+    [ ] some sort of real time GUI display to watch signal evolving
+    [ ] est SNR or Eb/No of recieved signal
+    [ ] way to fall out of sync
+#}
 
 function ofdm_rx(filename)
   ofdm_lib;
@@ -25,7 +31,7 @@ function ofdm_rx(filename)
 
   % load real samples from file
 
-  Ascale= 4E5;
+  Ascale= 2E5;
   frx=fopen(filename,"rb"); rx = 2*fread(frx, Inf, "short")/4E5; fclose(frx);
   Nsam = length(rx); Nframes = floor(Nsam/Nsamperframe);
   prx = 1;
@@ -33,8 +39,7 @@ function ofdm_rx(filename)
   % 'prime' rx buf to get correct coarse timing (for now)
 
   prx = 1;
-  %nin = Nsamperframe+2*(M+Ncp);
-  nin = Nsamperframe+M+Ncp;
+  nin = Nsamperframe+2*(M+Ncp);
   states.rxbuf(Nrxbuf-nin+1:Nrxbuf) = rx(prx:nin);
   prx += nin;
 
index 7fd6acb57f2b04cb8d0aa983dcb05cd2d5dd9958..4afba9a224746b6f7d4795d147cf177f252b102e 100644 (file)
@@ -11,6 +11,9 @@
     [ ] maybe 10s worth of frames, sync up to any one automatically
         + or start with maybe 10 frames
         + measure BER match on each one
+    [ ] model clipping/PA compression
+    [ ] sample clock offsets
+    [ ] compare with same SNR from pathsim
 #}
 
 function ofdm_tx(filename, Nsec, EbNodB=100, channel='awgn', freq_offset_Hz=0)
@@ -90,6 +93,6 @@ function ofdm_tx(filename, Nsec, EbNodB=100, channel='awgn', freq_offset_Hz=0)
   rx = real(rx) + noise;
   printf("measured SNR: %3.2f dB\n", 10*log10(var(real(tx))/var(noise)));
 
-  Ascale = 4E5;
+  Ascale = 2E5;
   frx=fopen(filename,"wb"); fwrite(frx, Ascale*rx, "short"); fclose(frx);
 endfunction