discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] USRP Sampling


From: Prateek Dayal
Subject: Re: [Discuss-gnuradio] USRP Sampling
Date: Thu, 31 Mar 2005 13:17:58 +0000

Hi,

I have a query pertaining to the decimation done in USRP. In this
decimation is an IIR filter applied at any step ? I am asking this because
there may be some kind of envelope distortion in case an IIR filter is
applied

Regards

Prateek



On Wed, 30 Mar 2005 14:43:06 -0800, Eric Blossom <address@hidden> wrote:
> On Wed, Mar 30, 2005 at 03:15:38PM -0700, address@hidden wrote:
> > I have the following program to capture USRP samples and write them to a
> > file.  What is a simple way to have the program capture for X number of
> > samples and then stop?
> >
> > Thanks
> 
> Yes.
> 
> Use gr.head(...) to get the "head of the stream" and gr.run() instead of 
> start()/stop().
> 
> Eric
> 
> ----------------------------------------------------------------
> 
> from gnuradio import gr
> from gnuradio import audio
> from gnuradio import usrp
> from gnuradio.eng_option import eng_option
> from optparse import OptionParser
> 
> def build_graph (IF_freq, filename, nsamples=0):
> 
>     fg = gr.flow_graph ()
> 
>     # 256K sample rate
>     adc_rate = 64e6
>     decim = 16
>     mux = 0xf0f0f0f0
> 
>     src = usrp.source_c (0, decim, 1, mux)
>     src.set_rx_freq (0, -IF_freq)
>     src.set_pga (0, 20)
>     dst = gr.file_sink (gr.sizeof_gr_complex, filename)
> 
>     if nsamples > 0:
>         head = gr.head(gr.sizeof_gr_complex, nsamples)
>         fg.connect(src, head, dst)
>     else:
>         fg.connect (src, dst)
> 
>     return fg
> 
> def main ():
>     samples = 256000
>     fg = build_graph (10.7e6, "if_sample_4m_complex.dat", samples)
>     fg.run()
> 
> if __name__ == '__main__':
>     main ()
> 
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 


-- 
Prateek Dayal
B.Tech 4th Year
ECE
IIT Guwahati

www.geocities.com/pmd_iitgw




reply via email to

[Prev in Thread] Current Thread [Next in Thread]