[Top][All Lists]

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

Re: FM Transmission with a vector of bits

From: Adrian Musceac
Subject: Re: FM Transmission with a vector of bits
Date: Tue, 07 Jul 2020 06:40:32 +0000

Hi Anthony,

To get data into the GNU radio flowgraph using a specific format (whether it's PCM samples or bytes of data) the easiest way is to write your own custom block which acts as a source (that is, it has no incoming graph connection).

Normally you would implement such a block in C++ for performance reasons, but it might be also possible to prototype it in Python.

The custom source block has three important elements:
1. the GNU radio thread implementing the work() method which moves the incoming data towards the rest of the blocks downstream.
2. Its own data buffer writable by external code (not inside the work() thread) and protected by a mutex.
3. A callable method which periodically fills the data buffer with more data (in your case PCM samples). You call this method from code external to GNU radio as soon as you have enough new data, for example you read 20 milliseconds worth of PCM 16 bit samples in your application, process them, then call the "source" block method to fill the data buffer with them. The work() thread in the source block will drain the data buffer and pass the samples downstream into GNU radio.

If you want your application to reside in another process, you can use a socket to listen on for new 16 bit chunks of data in the source block and populate the data buffer as they arive. Then all your other process needs to do is push bytes towards the network or unix socket.

If you want to avoid writing your own custom source block, you could investigate using an UDP or TCP source for this purpose and have a separate process pushing PCM data to it. For best performance though I recommend a custom block.


On July 6, 2020 7:43:26 AM UTC, Anthony Beyaert <anthonyld508@gmail.com> wrote:
Hello Adrian,

Thanks for your answer.

I am setting up a PCM/FM transmitter : the PCM frame is already
generated under a sequence bit I am willing to transmit. To that I have
found that the closest solution would be to use a Vector Source block in
which I set the vector as my bit sequence.

What I am trying to do is to transmit this bit sequence using FM
modulation. With the previous links I have been able to multiply this
sequence with a signal source acting as a carrier frequency, so I have
now at the output a sine wave modulated with the 0 and 1 from the vector
source. I have seen several blocks to achieve the FM modulation (VCO, FM
Mod, NBFM/WBFM blocks), so I am trying now to set up all of this (if
it's the right way to go).



reply via email to

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