aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Krysik <ptrkrysik@gmail.com>2019-07-16 13:39:39 +0200
committerPiotr Krysik <ptrkrysik@gmail.com>2019-07-18 10:33:16 +0200
commitcd69577a405160b8de5d15add39121121897bf21 (patch)
tree4cf5f19ee6277cc44abdc5f77400297b904d45a7
parentf11e31dba19888eeb58c76ec0bcbea09b63528de (diff)
receiver: Added resamp_rate parameter
-rw-r--r--grc/receiver/gsm_receiver.xml12
-rw-r--r--grc/receiver/gsm_receiver_with_uplink.xml10
-rw-r--r--include/grgsm/receiver/receiver.h8
-rw-r--r--lib/receiver/receiver_impl.cc26
-rw-r--r--lib/receiver/receiver_impl.h8
5 files changed, 52 insertions, 12 deletions
diff --git a/grc/receiver/gsm_receiver.xml b/grc/receiver/gsm_receiver.xml
index 2988243..bfa0b26 100644
--- a/grc/receiver/gsm_receiver.xml
+++ b/grc/receiver/gsm_receiver.xml
@@ -3,7 +3,7 @@
<name>GSM Receiver</name>
<key>gsm_receiver</key>
<import>import grgsm</import>
- <make>grgsm.receiver($osr, $cell_allocation, $tseq_nums, False)</make>
+ <make>grgsm.receiver($osr, $cell_allocation, $tseq_nums, $resamp_rate, False)</make>
<param>
<name>Oversampling ratio</name>
@@ -29,6 +29,14 @@
</param>
<param>
+ <name>Resamp rate</name>
+ <key>resamp_rate</key>
+ <value>1.0</value>
+ <type>float</type>
+ <hide>part</hide>
+ </param>
+
+ <param>
<name>Num Streams</name>
<key>num_streams</key>
<value>1</value>
@@ -36,7 +44,7 @@
<hide>part</hide>
</param>
<check>$num_streams &gt;= 0</check>
-
+
<sink>
<name>in</name>
<type>complex</type>
diff --git a/grc/receiver/gsm_receiver_with_uplink.xml b/grc/receiver/gsm_receiver_with_uplink.xml
index 4b68336..899272c 100644
--- a/grc/receiver/gsm_receiver_with_uplink.xml
+++ b/grc/receiver/gsm_receiver_with_uplink.xml
@@ -3,7 +3,7 @@
<name>GSM Receiver (with uplink)</name>
<key>gsm_receiver_with_uplink</key>
<import>import grgsm</import>
- <make>grgsm.receiver($osr, $cell_allocation, $tseq_nums, True)</make>
+ <make>grgsm.receiver($osr, $cell_allocation, $tseq_nums, $resamp_rate, True)</make>
<param>
<name>Oversampling ratio</name>
@@ -29,6 +29,14 @@
</param>
<param>
+ <name>Resamp rate</name>
+ <key>resamp_rate</key>
+ <value>1.0</value>
+ <type>float</type>
+ <hide>part</hide>
+ </param>
+
+ <param>
<name>Num Streams</name>
<key>num_streams</key>
<value>1</value>
diff --git a/include/grgsm/receiver/receiver.h b/include/grgsm/receiver/receiver.h
index dbbe327..f892392 100644
--- a/include/grgsm/receiver/receiver.h
+++ b/include/grgsm/receiver/receiver.h
@@ -50,7 +50,13 @@ namespace gr {
* class. gsm::receiver::make is the public interface for
* creating new instances.
*/
- static sptr make(int osr, const std::vector<int> &cell_allocation, const std::vector<int> &seq_nums, bool process_uplink=false);
+ static sptr make(
+ int osr,
+ const std::vector<int> &cell_allocation,
+ const std::vector<int> &tseq_nums,
+ double resamp_rate=1,
+ bool process_uplink=false
+ );
virtual void set_cell_allocation(const std::vector<int> &cell_allocation) = 0;
virtual void set_tseq_nums(const std::vector<int> & tseq_nums) = 0;
diff --git a/lib/receiver/receiver_impl.cc b/lib/receiver/receiver_impl.cc
index ffaf9ee..4570b96 100644
--- a/lib/receiver/receiver_impl.cc
+++ b/lib/receiver/receiver_impl.cc
@@ -58,18 +58,30 @@ namespace gr
/* The public constructor */
receiver::sptr
receiver::make(
- int osr, const std::vector<int> &cell_allocation,
- const std::vector<int> &tseq_nums, bool process_uplink)
+ int osr,
+ const std::vector<int> &cell_allocation,
+ const std::vector<int> &tseq_nums,
+ double resamp_rate,
+ bool process_uplink
+ )
{
- return gnuradio::get_initial_sptr
- (new receiver_impl(osr, cell_allocation,
- tseq_nums, process_uplink));
+ return gnuradio::get_initial_sptr(
+ new receiver_impl(
+ osr,
+ cell_allocation,
+ tseq_nums,
+ resamp_rate,
+ process_uplink)
+ );
}
/* The private constructor */
receiver_impl::receiver_impl(
- int osr, const std::vector<int> &cell_allocation,
- const std::vector<int> &tseq_nums, bool process_uplink
+ int osr,
+ const std::vector<int> &cell_allocation,
+ const std::vector<int> &tseq_nums,
+ double resamp_rate,
+ bool process_uplink
) : gr::sync_block("receiver",
gr::io_signature::make(1, -1, sizeof(gr_complex)),
gr::io_signature::make(0, 0, 0)),
diff --git a/lib/receiver/receiver_impl.h b/lib/receiver/receiver_impl.h
index b880837..8714d52 100644
--- a/lib/receiver/receiver_impl.h
+++ b/lib/receiver/receiver_impl.h
@@ -213,7 +213,13 @@ namespace gr {
gr_vector_const_void_star &input_items, int noutput_items);
public:
- receiver_impl(int osr, const std::vector<int> &cell_allocation, const std::vector<int> &tseq_nums, bool process_uplink);
+ receiver_impl(
+ int osr,
+ const std::vector<int> &cell_allocation,
+ const std::vector<int> &tseq_nums,
+ double resamp_rate,
+ bool process_uplink
+ );
~receiver_impl();
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);