"t" is the representation in continuous-time but in discrete time it can be
represented in the form of sample-count (samp-rate must be known).

 
nitems_written<http://gnuradio.org/doc/doxygen/classgr_1_1block.html#a742128a481fcb9e43a3e0cd535a57f9e>
hold the number of items produced by the block on the output port. This
count along-with "noutput_items" (items that can be produced during current
work function call), can possibly be used to determine the factor "t"


-Adeel


On Mon, Feb 10, 2014 at 5:17 AM, Activecat <active...@gmail.com> wrote:

> Dear Sir,
>
> I am building a custom block.
> How to know the time t, in seconds, of how long the flow graph has started?
>
> Says, I build a block of analog_sig_source_f.
> Its work() function may involve a variable t (time) as below:
>
>      for ( int i=0; i < noutput_items; i++ )  {
>         out[i] = ampl * sin( 2 * PI * wave_freq * t )
>      }
>
> I know we there is a built-in Signal Source block, but I write this to
> illustrate what I need to do.
>
> Regards,
> activecat
>
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to