NEWSDR 2024 on Friday May 31 at WPI in Worcester, MA, USA

2024-04-29 Thread Neel Pandeya
The New England Workshop on Software Defined Radio (NEWSDR) is being held
at Worcester Polytechnic Institute (WPI) on Friday May 31, in Worcester,
Massachusetts, USA.

There will also be a tutorial session on the evening before on Thursday May
30.

The event is free, but advance registration is required.

To learn more about this event, as well as to register for free,
please visit our website at the link below.

Please also consider submitting a poster presentation for the networking
sessions.
We are actively looking for submissions.

https://newsdr.org/workshops/newsdr2024/


Re: Debugging Existing C++ Blocks with VS Code & GDB

2024-04-29 Thread Matt Clemons
Thanks Walter

I realized that I had multiple gnuradio versions installed even though I
thought I checked that. I completely wiped all my gnu radio files, pulled
in the latest version 3.10.10.0 and built using the
-DCMAKE_BUILD_TYPE=Debug, and now I can successfully debug the existing DTV
code. The python code must have been importing a module from gnuradio in
another directory, which caused it to not recognized any of my edits or
breakpoints in the file I was working on.

Matt

On Tue, Apr 23, 2024 at 7:41 PM walter  wrote:

> Hi Matt,
>
> I'm not sure if this is an apples-to-apples situation, but your issue
> sounds exactly like something I've run into while abusing Python snippets.
> It was easy to avoid after understanding order-of-events for block
> creation.
>
> I suspect this is language-independent, and you can quickly create a
> python flowgraph / review the code - it will illustrate the principles:
>
> 1. Create a python flowgraph 'FOO.grc' with minimal blocks (e.g. [signal
> source] --> [throttle2] --> [null sink]).
>
> 2. Add four [Python Snippet] blocks - one for each type of [Section of
> Flowgraph] param: 'Init - Before Blocks', 'Main - After Start', etc.
>
> 3. For each Python Snippet block, add a one-line snippet distinct to the
> [Section of Flowgraph], for example:
>
> print("Hello IAMA Init - Before Blocks")
> # NOTE: it's important to have a least one line of code or nothing will be
> generated for the snippet!
>
> 4. Set the Title param of the [Options] block (top block) to "FOO".
>
> 5. Press [F5] to generate the flowgraph code, which will be called FOO.py
> (in same directory as FOO.grc).
>
> 6. Examine the resulting FOO.py script in VSCode - in particular, where
> each of the snippets are invoked.
>
> The most obvious example is that in 'Init - Before Block' it's possible to
> reference a block or variable self.X before self.X has been instantiated.
>
> More subtle cases are possible, depending on how clever one tries to be
> when using this mechanism.
>
> - W
>
> Attached: screencap of example error (take my word that the block 'radio'
> exists).  I can send a shot of the flowgraph, but it probably wouldn't shed
> further light.
>
> [image: flowgraph_has_no_attr_radio.png]
>
>
> On Apr 23, 2024, at 13:46, Matt Clemons  wrote:
>
> Hello,
>
> I've walked through tutorials and successfully set breakpoints and
> debugged OOT modules in Gnu Radio using the DCMAKE_BUILD_TYPE=Debug option.
> However, I'm trying to debug local changes I've made to existing
> gnuradio/dtv/ files and not having success.
>
> I've followed the steps in a similar question/email chain here:
> https://lists.gnu.org/archive/html/discuss-gnuradio/2021-08/msg8.html
> (I wasn't sure if replying to this old chain with a question or referencing
> it was better, let me know if there is a preference for future scenerios).
>
> I also tried recompiling all of the gnu radio source code on my machine
> with the  DCMAKE_BUILD_TYPE=Debug option and still can not get VScode to
> stop on my set breakpoint within the
> dtv/dvbt_demod_reference_signals_impl.cc file. The flowchart runs, and
> completes but when I hover over the break point it just says "Module
> containing this breakpoint has not yet loaded or the address could not be
> obtained".
>
> Any suggestions? I don't like the option of copying this into an OOT
> module just to debug. I'm not sure I understand the difference either.
>
> Thanks,
>
> Matt
>
>
>


Transmitting a waveform, and recording input, at an adjustable rep rate

2024-04-29 Thread Jameson Collins
I'm trying to use GNU Radio to build a test/measurement rig.

At a user-defined interval I want to perform two actions:
 1) Transmit an FM sweep with user definable properties like frequency
 2) And record to a file for a fixed duration.

For the transmitter I was able to adapt the demo case for the lambda
function found here: https://wiki.gnuradio.org/index.php/PDU_Lambda.  This
seems to work great.

