On 08/12/2019 04:14 PM, Ellie White
wrote:
Hi Marcus,
Thanks for your note. So I did some experimenting -- ran
the flowgraph (on unbuffered mode) with decimation set to 488,
and recorded data for ~5 seconds; instead of getting ~5
spectra, as I would expect by doing a calculation similar to
yours, no samples were recorded. Any advice on that?
Thanks so much for your time and patience with this. Have a
nice afternoon!
Cheers,
Ellie
Not sure.
I constructed the attached flow-graph, which is conceptually similar
to yours, with two different integration pathways, and they both
produce
data in the output files at the expectedg rate---this is based on
a simulation, of course, but it shows that the general flow "works".
On Sun, Aug 11, 2019 at 4:48
PM Marcus D. Leech < address@hidden>
wrote:
On
08/11/2019 10:46 AM, Ellie White wrote:
Hi Marcus,
I've attached the two flowgraphs I am using to
record data from the Ettus SDR; the TCP server
(ettus-test.grc) which reads in the data samples, and
the TCP client (ettus-filesink.grc). I am not sure how
to determine how the sampling is terminated -- perhaps
you can advise me on this? Would the TCP block be an
example of a termination, or am I misunderstanding
this concept? And if we establish that the sampling is
"interrupted", from there how do I calculate the
decimation needed for my desired integration time?
Thanks so much for your help on this!
Cheers,
Ellie
Ok, so, looking at your graph:
Samples come in from the TCP source at 4Msps (interleaved).
You then perform an FFT with a width of 8192 bins, which
gives you an FFT "frame" rate of 488.28 FFTs per second.
You then integrate for
16380, which gives you a residual output rate of:
488/16380 = 0.029Hz, or an integration time of roughly 30
seconds.
So, every 30 seconds, 8192 values are being written to the
file-sink, those values are 4 bytes each (single-precision
floats), which is 32K every
30 seconds. Given that stdio buffers these days are
(AFAIR) 32K or so, that means you won't see data showing up
in the file that often.
You can set the "unbuffered" option, which bypasses
buffering by stdio, to see if that makes a difference in how
often data shows up in your file.
On Sun, Aug 11, 2019
at 1:51 AM Marcus D. Leech < address@hidden>
wrote:
On
08/10/2019 11:43 PM, Ellie White wrote:
Hi Marcus,
Thanks for the advice. So, I just tried an
experiment to test out your suggestion, and
came up with a puzzling result. I set the
sample rate to 4 MHz, and the decimation in
the integrate block to 4 MHz, and recorded
data for about 5 seconds. Instead of getting
about 5 samples out, I tried to read the file
and was told that there were "no samples" in
the file. I then tried setting the decimation
to samp_rate / fft_size, and the result there
was the same. Any thoughts on why this might
be?
Thanks,
Ellie
Probably buffering in Gnu Radio. How did you
terminate the sampling?
If you just interrupted it, there would have been
samples "in flight" that never made it "home".
On Sat, Aug
10, 2019 at 11:17 PM Marcus D. Leech < address@hidden>
wrote:
On
08/10/2019 10:48 PM, Ellie White wrote:
Hi Marcus,
Thanks for your reply. I am not
sure how the integration works, but if
you know how the Integrate block does
the integration, then that is how my
flowgraph does it. I suspect it is
"sum /reduce /dump" as you mentioned,
though perhaps we would need to
investigate the Integrate block's
source code to be sure? Thanks in
advance for any additional suggestions
you might have on this!
Cheers,
Ellie
Here's the documentation on the integrate
block:
https://wiki.gnuradio.org/index.php/Integrate
So, if your samples are coming in at 1kHz,
and you want 1 second of integration time
(and an output rate of 1Hz), you'd set the
"decimation" parameter to 1000.
This is one of the reasons I prefer
single-pole-IIR filters--since I can do
sample-rate reduction as a separate process,
via keep-one-in-N.
On
Sat, Aug 10, 2019 at 7:37 PM Marcus D.
Leech < address@hidden>
wrote:
On
08/10/2019 03:40 PM, Ellie White
wrote:
> Hi all,
>
> I hope you're doing well! Thanks
again for your help with my questions
> earlier this summer. I've got
another thing to ask now; I am in the
> process of configuring a system
to record integrated spectra using the
> attached flowgraph, and I am
trying to determine how to integrate
for,
> say, 60 seconds -- if I want to
do this, what should my decimation be,
> and how do I calculate that? I
have been able to approximate this by
> trial and error, but I would like
to know the calculation behind it.
>
> Thanks in advance for any advice
you can provide, much appreciated.
> Have a good afternoon!
>
> Cheers,
> Ellie
>
It kind of depends on how you're doing
integration.
An approach that strictly does
sum/reduce/dump then you need as many
samples as would occur over your
desired integration time.
For a single pole IIR filter, it's a
bit trickier, and you'd set the
"Alpha" parameter to:
e^sqrt(sample-rate*integraton-time)
Which will approximate an R-C
integrator with the given integration
time.
_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
|