Re: [Discuss-gnuradio] Sine wave of only 3 cycles

2014-01-31 Thread Tom Rondeau
On Thu, Jan 30, 2014 at 10:22 PM, Activecat active...@gmail.com wrote:
 Dear Sirs,

 But, another problem arisen.
 There is a WX GUI Scope Sink in the middle of the flow-graph to plot the
 instantaneous reading.
 When the data stream stop by the Head Block, says, at time=t1, the WX GUI
 Scope Sink starts to show zero reading.

 The question is, how to see the plot between time=0 and time=t1 ?
 The workaround is to save the data into a file, then plot it using external
 tool. This is off-line approach.
 Is there any online approach that doesn't require any external plotting
 tool, to view the GUI plot between time=0 and time=t1, after the Head Block
 terminates the data stream?

 Regards,
 activecat

You can try to use the QTGUI tools instead of the WX ones. When the
data stops, the QTGUI sinks should not update, so it will show you the
last plotted samples. But be aware that it's a sampling approach to
plotting. Basically, it waits for enough samples to plot one full
graph (1024 by default), so it needs to see this amount before it'll
update.

However, since you're stopping the flowgraph, don't be afraid of the
off-line approach. That might be the best way to go. The on-line
approach is designed for streaming data, so what you're asking to do
is a bit of a different situation that we'd normally work with.

Also, note that we ship a handful of off-line plotting tools with GNU
Radio. There's a set called gr_plot_* that use scipy and Matplotlib
to plot the graphs. I made some newer ones called gr_*_plot_* that
uses QT. There not full-featured and may be a bit buggy, but the idea
with these is to have a common feel and UI between using the QTGUI
sinks inside a flowgraph and these off-line plotting tools.

Tom



 On Thu, Jan 30, 2014 at 9:47 PM, Activecat active...@gmail.com wrote:

 Dear Sirs,

 Thank you very much.
 The head block solve my problem precisely.

 Note:
 The flow graph consists of some other blocks at the middle.

 Regards,
 activecat.


 On Thu, Jan 30, 2014 at 8:18 PM, Marcus Müller mar...@hostalia.de wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Also,
 to do basic mathematical tasks you don't have to rely on GNU Radio,
 which is a fine signal processing framework but not so much a math
 environment.

 If you want to have a three period sine signal, the python is short

 #import numpy as np

 f_sin = 1.0
 f_sample = 16.0
 periods = 3.0

 s_per_period = f_sample/f_sin

 sinevalues = np.sin(np.linspace(0, periods*2*np.pi,
 periods*s_per_period) )
 sinevalues.astype(np.float32).tofile(filename)

 this will be the same data format as written by the file sink.

 Greetings
 Marcus
 On 30.01.2014 13:02, Felix W. wrote:
  Hi,
 
  you can use a Head block to make the sample stream stop after a
  given number of samples. Just calculate how many samples there will
  be in three cycles and set the Head block's parameter accordingly.
 
  Greetings Felix
 
 
  2014-01-30 Activecat active...@gmail.com:
 
  Dear Sir,
 
  A block of Signal Source (Sine) generates sine wave
  continuously. How to make it just generates 3 wave-cycle and then
  stop generating immediately. At the end of the flow-graph there
  is a File Sink. This captures data for offline processing.
 
  Regards, active...@gmail.com
 
 
  ___ 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
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQEcBAEBAgAGBQJS6kMXAAoJEAFxB7BbsDrLvCsH/RT3cjGEe+/F/xZKATXhcT/N
 KXTcGJlR3otmGA3EUU79IF7Veel9LFBlhUXIU1OhCPn3n8QpAS0KBzTW5cBatHDb
 HsD+IRZcYN3GkpqYXwpCtaLMNJgDKuHpPXxVwg3CMOXFB6LrJ8eZmB18TGplPv0x
 +N/ijjpRXyFOUwMMyC+vQbGGWkYfEFF3tlwf7Wnt9B5E8+cevVDoTOo4/zGfInv8
 n6Ww57l7/uxRncBN+eiKdjShWhVD9xKYkonghvJJ05TBRyy4D5IODQJqo8iZlcgA
 0Q6DHZAPiBgr5rTzbAenHx48RIls7j6+HSEtMDXrHkfRrdOuYxZDgMAh8rDXXgo=
 =j9iF
 -END PGP SIGNATURE-

 ___
 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


___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Sine wave of only 3 cycles

2014-01-30 Thread Activecat
Dear Sir,

