discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: Weird behaviour of the analog signal source


From: Paul Boven
Subject: Re: Weird behaviour of the analog signal source
Date: Fri, 6 Mar 2020 14:06:59 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

Hi Lukas,

On 03/03/2020 16:52, Lukas Haase wrote:
3.) What would you do if you would want to create precise timing signals? Is a 
custom block really the only way? And then, how would you implement it?

This is a problem that I've run into as well in the past. You don't have to create a custom block to work around it. You can simply create a vector with your samples, and play that back on repeat. Use the 'Vector Source' instead of the Signal Source.

Create an 'Import' block, with contents for the import field:
import numpy as np

Create a 'Variable' block, with Id 'Sine', and Value:
np.sin(np.linrange(0, 2*np.pi, samp_rate, endpoint=False)

Create a 'Vector Source' block, set 'Sine' as the Vector, Repeat = Yes, Output Type = Float, Vector Length = 1.

Include the 'Throttle' and other blocks as before.

This gives you a 1 Hz sine wave of unity amplitude.

Of course this only works if your frequency fits an integral number of times within your sample rate. Then again, you can choose a different length than samp_rate as well.

Regards, Paul Boven.







reply via email to

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