For the recording feature I started with  the example "Pushbutton IQ
Recorder with descriptive filenames" (
https://wiki.gnuradio.org/index.php?title=Pushbutton_IQ_Recorder_with_descriptive_filenames).
This works by creating a new file, and recording, whenever a user presses
and holds a button.  That button sets a variable to true which enables the
recording.

But, short of using custom python blocks, I can't figure out a way to
trigger the recording at the same time I perform the transmit and I can't
figure out a way to stop the recording automatically after a fixed amount
of time / samples.


Re: Transmitting a waveform, and recording input, at an adjustable rep rate

2024-04-29 Thread Paul Atreides
You might have luck modifying this tutorial. Understanding XMLRPC Blockswiki.gnuradio.orgThis gives you the ability to change parameters via a separate python script where simple logic may be easier to implement. Not precise timing, but simple. On Apr 29, 2024, at 14:16, Jameson Collins  wrote:I'm trying to use GNU Radio to build a test/measurement rig.At a user-defined interval I want to perform two actions: 1) Transmit an FM sweep with user definable properties like frequency 2) And record to a file for a fixed duration.For the transmitter I was able to adapt the demo case for the lambda function found here: https://wiki.gnuradio.org/index.php/PDU_Lambda.  This seems to work great.For the recording feature I started with  the example "Pushbutton IQ Recorder with descriptive filenames" (https://wiki.gnuradio.org/index.php?title=Pushbutton_IQ_Recorder_with_descriptive_filenames).  This works by creating a new file, and recording, whenever a user presses and holds a button.  That button sets a variable to true which enables the recording.But, short of using custom python blocks, I can't figure out a way to trigger the recording at the same time I perform the transmit and I can't figure out a way to stop the recording automatically after a fixed amount of time / samples.


Re: Transmitting a waveform, and recording input, at an adjustable rep rate

2024-04-29 Thread Jameson Collins
Interesting, thanks, I'll check that out.

And no, I don't need precise timing control.

If I do have to do this with Python I might copy the data counting example
in the Python Block wiki and connect the message output to the Message To
Variable block which could be used to set the state of the
recording-Boolean used in the previously mentioned example design.




On Mon, Apr 29, 2024, 3:13 PM Paul Atreides  wrote:

> You might have luck modifying this tutorial.
> Understanding XMLRPC Blocks
> 
> wiki.gnuradio.org
> 
> [image: favicon.ico]
> 
> 
> This gives you the ability to change parameters via a separate python
> script where simple logic may be easier to implement. Not precise timing,
> but simple.
>
> 
>
> On Apr 29, 2024, at 14:16, Jameson Collins 
> wrote:
>
> 
> I'm trying to use GNU Radio to build a test/measurement rig.
>
> At a user-defined interval I want to perform two actions:
>  1) Transmit an FM sweep with user definable properties like frequency
>  2) And record to a file for a fixed duration.
>
> For the transmitter I was able to adapt the demo case for the lambda
> function found here: https://wiki.gnuradio.org/index.php/PDU_Lambda.
> This seems to work great.
>
> For the recording feature I started with  the example "Pushbutton IQ
> Recorder with descriptive filenames" (
> https://wiki.gnuradio.org/index.php?title=Pushbutton_IQ_Recorder_with_descriptive_filenames).
> This works by creating a new file, and recording, whenever a user presses
> and holds a button.  That button sets a variable to true which enables the
> recording.
>
> But, short of using custom python blocks, I can't figure out a way to
> trigger the recording at the same time I perform the transmit and I can't
> figure out a way to stop the recording automatically after a fixed amount
> of time / samples.
>
>


favicon.ico
Description: Binary data


favicon.ico
Description: Binary data


Re: Rational resample before FFT, and FFT rate

2024-04-29 Thread Gary Schafer

It sounds to me as if you're trying to move the signal to the center of a FFT bin so that 
you don't have to deal with scalloping loss. Is that correct? If so, I strongly recommend 
that you skip all of this resampling and just use a "flattop" window in the 
FFT. That will allow you to measure the maximum amplitude with very high accuracy 
(roughly within 0.01 dB) regardless of where the signal resides within the spectrum.

If that's not satisfactory, then I recommend that you skip the "having a sample rate 
that is a power-of-2 Hz" and just move the signal to the center of a frequency bin 
with whatever sample rate you have. The bin frequencies are simply (sample rate)/N, where 
N is the number of samples in the FFT. So with a sample rate of 16 kHz and a 512 pt FFT, 
you'd select a frequency that was an integer value of 16000/512 = 31.25 Hz. So, if you 
want to move it to, say, the 10th bin, move it to 31.25*10 = 312.5 Hz. Done.