A block of Signal Source (Sine) generates sine wave continuously.
How to make it just generates 3 wave-cycle and then stop generating
immediately.
At the end of the flow-graph there is a File Sink. This captures data for
offline processing.

Regards,
active...@gmail.com
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Sine wave of only 3 cycles

2014-01-30 Thread Felix W.
Hi,

you can use a Head block to make the sample stream stop after a given
number of samples. Just calculate how many samples there will be in three
cycles and set the Head block's parameter accordingly.

Greetings
Felix


2014-01-30 Activecat active...@gmail.com:

 Dear Sir,

 A block of Signal Source (Sine) generates sine wave continuously.
 How to make it just generates 3 wave-cycle and then stop generating
 immediately.
 At the end of the flow-graph there is a File Sink. This captures data for
 offline processing.

 Regards,
 active...@gmail.com


 ___
 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


Re: [Discuss-gnuradio] Sine wave of only 3 cycles

2014-01-30 Thread Marcus Müller
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Also,
to do basic mathematical tasks you don't have to rely on GNU Radio,
which is a fine signal processing framework but not so much a math
environment.

If you want to have a three period sine signal, the python is short

#import numpy as np

f_sin = 1.0
f_sample = 16.0
periods = 3.0

s_per_period = f_sample/f_sin

sinevalues = np.sin(np.linspace(0, periods*2*np.pi,
periods*s_per_period) )
sinevalues.astype(np.float32).tofile(filename)

this will be the same data format as written by the file sink.

Greetings
Marcus
On 30.01.2014 13:02, Felix W. wrote:
 Hi,
 
 you can use a Head block to make the sample stream stop after a
 given number of samples. Just calculate how many samples there will
 be in three cycles and set the Head block's parameter accordingly.
 
 Greetings Felix
 
 
 2014-01-30 Activecat active...@gmail.com:
 
 Dear Sir,
 
 A block of Signal Source (Sine) generates sine wave
 continuously. How to make it just generates 3 wave-cycle and then
 stop generating immediately. At the end of the flow-graph there
 is a File Sink. This captures data for offline processing.
 
 Regards, active...@gmail.com
 
 
 ___ 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
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS6kMXAAoJEAFxB7BbsDrLvCsH/RT3cjGEe+/F/xZKATXhcT/N
KXTcGJlR3otmGA3EUU79IF7Veel9LFBlhUXIU1OhCPn3n8QpAS0KBzTW5cBatHDb
HsD+IRZcYN3GkpqYXwpCtaLMNJgDKuHpPXxVwg3CMOXFB6LrJ8eZmB18TGplPv0x
+N/ijjpRXyFOUwMMyC+vQbGGWkYfEFF3tlwf7Wnt9B5E8+cevVDoTOo4/zGfInv8
n6Ww57l7/uxRncBN+eiKdjShWhVD9xKYkonghvJJ05TBRyy4D5IODQJqo8iZlcgA
0Q6DHZAPiBgr5rTzbAenHx48RIls7j6+HSEtMDXrHkfRrdOuYxZDgMAh8rDXXgo=
=j9iF
-END PGP SIGNATURE-

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Sine wave of only 3 cycles

2014-01-30 Thread Activecat
Dear Sirs,

Thank you very much.
The head block solve my problem precisely.

Note:
The flow graph consists of some other blocks at the middle.

Regards,
activecat.


