[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r5758 - in gnuradio/branches/features/ofdm/sync: gnura
From: |
trondeau |
Subject: |
[Commit-gnuradio] r5758 - in gnuradio/branches/features/ofdm/sync: gnuradio-core/src/lib/general gnuradio-examples/python/ofdm |
Date: |
Sun, 10 Jun 2007 11:39:10 -0600 (MDT) |
Author: trondeau
Date: 2007-06-10 11:39:10 -0600 (Sun, 10 Jun 2007)
New Revision: 5758
Modified:
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_ofdm_correlator.cc
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
gnuradio/branches/features/ofdm/sync/gnuradio-examples/python/ofdm/benchmark_ofdm.py
gnuradio/branches/features/ofdm/sync/gnuradio-examples/python/ofdm/benchmark_ofdm_rx.py
gnuradio/branches/features/ofdm/sync/gnuradio-examples/python/ofdm/benchmark_ofdm_tx.py
Log:
clean up to prep for merge
Modified:
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_ofdm_correlator.cc
===================================================================
---
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_ofdm_correlator.cc
2007-06-10 07:59:48 UTC (rev 5757)
+++
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_ofdm_correlator.cc
2007-06-10 17:39:10 UTC (rev 5758)
@@ -149,8 +149,11 @@
d_snr_est = 10*log10(fabs(h_sqrd.real()/h_sqrd.imag()));
}
+#if VERBOSE
printf("CORR: Found, bin %d\tSNR Est %f dB\tcorr power fraction %f\n",
search_delta, d_snr_est, h_sqrd.real()/power);
+#endif
+
//
search_delta,10*log10(h_sqrd.real()/fabs(h_sqrd.imag())),h_sqrd.real()/power);
break;
}
@@ -178,10 +181,6 @@
d_hestimate[i] = 0.5F * (d_known_symbol1[i] /
previous[i+zeros_on_left+d_coarse_freq] +
d_known_symbol2[i] /
(coarse_freq_comp(d_coarse_freq,1)*
current[i+zeros_on_left+d_coarse_freq]));
-
-#if VERBOSE
- fprintf(stderr, "%f %f ", d_hestimate[i].real(), d_hestimate[i].imag());
-#endif
}
#if VERBOSE
fprintf(stderr, "\n");
Modified:
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
===================================================================
---
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
2007-06-10 07:59:48 UTC (rev 5757)
+++
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
2007-06-10 17:39:10 UTC (rev 5758)
@@ -196,12 +196,13 @@
break;
case STATE_HAVE_SYNC:
- if(sig[0])
- printf("ERROR -- Found SYNC in HAVE_SYNC\n");
- if (VERBOSE)
+ if (VERBOSE) {
+ if(sig[0])
+ printf("ERROR -- Found SYNC in HAVE_SYNC\n");
fprintf(stderr,"Header Search bitcnt=%d, header=0x%08x\n",
d_headerbytelen_cnt, d_header);
-
+ }
+
j = 0;
while(j < bytes) {
d_header = (d_header << 8) | (d_bytes_out[j] & 0xFF);
@@ -215,11 +216,10 @@
// we have a full header, check to see if it has been received properly
if (header_ok()){
enter_have_header();
- printf("\nPacket Length: %d\n", d_packetlen);
- //for(int k=0; k < d_packetlen; k++)
- // printf("%02x", d_packet[k]);
- //printf("\n");
+ if (VERBOSE)
+ printf("\nPacket Length: %d\n", d_packetlen);
+
while((j < bytes) && (d_packetlen_cnt < d_packetlen)) {
d_packet[d_packetlen_cnt++] = d_bytes_out[j++];
}
@@ -242,10 +242,11 @@
break;
case STATE_HAVE_HEADER:
- if(sig[0])
- printf("ERROR -- Found SYNC in HAVE_HEADER at %d, length of %d\n",
d_packetlen_cnt, d_packetlen);
- if (VERBOSE)
- fprintf(stderr,"Packet Build\n");
+ if (VERBOSE) {
+ if(sig[0])
+ printf("ERROR -- Found SYNC in HAVE_HEADER at %d, length of %d\n",
d_packetlen_cnt, d_packetlen);
+ fprintf(stderr,"Packet Build\n");
+ }
j = 0;
while(j < bytes) {
Modified:
gnuradio/branches/features/ofdm/sync/gnuradio-examples/python/ofdm/benchmark_ofdm.py
===================================================================
---
gnuradio/branches/features/ofdm/sync/gnuradio-examples/python/ofdm/benchmark_ofdm.py
2007-06-10 07:59:48 UTC (rev 5757)
+++
gnuradio/branches/features/ofdm/sync/gnuradio-examples/python/ofdm/benchmark_ofdm.py
2007-06-10 17:39:10 UTC (rev 5758)
@@ -76,10 +76,11 @@
self.connect(self.zeros, (self.mux,0))
self.connect(self.txpath, (self.mux,1))
self.connect(self.mux, self.throttle, self.channel, self.rxpath)
-
- self.connect(self.txpath, gr.file_sink(gr.sizeof_gr_complex,
"txpath.dat"))
- self.connect(self.mux, gr.file_sink(gr.sizeof_gr_complex, "mux.dat"))
- self.connect(self.channel, gr.file_sink(gr.sizeof_gr_complex,
"channel.dat"))
+
+ if options.log:
+ self.connect(self.txpath, gr.file_sink(gr.sizeof_gr_complex,
"txpath.dat"))
+ self.connect(self.mux, gr.file_sink(gr.sizeof_gr_complex,
"mux.dat"))
+ self.connect(self.channel, gr.file_sink(gr.sizeof_gr_complex,
"channel.dat"))
# /////////////////////////////////////////////////////////////////////////////
# main
@@ -120,7 +121,7 @@
parser.add_option("-M", "--megabytes", type="eng_float", default=1.0,
help="set megabytes to transmit [default=%default]")
parser.add_option("-r", "--sample-rate", type="eng_float", default=1e5,
- help="set sample rate to RATE (%default)")
+ help="limit sample rate to RATE in throttle (%default)")
parser.add_option("", "--snr", type="eng_float", default=30,
help="set the SNR of the channel in dB
[default=%default]")
parser.add_option("", "--frequency-offset", type="eng_float", default=0,
Modified:
gnuradio/branches/features/ofdm/sync/gnuradio-examples/python/ofdm/benchmark_ofdm_rx.py
===================================================================
---
gnuradio/branches/features/ofdm/sync/gnuradio-examples/python/ofdm/benchmark_ofdm_rx.py
2007-06-10 07:59:48 UTC (rev 5757)
+++
gnuradio/branches/features/ofdm/sync/gnuradio-examples/python/ofdm/benchmark_ofdm_rx.py
2007-06-10 17:39:10 UTC (rev 5758)
@@ -20,14 +20,13 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, modulation_utils
+from gnuradio import gr, blks
from gnuradio import usrp
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from optparse import OptionParser
-from gnuradio.blksimpl import ofdm_pkt
-import random, time, struct, sys, math
+import random, time, struct, sys
# from current dir
from receive_path import receive_path
@@ -185,17 +184,13 @@
parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
expert_grp = parser.add_option_group("Expert")
- parser.add_option("-r", "--sample-rate", type="eng_float", default=1e5,
- help="set sample rate to RATE (%default)")
- parser.add_option("", "--snr", type="eng_float", default=30,
- help="set the SNR of the channel in dB
[default=%default]")
parser.add_option("","--discontinuous", action="store_true", default=False,
help="enable discontinuous")
usrp_graph.add_options(parser, expert_grp)
receive_path.add_options(parser, expert_grp)
- ofdm_pkt.mod_ofdm_pkts.add_options(parser, expert_grp)
- ofdm_pkt.demod_ofdm_pkts.add_options(parser, expert_grp)
+ blks.ofdm_mod.add_options(parser, expert_grp)
+ blks.ofdm_demod.add_options(parser, expert_grp)
fusb_options.add_options(expert_grp)
(options, args) = parser.parse_args ()
Modified:
gnuradio/branches/features/ofdm/sync/gnuradio-examples/python/ofdm/benchmark_ofdm_tx.py
===================================================================
---
gnuradio/branches/features/ofdm/sync/gnuradio-examples/python/ofdm/benchmark_ofdm_tx.py
2007-06-10 07:59:48 UTC (rev 5757)
+++
gnuradio/branches/features/ofdm/sync/gnuradio-examples/python/ofdm/benchmark_ofdm_tx.py
2007-06-10 17:39:10 UTC (rev 5758)
@@ -20,18 +20,17 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, modulation_utils
+from gnuradio import gr, blks
from gnuradio import usrp
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from optparse import OptionParser
-import random, time, struct, sys, math
+import time, struct, sys
# from current dir
from transmit_path import transmit_path
from pick_bitrate import pick_tx_bitrate
-from gnuradio.blksimpl import ofdm_pkt
import fusb_options
class usrp_graph(gr.flow_graph):
@@ -40,7 +39,6 @@
self._tx_freq = options.tx_freq # tranmitter's
center frequency
self._tx_subdev_spec = options.tx_subdev_spec # daughterboard to
use
- self._bitrate = options.bitrate # desired bit rate
self._interp = options.interp # interpolating
rate for the USRP (prelim)
self._fusb_block_size = options.fusb_block_size # usb info for USRP
self._fusb_nblocks = options.fusb_nblocks # usb info for USRP
@@ -127,15 +125,10 @@
Adds usrp-specific options to the Options Parser
"""
add_freq_option(normal)
- if not normal.has_option('--bitrate'):
- normal.add_option("-r", "--bitrate", type="eng_float",
default=None,
- help="specify bitrate. samples-per-symbol and
interp/decim will be derived.")
normal.add_option("-T", "--tx-subdev-spec", type="subdev",
default=None,
help="select USRP Tx side A or B")
normal.add_option("-v", "--verbose", action="store_true",
default=False)
- expert.add_option("-S", "--samples-per-symbol", type="int",
default=None,
- help="set samples/symbol [default=%default]")
expert.add_option("", "--tx-freq", type="eng_float", default=None,
help="set transmit frequency to FREQ
[default=%default]", metavar="FREQ")
expert.add_option("-i", "--interp", type="intx", default=64,
@@ -182,17 +175,13 @@
help="set packet size [default=%default]")
parser.add_option("-M", "--megabytes", type="eng_float", default=1.0,
help="set megabytes to transmit [default=%default]")
- parser.add_option("-r", "--sample-rate", type="eng_float", default=1e5,
- help="set sample rate to RATE (%default)")
- parser.add_option("", "--snr", type="eng_float", default=30,
- help="set the SNR of the channel in dB
[default=%default]")
parser.add_option("","--discontinuous", action="store_true", default=False,
help="enable discontinuous mode")
usrp_graph.add_options(parser, expert_grp)
transmit_path.add_options(parser, expert_grp)
- ofdm_pkt.mod_ofdm_pkts.add_options(parser, expert_grp)
- ofdm_pkt.demod_ofdm_pkts.add_options(parser, expert_grp)
+ blks.ofdm_mod.add_options(parser, expert_grp)
+ blks.ofdm_demod.add_options(parser, expert_grp)
fusb_options.add_options(expert_grp)
(options, args) = parser.parse_args ()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r5758 - in gnuradio/branches/features/ofdm/sync: gnuradio-core/src/lib/general gnuradio-examples/python/ofdm,
trondeau <=