discuss-gnuradio
[Top][All Lists]
Advanced

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

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


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] Sine wave of only 3 cycles
Date: Thu, 30 Jan 2014 13:18:31 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

-----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 <address@hidden>:
> 
>> 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, address@hidden
>> 
>> 
>> _______________________________________________ Discuss-gnuradio
>> mailing list address@hidden 
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>> 
>> 
> 
> 
> 
> _______________________________________________ Discuss-gnuradio
> mailing list address@hidden 
> 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-----



reply via email to

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