discuss-gnuradio
[Top][All Lists]
Advanced

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

Weird behaviour of the analog signal source (was: Re: How ensure consist


From: Lukas Haase
Subject: Weird behaviour of the analog signal source (was: Re: How ensure consistency with timing signals)
Date: Mon, 2 Mar 2020 22:45:23 +0100

Hi Marcus,

How can (or better: *should*) a fully digital signal source have phase noise?

Also, for 1Hz at 5MSps I always get either 5005789 or 5005790 samples (instead 
of 5000000) ... this is fairly deterministic.

Experimenting a bit, I see the weirdest behaviour of the analog signal source.
In my opinion, the source should be fully deterministic. But it is not.

Example 1: I pipe the output of the signal source into a file:

https://snipboard.io/xY1JvE.jpg

and read it with MATLAB:

data = read_float_binary('baszmeg.dat');

Then I compare it to an ideal (=expected) version:

t = 0:1/fs:(length(data)-1)/fs;
plot(t, [data - sin(2*pi*t)' ])

https://snipboard.io/ecTaFL.jpg

Now, I would not care too much about a constant phase shift or similar, but it 
can be seen that the frequency slowly drifts (this is also seen if I just plot 
them on top of each other).

Example 2: I extend the block diagram with blocks that should never alter the 
behaviour as they are only reading samples:

https://snipboard.io/W6kyF0.jpg

Note that the "Controller" is a simple Embedded Python block that only reads 
the input samples into a temporary variable:

def work(self, input_items, output_items):
    squared_wave = input_items[0]
    squared_wave[np.where(input_items[0] > 0)] = 1
    output_items[0][:] = input_items[0]
    return len(output_items[0])

However, now the saved data is distorted:

https://snipboard.io/amyn3X.jpg


Any suggestions highly appreciated.

Thanks,
Lukas





> Gesendet: Mittwoch, 26. Februar 2020 um 16:39 Uhr
> Von: "Marcus D. Leech" <address@hidden>
> An: "Lukas Haase" <address@hidden>
> Cc: "address@hidden" <address@hidden>
> Betreff: Re: How ensure consistency with timing signals
>
> On 02/26/2020 04:11 PM, Lukas Haase wrote:
> > Hi Marcus,
> >
> > Good point; but this is just for demonstration purposes here. I can tie it 
> > to USRP Source/Sink.
> >
> > The delta (measured in samples) should still be consistent, no matter what.
> >
> > Best, Lukas
> >
> >
> Looking at the siggen code, this is probably equivalent to phase-noise
> in the generator.  The square wave outputs are derived from COS/SIN, and
>    at such a high ratio between sample rate and frequency, there'll be a
> bit of phase noise.
>
> Someone with more knowledge of the siggen block can comment further.
>
>
>



reply via email to

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