discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] How to get t (time) to calculate output = sin ( 2 * P


From: Activecat
Subject: [Discuss-gnuradio] How to get t (time) to calculate output = sin ( 2 * PI * freq * t ) ?
Date: Mon, 10 Feb 2014 21:17:17 +0800

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

reply via email to

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