On Thu, Jan 30, 2014 at 8:18 PM, Marcus Müller mar...@hostalia.de wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Also,
 to do basic mathematical tasks you don't have to rely on GNU Radio,
 which is a fine signal processing framework but not so much a math
 environment.

 If you want to have a three period sine signal, the python is short

 #import numpy as np

 f_sin = 1.0
 f_sample = 16.0
 periods = 3.0

 s_per_period = f_sample/f_sin

 sinevalues = np.sin(np.linspace(0, periods*2*np.pi,
 periods*s_per_period) )
 sinevalues.astype(np.float32).tofile(filename)

 this will be the same data format as written by the file sink.

 Greetings
 Marcus
 On 30.01.2014 13:02, Felix W. wrote:
  Hi,
 
  you can use a Head block to make the sample stream stop after a
  given number of samples. Just calculate how many samples there will
  be in three cycles and set the Head block's parameter accordingly.
 
  Greetings Felix
 
 
  2014-01-30 Activecat active...@gmail.com:
 
  Dear Sir,
 
  A block of Signal Source (Sine) generates sine wave
  continuously. How to make it just generates 3 wave-cycle and then
  stop generating immediately. At the end of the flow-graph there
  is a File Sink. This captures data for offline processing.
 
  Regards, active...@gmail.com
 
 
  ___ 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
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQEcBAEBAgAGBQJS6kMXAAoJEAFxB7BbsDrLvCsH/RT3cjGEe+/F/xZKATXhcT/N
 KXTcGJlR3otmGA3EUU79IF7Veel9LFBlhUXIU1OhCPn3n8QpAS0KBzTW5cBatHDb
 HsD+IRZcYN3GkpqYXwpCtaLMNJgDKuHpPXxVwg3CMOXFB6LrJ8eZmB18TGplPv0x
 +N/ijjpRXyFOUwMMyC+vQbGGWkYfEFF3tlwf7Wnt9B5E8+cevVDoTOo4/zGfInv8
 n6Ww57l7/uxRncBN+eiKdjShWhVD9xKYkonghvJJ05TBRyy4D5IODQJqo8iZlcgA
 0Q6DHZAPiBgr5rTzbAenHx48RIls7j6+HSEtMDXrHkfRrdOuYxZDgMAh8rDXXgo=
 =j9iF
 -END PGP SIGNATURE-

 ___
 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


Re: [Discuss-gnuradio] Sine wave of only 3 cycles

2014-01-30 Thread Activecat
Dear Sirs,

But, another problem arisen.
There is a WX GUI Scope Sink in the middle of the flow-graph to plot the
instantaneous reading.
When the data stream stop by the Head Block, says, at time=t1, the WX GUI
Scope Sink starts to show zero reading.

The question is, how to see the plot between time=0 and time=t1 ?
The workaround is to save the data into a file, then plot it using external
tool. This is off-line approach.
Is there any online approach that doesn't require any external plotting
tool, to view the GUI plot between time=0 and time=t1, after the Head Block
terminates the data stream?

Regards,
activecat


On Thu, Jan 30, 2014 at 9:47 PM, Activecat active...@gmail.com wrote:

 Dear Sirs,

 Thank you very much.
 The head block solve my problem precisely.

 Note:
 The flow graph consists of some other blocks at the middle.

 Regards,
 activecat.


 On Thu, Jan 30, 2014 at 8:18 PM, Marcus Müller mar...@hostalia.de wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Also,
 to do basic mathematical tasks you don't have to rely on GNU Radio,
 which is a fine signal processing framework but not so much a math
 environment.

 If you want to have a three period sine signal, the python is short

 #import numpy as np

 f_sin = 1.0
 f_sample = 16.0
 periods = 3.0

 s_per_period = f_sample/f_sin

 sinevalues = np.sin(np.linspace(0, periods*2*np.pi,
 periods*s_per_period) )
 sinevalues.astype(np.float32).tofile(filename)

 this will be the same data format as written by the file sink.

 Greetings
 Marcus
 On 30.01.2014 13:02, Felix W. wrote:
  Hi,
 
  you can use a Head block to make the sample stream stop after a
  given number of samples. Just calculate how many samples there will
  be in three cycles and set the Head block's parameter accordingly.
 
  Greetings Felix
 
 
  2014-01-30 Activecat active...@gmail.com:
 
  Dear Sir,
 
  A block of Signal Source (Sine) generates sine wave
  continuously. How to make it just generates 3 wave-cycle and then
  stop generating immediately. At the end of the flow-graph there
  is a File Sink. This captures data for offline processing.
 
  Regards, active...@gmail.com
 
 
  ___ 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
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQEcBAEBAgAGBQJS6kMXAAoJEAFxB7BbsDrLvCsH/RT3cjGEe+/F/xZKATXhcT/N
 KXTcGJlR3otmGA3EUU79IF7Veel9LFBlhUXIU1OhCPn3n8QpAS0KBzTW5cBatHDb
 HsD+IRZcYN3GkpqYXwpCtaLMNJgDKuHpPXxVwg3CMOXFB6LrJ8eZmB18TGplPv0x
 +N/ijjpRXyFOUwMMyC+vQbGGWkYfEFF3tlwf7Wnt9B5E8+cevVDoTOo4/zGfInv8
 n6Ww57l7/uxRncBN+eiKdjShWhVD9xKYkonghvJJ05TBRyy4D5IODQJqo8iZlcgA
 0Q6DHZAPiBgr5rTzbAenHx48RIls7j6+HSEtMDXrHkfRrdOuYxZDgMAh8rDXXgo=
 =j9iF
 -END PGP SIGNATURE-

 ___
 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