Good luck!

Gary



I am reading Digital RF data at 16k samples/second, and my goal is to
get the power of the maximum frequency once per second.

I start by resampling to a power-of-two rate, then translating to move
the desired frequency to the center with further decimation, then doing
an FFT, converting to log power and finally extracting the power of the
loudest bin.  The decimation and FFT size are calculated to yield one
FFT per second.  I'm not sure if I'm doing this correctly and  I've
attached the flowgraph.

(a)  Should the FFT use only a power-of-two bin size?  I am resampling
to go from 16k to 8192 samples/second so that I ultimately decimate to
512 samples/second rather than 500 samples/second.

Is that the right thing to do?  Should I resample up to 16384
samples/second rather than down to 8192?  Or should I just use a 500 bin
FFT?

(b)  Given that the final sample rate and FFT depth are equal (512), I
expected to get one vector per second, and thus one maximum value per
second.  Instead, I see a much slower update rate, about once per five
seconds.

I added a QT vector sink and while that takes a long time to get
started, once going it does update about once per second.  Am I doing
something wrong that the maximum value doesn't update with each new vector?

Thanks,
John



Re: Rational resample before FFT, and FFT rate

2024-04-29 Thread John Ackermann N8UR

Hi Gary --

Thanks for getting back to me.  Maybe I can explain better what I'm 
doing.  The data is 16 ksps complex IQ centered at 50.080 MHz.  The 
target signal is an essentially unmodulated CW carrier about 427 below 
that.  I have about 8 hours of recorded data to analyze.


Ultimately I want to plot both the amplitude and any frequency change to 
sub-Hz resolution.  To get sufficient resolution I decimate down to a 
bandwidth of only a few hundred Hz.  That would put the target signal 
outside the passband, so the frequency translation first shifts it to 
the center.


I need data points at convenient intervals for time series plotting, 
e.g., 512 samples/second going into a 512 bin FFT to provide one maximum 
amplitude value per second.  I resampled so I could get that 
one-frame-per-second pacing with a power-of-two FFT size.  If that's not 
a real concern, I can happily remove the resampling and work with the 
natural sample rate, e.g., 500 bin FFT fed by 500 samples/second.


My main question is why the displayed maximum bin value is updating much 
more slowly than once per second when FFT size = sample rate.  It's more 
like one per five seconds.  In particular, am I doing something wrong 
with the stream and vector conversions around the FFT and MAX blocks?


Thanks,
John

On 4/29/24 19:06, Gary Schafer wrote:
It sounds to me as if you're trying to move the signal to the center of 
a FFT bin so that you don't have to deal with scalloping loss. Is that 
correct? If so, I strongly recommend that you skip all of this 
resampling and just use a "flattop" window in the FFT. That will allow 
you to measure the maximum amplitude with very high accuracy (roughly 
within 0.01 dB) regardless of where the signal resides within the spectrum.


If that's not satisfactory, then I recommend that you skip the "having a 
sample rate that is a power-of-2 Hz" and just move the signal to the 
center of a frequency bin with whatever sample rate you have. The bin 
frequencies are simply (sample rate)/N, where N is the number of samples 
in the FFT. So with a sample rate of 16 kHz and a 512 pt FFT, you'd 
select a frequency that was an integer value of 16000/512 = 31.25 Hz. 
So, if you want to move it to, say, the 10th bin, move it to 31.25*10 = 
312.5 Hz. Done.


Good luck!

Gary



I am reading Digital RF data at 16k samples/second, and my goal is to
get the power of the maximum frequency once per second.

I start by resampling to a power-of-two rate, then translating to move
the desired frequency to the center with further decimation, then doing
an FFT, converting to log power and finally extracting the power of the
loudest bin.  The decimation and FFT size are calculated to yield one
FFT per second.  I'm not sure if I'm doing this correctly and  I've
attached the flowgraph.

(a)  Should the FFT use only a power-of-two bin size?  I am resampling
to go from 16k to 8192 samples/second so that I ultimately decimate to
512 samples/second rather than 500 samples/second.

Is that the right thing to do?  Should I resample up to 16384
samples/second rather than down to 8192?  Or should I just use a 500 bin
FFT?

(b)  Given that the final sample rate and FFT depth are equal (512), I
expected to get one vector per second, and thus one maximum value per
second.  Instead, I see a much slower update rate, about once per five
seconds.

I added a QT vector sink and while that takes a long time to get
started, once going it does update about once per second.  Am I doing
something wrong that the maximum value doesn't update with each new vector?

Thanks,
John