receiver: Added resamp_rate parameter

Change-Id: Iaffbe8fc28be9a70fbf8fa1689687fbd171f6b0e
This commit is contained in:
Piotr Krysik 2019-07-16 13:39:39 +02:00
parent f11e31dba1
commit cd69577a40
5 changed files with 52 additions and 12 deletions

View File

@ -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>
@ -28,6 +28,14 @@
<hide>part</hide>
</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>
@ -36,7 +44,7 @@
<hide>part</hide>
</param>
<check>$num_streams &gt;= 0</check>
<sink>
<name>in</name>
<type>complex</type>

View File

@ -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>
@ -28,6 +28,14 @@
<hide>part</hide>
</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>

View File

@ -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;

View File

@ -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)),

View File

@ -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);