commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r6562 - in gnuradio/branches/developers/jcorgan/radar/


From: jcorgan
Subject: [Commit-gnuradio] r6562 - in gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src: . utils
Date: Fri, 28 Sep 2007 15:38:37 -0600 (MDT)

Author: jcorgan
Date: 2007-09-28 15:38:34 -0600 (Fri, 28 Sep 2007)
New Revision: 6562

Added:
   gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/
   gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/calc_avg.m
   gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/czpad.m
   
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/echo_image.m
   gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/fftcorr.m
   gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/pulse
   gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/read_avg.m
   
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/read_avg_sec.m
   
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/read_echos.m
Log:
Add misc. utility files for Octave.

Added: 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/calc_avg.m
===================================================================
--- 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/calc_avg.m   
                            (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/calc_avg.m   
    2007-09-28 21:38:34 UTC (rev 6562)
@@ -0,0 +1,8 @@
+function avg = calc_avg(rlen, mintime)
+    avg = read_avg('echos.dat', rlen);
+    x = 1:rlen;
+    x = (x/64e6+mintime)*3e8/2;
+    plot(x, abs(avg), "^;Amplitude;");
+    xlabel("Range (meters)");
+    axis([max(x) 0])
+endfunction

Added: 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/czpad.m
===================================================================
--- gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/czpad.m  
                        (rev 0)
+++ gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/czpad.m  
2007-09-28 21:38:34 UTC (rev 6562)
@@ -0,0 +1,8 @@
+# Center and zero pad v to length n
+function pad = czpad(v, n)
+    c = n/2;
+    l = length(v);
+    pad(c-l/2+1:c+l/2) = v;
+    pad(c+l/2+1:n) = 0;
+endfunction
+ 
\ No newline at end of file

Added: 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/echo_image.m
===================================================================
--- 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/echo_image.m 
                            (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/echo_image.m 
    2007-09-28 21:38:34 UTC (rev 6562)
@@ -0,0 +1,6 @@
+function echo_image(filename, data)
+    d = abs(data);
+    d = d-min(min(d));
+    d = d/(max(max(d)))*255;
+    pngwrite(filename, d, d, d, ones(size(d)));
+endfunction
\ No newline at end of file

Added: 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/fftcorr.m
===================================================================
--- 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/fftcorr.m    
                            (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/fftcorr.m    
    2007-09-28 21:38:34 UTC (rev 6562)
@@ -0,0 +1,4 @@
+# Perform circular correlation via FFT
+function corr = fftcorr(v,ref)
+    corr = ifft(conj(fft(ref)).*fft(v));
+endfunction

Added: gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/pulse
===================================================================
--- gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/pulse    
                        (rev 0)
+++ gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/pulse    
2007-09-28 21:38:34 UTC (rev 6562)
@@ -0,0 +1,396 @@
+# Created by Octave 2.1.73, Tue Sep 25 14:17:22 2007 EDT <address@hidden>
+# name: __nargin__
+# type: scalar
+0
+# name: pulse321
+# type: complex matrix
+# rows: 64
+# columns: 1
+ (-0.0003662109375,0.9998779296875)
+ (-0.0003662109375,0.9998779296875)
+ (0,-0.9996337890625)
+ (0,-0.9996337890625)
+ (-0.0010986328125,-0.961181640625)
+ (-0.0010986328125,-0.961181640625)
+ (0.0072021484375,0.882568359375)
+ (0.0072021484375,0.882568359375)
+ (-0.0279541015625,-0.7666015625)
+ (-0.0279541015625,-0.7666015625)
+ (0.0765380859375,0.616943359375)
+ (0.0765380859375,0.616943359375)
+ (-0.1688232421875,-0.4447021484375)
+ (-0.1688232421875,-0.4447021484375)
+ (0.3212890625,0.26611328125)
+ (0.3212890625,0.26611328125)
+ (-0.54638671875,-0.1092529296875)
+ (-0.54638671875,-0.1092529296875)
+ (0.843994140625,0.012451171875)
+ (0.843994140625,0.012451171875)
+ (0.8046875,-0.019775390625)
+ (0.8046875,-0.019775390625)
+ (-0.444580078125,0.1688232421875)
+ (-0.444580078125,0.1688232421875)
+ (0.147705078125,-0.477294921875)
+ (0.147705078125,-0.477294921875)
+ (-0.0032958984375,0.921142578125)
+ (-0.0032958984375,0.921142578125)
+ (0.09228515625,0.5811767578125)
+ (0.09228515625,0.5811767578125)
+ (-0.4447021484375,-0.1688232421875)
+ (-0.4447021484375,-0.1688232421875)
+ (0.9996337890625,0.000244140625)
+ (0.9996337890625,0.000244140625)
+ (0.4127197265625,-0.19140625)
+ (0.4127197265625,-0.19140625)
+ (-0.0379638671875,0.728759765625)
+ (-0.0379638671875,0.728759765625)
+ (0.09228515625,0.5811767578125)
+ (0.09228515625,0.5811767578125)
+ (-0.617919921875,-0.0762939453125)
+ (-0.617919921875,-0.0762939453125)
+ (-0.6170654296875,0.0765380859375)
+ (-0.6170654296875,0.0765380859375)
+ (0.0621337890625,-0.654296875)
+ (0.0621337890625,-0.654296875)
+ (-0.127685546875,-0.511962890625)
+ (-0.127685546875,-0.511962890625)
+ (0.843994140625,0.012451171875)
+ (0.843994140625,0.012451171875)
+ (0.29296875,-0.293212890625)
+ (0.29296875,-0.293212890625)
+ (-0.01953125,-0.8046875)
+ (-0.01953125,-0.8046875)
+ (0.654296875,0.0618896484375)
+ (0.654296875,0.0618896484375)
+ (0.3505859375,-0.239990234375)
+ (0.3505859375,-0.239990234375)
+ (-0.0279541015625,-0.7666015625)
+ (-0.0279541015625,-0.7666015625)
+ (0.805419921875,0.01953125)
+ (0.805419921875,0.01953125)
+ (0.1688232421875,-0.444580078125)
+ (0.1688232421875,-0.444580078125)
+# name: pulse325
+# type: complex matrix
+# rows: 320
+# columns: 1
+ (-0.0003662109375,0.9998779296875)
+ (-0.0003662109375,0.9998779296875)
+ (0,-0.9996337890625)
+ (0,-0.9996337890625)
+ (-0.0010986328125,-0.961181640625)
+ (-0.0010986328125,-0.961181640625)
+ (0.0072021484375,0.882568359375)
+ (0.0072021484375,0.882568359375)
+ (-0.0279541015625,-0.7666015625)
+ (-0.0279541015625,-0.7666015625)
+ (0.0765380859375,0.616943359375)
+ (0.0765380859375,0.616943359375)
+ (-0.1688232421875,-0.4447021484375)
+ (-0.1688232421875,-0.4447021484375)
+ (0.3212890625,0.26611328125)
+ (0.3212890625,0.26611328125)
+ (-0.54638671875,-0.1092529296875)
+ (-0.54638671875,-0.1092529296875)
+ (0.843994140625,0.012451171875)
+ (0.843994140625,0.012451171875)
+ (0.8046875,-0.019775390625)
+ (0.8046875,-0.019775390625)
+ (-0.444580078125,0.1688232421875)
+ (-0.444580078125,0.1688232421875)
+ (0.147705078125,-0.477294921875)
+ (0.147705078125,-0.477294921875)
+ (-0.0032958984375,0.921142578125)
+ (-0.0032958984375,0.921142578125)
+ (0.09228515625,0.5811767578125)
+ (0.09228515625,0.5811767578125)
+ (-0.4447021484375,-0.1688232421875)
+ (-0.4447021484375,-0.1688232421875)
+ (0.9996337890625,0.000244140625)
+ (0.9996337890625,0.000244140625)
+ (0.4127197265625,-0.19140625)
+ (0.4127197265625,-0.19140625)
+ (-0.0379638671875,0.728759765625)
+ (-0.0379638671875,0.728759765625)
+ (0.09228515625,0.5811767578125)
+ (0.09228515625,0.5811767578125)
+ (-0.617919921875,-0.0762939453125)
+ (-0.617919921875,-0.0762939453125)
+ (-0.6170654296875,0.0765380859375)
+ (-0.6170654296875,0.0765380859375)
+ (0.0621337890625,-0.654296875)
+ (0.0621337890625,-0.654296875)
+ (-0.127685546875,-0.511962890625)
+ (-0.127685546875,-0.511962890625)
+ (0.843994140625,0.012451171875)
+ (0.843994140625,0.012451171875)
+ (0.29296875,-0.293212890625)
+ (0.29296875,-0.293212890625)
+ (-0.01953125,-0.8046875)
+ (-0.01953125,-0.8046875)
+ (0.654296875,0.0618896484375)
+ (0.654296875,0.0618896484375)
+ (0.3505859375,-0.239990234375)
+ (0.3505859375,-0.239990234375)
+ (-0.0279541015625,-0.7666015625)
+ (-0.0279541015625,-0.7666015625)
+ (0.805419921875,0.01953125)
+ (0.805419921875,0.01953125)
+ (0.1688232421875,-0.444580078125)
+ (0.1688232421875,-0.444580078125)
+ (-0.1910400390625,-0.4127197265625)
+ (-0.1910400390625,-0.4127197265625)
+ (-0.6912841796875,0.049072265625)
+ (-0.6912841796875,0.049072265625)
+ (0.0009765625,0.9613037109375)
+ (0.0009765625,0.9613037109375)
+ (-0.8055419921875,-0.0194091796875)
+ (-0.8055419921875,-0.0194091796875)
+ (-0.076171875,0.6177978515625)
+ (-0.076171875,0.6177978515625)
+ (0.4771728515625,0.14794921875)
+ (0.4771728515625,0.14794921875)
+ (0.2144775390625,-0.3812255859375)
+ (0.2144775390625,-0.3812255859375)
+ (-0.3214111328125,-0.2659912109375)
+ (-0.3214111328125,-0.2659912109375)
+ (-0.29296875,0.293212890625)
+ (-0.29296875,0.293212890625)
+ (0.293212890625,0.29296875)
+ (0.293212890625,0.29296875)
+ (0.265869140625,-0.3212890625)
+ (0.265869140625,-0.3212890625)
+ (-0.3814697265625,-0.2144775390625)
+ (-0.3814697265625,-0.2144775390625)
+ (-0.1480712890625,0.4774169921875)
+ (-0.1480712890625,0.4774169921875)
+ (0.617919921875,0.0760498046875)
+ (0.617919921875,0.0760498046875)
+ (0.019287109375,-0.805419921875)
+ (0.019287109375,-0.805419921875)
+ (0.961181640625,-0.0009765625)
+ (0.961181640625,-0.0009765625)
+ (-0.049072265625,-0.6915283203125)
+ (-0.049072265625,-0.6915283203125)
+ (-0.412353515625,0.19091796875)
+ (-0.412353515625,0.19091796875)
+ (0.4444580078125,0.1689453125)
+ (0.4444580078125,0.1689453125)
+ (0.019287109375,-0.805419921875)
+ (0.019287109375,-0.805419921875)
+ (0.7664794921875,-0.02783203125)
+ (0.7664794921875,-0.02783203125)
+ (-0.2401123046875,-0.3507080078125)
+ (-0.2401123046875,-0.3507080078125)
+ (-0.06201171875,0.6541748046875)
+ (-0.06201171875,0.6541748046875)
+ (-0.804443359375,0.0194091796875)
+ (-0.804443359375,0.0194091796875)
+ (0.293212890625,0.29296875)
+ (0.293212890625,0.29296875)
+ (0.012451171875,-0.843994140625)
+ (0.012451171875,-0.843994140625)
+ (0.5118408203125,-0.127685546875)
+ (0.5118408203125,-0.127685546875)
+ (-0.6541748046875,-0.062255859375)
+ (-0.6541748046875,-0.062255859375)
+ (-0.07666015625,-0.6170654296875)
+ (-0.07666015625,-0.6170654296875)
+ (-0.076171875,0.6177978515625)
+ (-0.076171875,0.6177978515625)
+ (-0.581298828125,0.0921630859375)
+ (-0.581298828125,0.0921630859375)
+ (0.7286376953125,0.037841796875)
+ (0.7286376953125,0.037841796875)
+ (0.1912841796875,0.412353515625)
+ (0.1912841796875,0.412353515625)
+ (0,-0.9996337890625)
+ (0,-0.9996337890625)
+ (0.1688232421875,-0.444580078125)
+ (0.1688232421875,-0.444580078125)
+ (0.581298828125,-0.0924072265625)
+ (0.581298828125,-0.0924072265625)
+ (-0.9212646484375,-0.003662109375)
+ (-0.9212646484375,-0.003662109375)
+ (-0.4775390625,-0.1478271484375)
+ (-0.4775390625,-0.1478271484375)
+ (-0.1688232421875,-0.4447021484375)
+ (-0.1688232421875,-0.4447021484375)
+ (-0.01953125,-0.8046875)
+ (-0.01953125,-0.8046875)
+ (-0.012451171875,0.8438720703125)
+ (-0.012451171875,0.8438720703125)
+ (-0.109375,0.5462646484375)
+ (-0.109375,0.5462646484375)
+ (-0.26611328125,0.321533203125)
+ (-0.26611328125,0.321533203125)
+ (-0.444580078125,0.1688232421875)
+ (-0.444580078125,0.1688232421875)
+ (-0.6170654296875,0.0765380859375)
+ (-0.6170654296875,0.0765380859375)
+ (-0.7666015625,0.02783203125)
+ (-0.7666015625,0.02783203125)
+ (-0.882568359375,0.00732421875)
+ (-0.882568359375,0.00732421875)
+ (-0.9613037109375,0.0010986328125)
+ (-0.9613037109375,0.0010986328125)
+ (0.9996337890625,0.000244140625)
+ (0.9996337890625,0.000244140625)
+ (0.9996337890625,0.000244140625)
+ (0.9996337890625,0.000244140625)
+ (-0.9613037109375,0.0010986328125)
+ (-0.9613037109375,0.0010986328125)
+ (-0.882568359375,0.00732421875)
+ (-0.882568359375,0.00732421875)
+ (-0.7666015625,0.02783203125)
+ (-0.7666015625,0.02783203125)
+ (-0.6170654296875,0.0765380859375)
+ (-0.6170654296875,0.0765380859375)
+ (-0.444580078125,0.1688232421875)
+ (-0.444580078125,0.1688232421875)
+ (-0.26611328125,0.321533203125)
+ (-0.26611328125,0.321533203125)
+ (-0.109375,0.5462646484375)
+ (-0.109375,0.5462646484375)
+ (-0.012451171875,0.8438720703125)
+ (-0.012451171875,0.8438720703125)
+ (-0.01953125,-0.8046875)
+ (-0.01953125,-0.8046875)
+ (-0.1688232421875,-0.4447021484375)
+ (-0.1688232421875,-0.4447021484375)
+ (-0.4775390625,-0.1478271484375)
+ (-0.4775390625,-0.1478271484375)
+ (-0.9212646484375,-0.003662109375)
+ (-0.9212646484375,-0.003662109375)
+ (0.581298828125,-0.0924072265625)
+ (0.581298828125,-0.0924072265625)
+ (0.1688232421875,-0.444580078125)
+ (0.1688232421875,-0.444580078125)
+ (0,-0.9996337890625)
+ (0,-0.9996337890625)
+ (0.1912841796875,0.412353515625)
+ (0.1912841796875,0.412353515625)
+ (0.7286376953125,0.037841796875)
+ (0.7286376953125,0.037841796875)
+ (-0.581298828125,0.0921630859375)
+ (-0.581298828125,0.0921630859375)
+ (-0.076171875,0.6177978515625)
+ (-0.076171875,0.6177978515625)
+ (-0.07666015625,-0.6170654296875)
+ (-0.07666015625,-0.6170654296875)
+ (-0.6541748046875,-0.062255859375)
+ (-0.6541748046875,-0.062255859375)
+ (0.5118408203125,-0.127685546875)
+ (0.5118408203125,-0.127685546875)
+ (0.012451171875,-0.843994140625)
+ (0.012451171875,-0.843994140625)
+ (0.293212890625,0.29296875)
+ (0.293212890625,0.29296875)
+ (-0.804443359375,0.0194091796875)
+ (-0.804443359375,0.0194091796875)
+ (-0.06201171875,0.6541748046875)
+ (-0.06201171875,0.6541748046875)
+ (-0.2401123046875,-0.3507080078125)
+ (-0.2401123046875,-0.3507080078125)
+ (0.7664794921875,-0.02783203125)
+ (0.7664794921875,-0.02783203125)
+ (0.019287109375,-0.805419921875)
+ (0.019287109375,-0.805419921875)
+ (0.4444580078125,0.1689453125)
+ (0.4444580078125,0.1689453125)
+ (-0.412353515625,0.19091796875)
+ (-0.412353515625,0.19091796875)
+ (-0.049072265625,-0.6915283203125)
+ (-0.049072265625,-0.6915283203125)
+ (0.961181640625,-0.0009765625)
+ (0.961181640625,-0.0009765625)
+ (0.019287109375,-0.805419921875)
+ (0.019287109375,-0.805419921875)
+ (0.617919921875,0.0760498046875)
+ (0.617919921875,0.0760498046875)
+ (-0.1480712890625,0.4774169921875)
+ (-0.1480712890625,0.4774169921875)
+ (-0.3814697265625,-0.2144775390625)
+ (-0.3814697265625,-0.2144775390625)
+ (0.265869140625,-0.3212890625)
+ (0.265869140625,-0.3212890625)
+ (0.293212890625,0.29296875)
+ (0.293212890625,0.29296875)
+ (-0.29296875,0.293212890625)
+ (-0.29296875,0.293212890625)
+ (-0.3214111328125,-0.2659912109375)
+ (-0.3214111328125,-0.2659912109375)
+ (0.2144775390625,-0.3812255859375)
+ (0.2144775390625,-0.3812255859375)
+ (0.4771728515625,0.14794921875)
+ (0.4771728515625,0.14794921875)
+ (-0.076171875,0.6177978515625)
+ (-0.076171875,0.6177978515625)
+ (-0.8055419921875,-0.0194091796875)
+ (-0.8055419921875,-0.0194091796875)
+ (0.0009765625,0.9613037109375)
+ (0.0009765625,0.9613037109375)
+ (-0.6912841796875,0.049072265625)
+ (-0.6912841796875,0.049072265625)
+ (-0.1910400390625,-0.4127197265625)
+ (-0.1910400390625,-0.4127197265625)
+ (0.1688232421875,-0.444580078125)
+ (0.1688232421875,-0.444580078125)
+ (0.805419921875,0.01953125)
+ (0.805419921875,0.01953125)
+ (-0.0279541015625,-0.7666015625)
+ (-0.0279541015625,-0.7666015625)
+ (0.3505859375,-0.239990234375)
+ (0.3505859375,-0.239990234375)
+ (0.654296875,0.0618896484375)
+ (0.654296875,0.0618896484375)
+ (-0.01953125,-0.8046875)
+ (-0.01953125,-0.8046875)
+ (0.29296875,-0.293212890625)
+ (0.29296875,-0.293212890625)
+ (0.843994140625,0.012451171875)
+ (0.843994140625,0.012451171875)
+ (-0.127685546875,-0.511962890625)
+ (-0.127685546875,-0.511962890625)
+ (0.0621337890625,-0.654296875)
+ (0.0621337890625,-0.654296875)
+ (-0.6170654296875,0.0765380859375)
+ (-0.6170654296875,0.0765380859375)
+ (-0.617919921875,-0.0762939453125)
+ (-0.617919921875,-0.0762939453125)
+ (0.09228515625,0.5811767578125)
+ (0.09228515625,0.5811767578125)
+ (-0.0379638671875,0.728759765625)
+ (-0.0379638671875,0.728759765625)
+ (0.4127197265625,-0.19140625)
+ (0.4127197265625,-0.19140625)
+ (0.9996337890625,0.000244140625)
+ (0.9996337890625,0.000244140625)
+ (-0.4447021484375,-0.1688232421875)
+ (-0.4447021484375,-0.1688232421875)
+ (0.09228515625,0.5811767578125)
+ (0.09228515625,0.5811767578125)
+ (-0.0032958984375,0.921142578125)
+ (-0.0032958984375,0.921142578125)
+ (0.147705078125,-0.477294921875)
+ (0.147705078125,-0.477294921875)
+ (-0.444580078125,0.1688232421875)
+ (-0.444580078125,0.1688232421875)
+ (0.8046875,-0.019775390625)
+ (0.8046875,-0.019775390625)
+ (0.843994140625,0.012451171875)
+ (0.843994140625,0.012451171875)
+ (-0.54638671875,-0.1092529296875)
+ (-0.54638671875,-0.1092529296875)
+ (0.3212890625,0.26611328125)
+ (0.3212890625,0.26611328125)
+ (-0.1688232421875,-0.4447021484375)
+ (-0.1688232421875,-0.4447021484375)
+ (0.0765380859375,0.616943359375)
+ (0.0765380859375,0.616943359375)
+ (-0.0279541015625,-0.7666015625)
+ (-0.0279541015625,-0.7666015625)
+ (0.0072021484375,0.882568359375)
+ (0.0072021484375,0.882568359375)
+ (-0.0010986328125,-0.961181640625)
+ (-0.0010986328125,-0.961181640625)

Added: 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/read_avg.m
===================================================================
--- 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/read_avg.m   
                            (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/read_avg.m   
    2007-09-28 21:38:34 UTC (rev 6562)
@@ -0,0 +1,22 @@
+function avg = read_avg(name, vlen)
+
+    f = fopen(name, "rb");
+    s = zeros(1, vlen);
+    n = 0;
+        
+    while (!feof(f))
+       t = fread(f, [2, vlen], "float");
+       if (size(t) == [2, vlen])
+          n = n+1;
+          c = t(1,:)+t(2,:)*j;
+         if (n > 10)
+             s = s+c;
+         endif
+       endif
+    endwhile
+
+    avg = s/(n-1);
+    
+    fclose(f);
+    
+endfunction

Added: 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/read_avg_sec.m
===================================================================
--- 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/read_avg_sec.m
                           (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/read_avg_sec.m
   2007-09-28 21:38:34 UTC (rev 6562)
@@ -0,0 +1,25 @@
+function avg = read_avg_sec(name, vlen)
+
+    f = fopen(name, "rb");
+    s = zeros(1, vlen);
+    n = 0;
+    m = 0;
+        
+    while (!feof(f))
+       t = fread(f, [2, vlen], "float");
+       if (size(t) == [2, vlen])
+          n = n+1;
+          c = t(1,:)+t(2,:)*j;
+          s = s+c;
+         m = m+1;        
+         if (m == 1000)
+            avg(n/1000,:) = s/1000;
+            s = zeros(1, vlen);
+            m = 0;
+         endif
+       endif
+    endwhile
+    
+    fclose(f);
+
+endfunction

Added: 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/read_echos.m
===================================================================
--- 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/read_echos.m 
                            (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/radar/gr-radar-mono/src/utils/read_echos.m 
    2007-09-28 21:38:34 UTC (rev 6562)
@@ -0,0 +1,7 @@
+# Read echos from file into array
+function echos = read_echos(filename, len, drop)
+    e = read_complex_binary(filename);
+    n = length(e)/len-drop;
+    start = drop*len+1;
+    echos = reshape(e(start:end), len, n).';
+endfunction





reply via email to

[Prev in Thread] Current Thread [Next in Thread]