discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] sample and hold


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] sample and hold
Date: Mon, 14 Jul 2008 10:48:23 -0700
User-agent: Mutt/1.5.17 (2007-11-01)

On Fri, Jul 11, 2008 at 06:32:12PM +0200, Pepito31 Pepito31 wrote:
> Hello,
> I would like to construct a sample and hold function with :
>   src_data=(0,)*4095,1
> 
>   delay2=gr.vector_source_b(src_data,True)
>   sample_and_hold = gr.sample_and_hold_ff()
> 
> I would like that that sample and hold had a duration of 4096 cycles
> (4095 "0" followed by a "1").
> But constructing my vector using src_data=src_data=(0,)*4095,1, I obtain
> :
> ((0, 0, 0, 0, 0, .......... 0, 0, 0, 0, 0), 1)
> instead of
> (0, 0, 0, 0, 0, 0,........ 0, 0, 0, 0, 1) as I would like
> 
> Could you please help me to construct correctly the vector.
> 
> Thank you very much,
> 
> Pepito

"," is the tuple constructor.  You are asking it to create a 2-tuple,
where the first element is a tuple of 4095 0's and the second element
is a 1-tuple containing 1.

Try this instead:

  src_data=src_data=(0,)*4095 + (1,)

Eric




reply via email to

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