[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r4094 - in gnuradio/branches/developers/n4hy/ofdm: gnu
From: |
n4hy |
Subject: |
[Commit-gnuradio] r4094 - in gnuradio/branches/developers/n4hy/ofdm: gnuradio-core/src/lib/general gnuradio-examples/python |
Date: |
Fri, 15 Dec 2006 00:20:53 -0700 (MST) |
Author: n4hy
Date: 2006-12-15 00:20:53 -0700 (Fri, 15 Dec 2006)
New Revision: 4094
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.cc
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.cc~
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.h
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.h~
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.i
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.i~
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.lo
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc~
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.h
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.h~
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.i
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.i~
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.lo
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm_test.py
Modified:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/Makefile.am
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/general.i
Log:
ofdm transmitter begun with an example block
Modified:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/Makefile.am
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/Makefile.am
2006-12-15 00:59:53 UTC (rev 4093)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/Makefile.am
2006-12-15 07:20:53 UTC (rev 4094)
@@ -162,6 +162,8 @@
gr_nop.cc \
gr_null_sink.cc \
gr_null_source.cc \
+ gr_ofdm_mapper_bcv.cc \
+ gr_ofdm_bpsk_mapper.cc \
gr_pa_2x2_phase_combiner.cc \
gr_packet_sink.cc \
gr_phase_modulator_fc.cc \
@@ -290,6 +292,8 @@
gr_nop.h \
gr_null_sink.h \
gr_null_source.h \
+ gr_ofdm_mapper_bcv.h \
+ gr_ofdm_bpsk_mapper.h \
gr_pa_2x2_phase_combiner.h \
gr_packet_sink.h \
gr_phase_modulator_fc.h \
@@ -420,6 +424,8 @@
gr_nop.i \
gr_null_sink.i \
gr_null_source.i \
+ gr_ofdm_mapper_bcv.i \
+ gr_ofdm_bpsk_mapper.i \
gr_pa_2x2_phase_combiner.i \
gr_packet_sink.i \
gr_phase_modulator_fc.i \
Modified:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/general.i
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/general.i
2006-12-15 00:59:53 UTC (rev 4093)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/general.i
2006-12-15 07:20:53 UTC (rev 4094)
@@ -91,6 +91,7 @@
#include <gr_probe_avg_mag_sqrd_c.h>
#include <gr_probe_avg_mag_sqrd_f.h>
#include <gr_probe_signal_f.h>
+#include <gr_ofdm_bpsk_mapper.h>
#include <gr_costas_loop_cc.h>
#include <gr_pa_2x2_phase_combiner.h>
#include <gr_kludge_copy.h>
@@ -159,8 +160,7 @@
%include "gr_agc_ff.i"
%include "gr_agc_cc.i"
%include "gr_agc2_ff.i"
-%include "gr_agc2_cc.i"
-%include "gr_rms_cf.i"
+%include "gr_agc2_cc.i"%include "gr_rms_cf.i"
%include "gr_rms_ff.i"
%include "gr_nlog10_ff.i"
%include "gr_fake_channel_coder_pp.i"
@@ -185,6 +185,7 @@
%include "gr_probe_avg_mag_sqrd_c.i"
%include "gr_probe_avg_mag_sqrd_f.i"
%include "gr_probe_signal_f.i"
+%include "gr_ofdm_bpsk_mapper.i"
%include "gr_costas_loop_cc.i"
%include "gr_pa_2x2_phase_combiner.i"
%include "gr_kludge_copy.i"
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.cc
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.cc
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.cc
2006-12-15 07:20:53 UTC (rev 4094)
@@ -0,0 +1,77 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gr_ofdm_bpsk_mapper.h>
+#include <gr_io_signature.h>
+#include <vector>
+
+gr_ofdm_bpsk_mapper_sptr
+gr_make_ofdm_bpsk_mapper (unsigned int bits_per_symbol, unsigned int vlen)
+{
+ return gr_ofdm_bpsk_mapper_sptr (new gr_ofdm_bpsk_mapper (bits_per_symbol,
vlen));
+}
+
+gr_ofdm_bpsk_mapper::gr_ofdm_bpsk_mapper (unsigned bits_per_symbol,unsigned
int vlen)
+ : gr_sync_decimator ("ofdm_bpsk_mapper",
+ gr_make_io_signature (1, 1, sizeof(unsigned char)),
+ gr_make_io_signature (1, 1, sizeof(gr_complex)*vlen),
+ bits_per_symbol),
+ d_bits_per_symbol(bits_per_symbol),
+ d_vlen(vlen)
+{
+}
+
+gr_ofdm_bpsk_mapper::~gr_ofdm_bpsk_mapper(void)
+{
+}
+
+int
+gr_ofdm_bpsk_mapper::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+
+ const unsigned char *in = (const unsigned char *) input_items[0];
+
+ gr_complex *out = (gr_complex *)output_items[0];
+
+ unsigned int left = (d_vlen - d_bits_per_symbol)/2;
+ unsigned int right = d_vlen - d_bits_per_symbol-left;
+ unsigned int i;
+
+ for(i=0;i<ceil(d_bits_per_symbol/2);i++) {
+ unsigned int k=ceil(d_bits_per_symbol/2);
+ out[i] = gr_complex(-1+2*in[i+k],0);
+ }
+ for(;i<d_vlen - floor(d_bits_per_symbol/2);i++) {
+ out[i]=gr_complex(0,0);
+ }
+ for(unsigned int j=0;i<d_vlen;i++,j++) {
+ out[i]= gr_complex((-1+2*in[j]),0);
+ }
+
+ return 1;
+}
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.cc~
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.cc~
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.cc~
2006-12-15 07:20:53 UTC (rev 4094)
@@ -0,0 +1,21 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004,2005 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.h
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.h
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.h
2006-12-15 07:20:53 UTC (rev 4094)
@@ -0,0 +1,62 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_GR_OFDM_BPSK_MAPPER_H
+#define INCLUDED_GR_OFDM_BPSK_MAPPER_H
+
+
+#include <gr_sync_decimator.h>
+
+class gr_ofdm_bpsk_mapper;
+typedef boost::shared_ptr<gr_ofdm_bpsk_mapper> gr_ofdm_bpsk_mapper_sptr;
+
+gr_ofdm_bpsk_mapper_sptr
+gr_make_ofdm_bpsk_mapper (unsigned int bits_per_symbol, unsigned int vlen);
+
+
+/*!
+ * \brief take a stream of bytes in and map to a vector of complex
+ * constellation points suitable for IFFT input to be used in an ofdm
+ * modulator. Simple BPSK version.
+ */
+
+class gr_ofdm_bpsk_mapper : public gr_sync_decimator
+{
+ friend gr_ofdm_bpsk_mapper_sptr
+ gr_make_ofdm_bpsk_mapper (unsigned int bits_per_symbol, unsigned int vlen);
+
+ protected:
+ gr_ofdm_bpsk_mapper (unsigned int bits_per_symbol, unsigned int vlen);
+
+ private:
+ unsigned int d_bits_per_symbol;
+ unsigned int d_vlen;
+
+ public:
+ ~gr_ofdm_bpsk_mapper(void);
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_times,
+ gr_vector_void_star &output_items);
+};
+
+
+#endif
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.h~
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.h~
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.h~
2006-12-15 07:20:53 UTC (rev 4094)
@@ -0,0 +1,21 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004,2005 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.i
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.i
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.i
2006-12-15 07:20:53 UTC (rev 4094)
@@ -0,0 +1,40 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004,2006 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+GR_SWIG_BLOCK_MAGIC(gr,ofdm_bpsk_mapper)
+
+gr_ofdm_bpsk_mapper_sptr
+gr_make_ofdm_bpsk_mapper (unsigned int bits_per_symbol,
+ unsigned int vlen);
+
+class gr_ofdm_bpsk_mapper : public gr_sync_decimator
+{
+ protected:
+ gr_ofdm_bpsk_mapper (unsigned int bits_per_symbol,
+ unsigned int vlen);
+
+ public:
+ int work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+
+};
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.i~
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.i~
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.i~
2006-12-15 07:20:53 UTC (rev 4094)
@@ -0,0 +1,34 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004,2006 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+GR_SWIG_BLOCK_MAGIC(gr,ofdm_mapper_bcv)
+
+gr_ofdm_mapper_bcv_sptr
+gr_make_ofdm_mapper_bcv (size_t itemsize, size_t nitems_per_block);
+
+class gr_ofdm_mapper_bcv : public gr_sync_decimator
+{
+ protected:
+ gr_ofdm_mapper_bcv (size_t itemsize, size_t nitems_per_block);
+
+ public:
+};
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.lo
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.lo
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_bpsk_mapper.lo
2006-12-15 07:20:53 UTC (rev 4094)
@@ -0,0 +1,12 @@
+# gr_ofdm_bpsk_mapper.lo - a libtool object file
+# Generated by ltmain.sh - GNU libtool 1.5.22 Debian 1.5.22-4 (1.1220.2.365
2005/12/18 22:14:06)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/gr_ofdm_bpsk_mapper.o'
+
+# Name of the non-PIC object.
+non_pic_object=none
+
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
2006-12-15 07:20:53 UTC (rev 4094)
@@ -0,0 +1,41 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004,2005 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gr_ofdm_mapper_bcv.h>
+#include <gr_io_signature.h>
+
+gr_ofdm_mapper_bcv::~gr_ofdm_mapper_bcv(void)
+{
+}
+
+gr_ofdm_mapper_bcv::gr_ofdm_mapper_bcv (unsigned bits_per_symbol,unsigned int
vlen)
+ : gr_sync_decimator ("ofdm_mapper_bcv",
+ gr_make_io_signature (1, 1, sizeof(unsigned char)),
+ gr_make_io_signature (1, 1, sizeof(gr_complex)*vlen),
+ bits_per_symbol)
+{
+}
+
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc~
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc~
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc~
2006-12-15 07:20:53 UTC (rev 4094)
@@ -0,0 +1,57 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004,2005 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gr_ofdm_mapper_bcv.h>
+#include <gr_io_signature.h>
+
+gr_ofdm_mapper_bcv_sptr
+gr_make_ofdm_mapper_bcv (size_t item_size, size_t nitems_per_block)
+{
+ return gr_ofdm_mapper_bcv_sptr (new gr_ofdm_mapper_bcv (item_size,
nitems_per_block));
+}
+
+gr_ofdm_mapper_bcv::gr_ofdm_mapper_bcv (size_t item_size, size_t
nitems_per_block)
+ : gr_sync_decimator ("ofdm_mapper_bcv",
+ gr_make_io_signature (1, 1, item_size),
+ gr_make_io_signature (1, 1, item_size *
nitems_per_block),
+ nitems_per_block)
+{
+}
+
+int
+gr_ofdm_mapper_bcv::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ size_t block_size = output_signature()->sizeof_stream_item (0);
+
+ const char *in = (const char *) input_items[0];
+ char *out = (char *) output_items[0];
+
+ memcpy (out, in, noutput_items * block_size);
+
+ return noutput_items;
+}
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.h
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.h
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.h
2006-12-15 07:20:53 UTC (rev 4094)
@@ -0,0 +1,56 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_GR_OFDM_MAPPER_BCV_H
+#define INCLUDED_GR_OFDM_MAPPER_BCV_H
+
+#include <gr_sync_decimator.h>
+
+class gr_ofdm_mapper_bcv;
+typedef boost::shared_ptr<gr_ofdm_mapper_bcv> gr_ofdm_mapper_bcv_sptr;
+
+gr_ofdm_mapper_bcv_sptr
+gr_make_ofdm_mapper_bcv (unsigned int bits_per_symbol, unsigned int vlen);
+
+
+/*!
+ * \brief take a stream of bytes in and map to a vector of complex
+ * constellation points suitable for IFFT input to be used in an ofdm
+ * modulator. Abstract class must be subclassed with specific mapping.
+ *
+ */
+
+class gr_ofdm_mapper_bcv : public gr_sync_decimator
+{
+ friend gr_ofdm_mapper_bcv_sptr
+ gr_make_ofdm_mapper_bcv (unsigned int bits_per_symbol, unsigned int vlen);
+
+protected:
+ gr_ofdm_mapper_bcv (unsigned int bits_per_symbol, unsigned int vlen);
+
+public:
+ ~gr_ofdm_mapper_bcv(void);
+};
+
+
+
+#endif
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.h~
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.h~
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.h~
2006-12-15 07:20:53 UTC (rev 4094)
@@ -0,0 +1,28 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_GR_OFDM_MAPPER_BCV_H
+#define INCLUDED_GR_OFDM_MAPPER_BCV_H
+
+
+
+#endif
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.i
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.i
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.i
2006-12-15 07:20:53 UTC (rev 4094)
@@ -0,0 +1,36 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004,2006 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+GR_SWIG_BLOCK_MAGIC(gr,ofdm_mapper_bcv)
+
+gr_ofdm_mapper_bcv_sptr
+gr_make_ofdm_mapper_bcv (unsigned int bits_per_symbol,
+ unsigned int vlen);
+
+class gr_ofdm_mapper_bcv : public gr_sync_decimator
+{
+ protected:
+ gr_ofdm_mapper_bcv (unsigned int bits_per_symbol,
+ unsigned int vlen);
+
+ public:
+};
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.i~
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.i~
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.i~
2006-12-15 07:20:53 UTC (rev 4094)
@@ -0,0 +1,34 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004,2006 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+GR_SWIG_BLOCK_MAGIC(gr,ofdm_mapper_bcv)
+
+gr_ofdm_mapper_bcv_sptr
+gr_make_ofdm_mapper_bcv (size_t itemsize, size_t nitems_per_block);
+
+class gr_ofdm_mapper_bcv : public gr_sync_decimator
+{
+ protected:
+ gr_ofdm_mapper_bcv (size_t itemsize, size_t nitems_per_block);
+
+ public:
+};
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.lo
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.lo
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.lo
2006-12-15 07:20:53 UTC (rev 4094)
@@ -0,0 +1,12 @@
+# gr_ofdm_mapper_bcv.lo - a libtool object file
+# Generated by ltmain.sh - GNU libtool 1.5.22 Debian 1.5.22-4 (1.1220.2.365
2005/12/18 22:14:06)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/gr_ofdm_mapper_bcv.o'
+
+# Name of the non-PIC object.
+non_pic_object=none
+
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm_test.py
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm_test.py
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm_test.py
2006-12-15 07:20:53 UTC (rev 4094)
@@ -0,0 +1,144 @@
+#!/usr/bin/env python
+#
+# Copyright 2004,2005 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr, gru
+from gnuradio import eng_notation
+from gnuradio.eng_option import eng_option
+from gnuradio.wxgui import stdgui, fftsink, waterfallsink, scopesink, form,
slider
+from optparse import OptionParser
+import wx
+import os, sys, random
+
+
+class app_flow_graph(stdgui.gui_flow_graph):
+ def __init__(self, frame, panel, vbox, argv):
+ stdgui.gui_flow_graph.__init__(self)
+
+ self.frame = frame
+ self.panel = panel
+
+ parser = OptionParser(option_class=eng_option)
+ parser.add_option("-W", "--waterfall", action="store_true",
default=False,
+ help="Enable waterfall display")
+ parser.add_option("-S", "--oscilloscope", action="store_true",
default=False,
+ help="Enable oscilloscope display")
+ parser.add_option("-I", "--audio-input", type="string", default="",
+ help="pcm input device name. E.g., hw:0,0 or
/dev/dsp")
+ parser.add_option("-r", "--sample-rate", type="eng_float",
default=48000,
+ help="set sample rate to RATE (48000)")
+
+ (options, args) = parser.parse_args()
+ sample_rate = int(options.sample_rate)
+
+ if len(args) != 0:
+ parser.print_help()
+ sys.exit(1)
+
+ self.show_debug_info = True
+
+ #build the graph
+ if options.waterfall:
+ self.scope = \
+ waterfallsink.waterfall_sink_c (self, panel, fft_size=1024,
sample_rate=sample_rate)
+ elif options.oscilloscope:
+ self.scope = scopesink.scope_sink_f(self, panel,
sample_rate=sample_rate)
+ else:
+ self.scope = fftsink.fft_sink_c (self, panel, fft_size=1024,
sample_rate=sample_rate, fft_rate=30)
+
+ win = [1 for i in range(128)]
+ data = [random.randint(0,1) for i in range(1000)]
+ self.src = gr.vector_source_b(data, True)
+
+ self.ofdm = gr.ofdm_bpsk_mapper(70, 128)
+ self.ifft = gr.fft_vcc(128, False, win)
+ self.v2s = gr.vector_to_stream(gr.sizeof_gr_complex,128)
+ self.nullsink = gr.null_sink(gr.sizeof_gr_complex)
+ self.connect(self.src, self.ofdm, self.ifft, self.v2s, self.scope)
+
+ self._build_gui(vbox)
+
+ # set initial values
+
+ def _set_status_msg(self, msg):
+ self.frame.GetStatusBar().SetStatusText(msg, 0)
+
+ def _build_gui(self, vbox):
+
+ def _form_set_freq(kv):
+ return self.set_freq(kv['freq'])
+
+ vbox.Add(self.scope.win, 10, wx.EXPAND)
+
+ #self._build_subpanel(vbox)
+
+ def _build_subpanel(self, vbox_arg):
+ # build a secondary information panel (sometimes hidden)
+
+ # FIXME figure out how to have this be a subpanel that is always
+ # created, but has its visibility controlled by foo.Show(True/False)
+
+ def _form_set_decim(kv):
+ return self.set_decim(kv['decim'])
+
+ if not(self.show_debug_info):
+ return
+
+ panel = self.panel
+ vbox = vbox_arg
+ myform = self.myform
+
+ #panel = wx.Panel(self.panel, -1)
+ #vbox = wx.BoxSizer(wx.VERTICAL)
+
+ hbox = wx.BoxSizer(wx.HORIZONTAL)
+ hbox.Add((5,0), 0)
+
+ myform['decim'] = form.int_field(
+ parent=panel, sizer=hbox, label="Decim",
+ callback=myform.check_input_and_call(_form_set_decim,
self._set_status_msg))
+
+ hbox.Add((5,0), 1)
+ myform['address@hidden'] = form.static_float_field(
+ parent=panel, sizer=hbox, label="address@hidden")
+
+ hbox.Add((5,0), 1)
+ myform['dbname'] = form.static_text_field(
+ parent=panel, sizer=hbox)
+
+ hbox.Add((5,0), 1)
+ myform['baseband'] = form.static_float_field(
+ parent=panel, sizer=hbox, label="Analog BB")
+
+ hbox.Add((5,0), 1)
+ myform['ddc'] = form.static_float_field(
+ parent=panel, sizer=hbox, label="DDC")
+
+ hbox.Add((5,0), 0)
+ vbox.Add(hbox, 0, wx.EXPAND)
+
+
+def main ():
+ app = stdgui.stdapp(app_flow_graph, "Audio FFT", nstatus=1)
+ app.MainLoop()
+
+if __name__ == '__main__':
+ main ()
Property changes on:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm_test.py
___________________________________________________________________
Name: svn:executable
+ *
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r4094 - in gnuradio/branches/developers/n4hy/ofdm: gnuradio-core/src/lib/general gnuradio-examples/python,
n4hy <=