[USRP-users] Keep One in N

Zhihong Luo zhluo at umich.edu
Tue Mar 29 18:24:06 EDT 2016


Johathon,

Thanks for the prompt reply. The keep-one-in-n-vec.v is using a counter,
can't I use it after removing tlast on the if?

Thanks,
Zhihong

2016年3月29日星期二,Jonathon Pendlum <jonathon.pendlum at ettus.com> 写道:

> Hi Zhihong,
>
> Removing tlast is not the approach you want. To make a block that keeps
> one sample in n would require some thought depending on what you want to
> accomplish. If you just want to decimate after a filter, the easiest
> approach would be to use a counter to "sample" the filter's output stream
> every n words.
>
>
> Jonathon
>
> On Tue, Mar 29, 2016 at 2:52 PM, Zhihong Luo <zhluo at umich.edu> wrote:
>
>> Hi Jonathon,
>>
>> I realized the reason after noticing the i_tlast on the if condition,
>> thanks for pointing it out.
>>
>> But I may need sample based keep one in n. Can I do it by simply removing
>> the i_tlast? Is there some potential issues that I overlook?
>>
>> Thanks,
>> Zhihong
>>
>>
>>
>>
>>
>>
>> On Mon, Mar 28, 2016 at 12:45 PM, Jonathon Pendlum <
>> jonathon.pendlum at ettus.com> wrote:
>>
>>> Hi Zhihong,
>>>
>>> The keep one in n block drops packets and not individual samples. So in
>>> other words, if N=2 it will drop every other packet, not every other sample.
>>>
>>>
>>>
>>> Jonathon
>>>
>>> On Sat, Mar 26, 2016 at 10:44 PM, Zhihong Luo via USRP-users <
>>> usrp-users at lists.ettus.com> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I tried to use the RFNoC FIR filter and Keep One in N blocks to
>>>> decimate my received signal. The FIR filter worked fine, but the Keep One
>>>> in N block did not work as I expected. When capturing a square signal, with
>>>> and without the Keep One in N block, the received sample number of the high
>>>> period remained unchanged. I wonder whether I made a mistake in my code:
>>>>
>>>>  uhd::rfnoc::block_id_t fir_ctrl_id(0, "FIR", 0);
>>>>  uhd::rfnoc::block_id_t keep_n_id(0,"KeepOneInN",0);
>>>>
>>>>  uhd::rfnoc::fir_block_ctrl::sptr fir_ctrl =
>>>> usrp->get_device3()->find_block_ctrl<uhd::rfnoc::fir_block_ctrl>(fir_ctrl_id);
>>>>
>>>> uhd::rfnoc::block_ctrl_base::sptr
>>>> keep_n_ctrl=usrp->get_device3()->find_block_ctrl(keep_n_id);
>>>>
>>>>  fir_ctrl->set_args(uhd::device_addr_t(streamargs)); //streamargs is an
>>>> empty string
>>>>
>>>>  usrp->get_device3()->get_block_ctrl(radio_ctrl_id)->set_args(streamargs);
>>>>  keep_n_ctrl->set_args(uhd::device_addr_t(streamargs));
>>>>
>>>>  fir_ctrl->set_taps(taps);
>>>>  keep_n_ctrl->sr_write("SR_N", 16); // downsampling by 16 times
>>>>
>>>> usrp->connect(radio_ctrl_id, fir_ctrl->get_block_id());
>>>> usrp->connect(fir_ctrl->get_block_id(),  keep_n_ctrl->get_block_id());
>>>>
>>>> usrp->set_rx_channel(keep_n_ctrl->get_block_id());
>>>>
>>>> Thanks in advance for providing any help :)
>>>>
>>>> Zhihong
>>>>
>>>> _______________________________________________
>>>> USRP-users mailing list
>>>> USRP-users at lists.ettus.com
>>>> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20160329/fd8e356a/attachment-0002.html>


More information about the USRP-users mailing list