BastilleResearch / gr-lora

GNU Radio OOT module implementing the LoRa PHY, based on https://github.com/matt-knight/research/tree/master/2016_05_20_jailbreak
GNU General Public License v3.0
470 stars 92 forks source link

Resampling #16

Closed RyabchikSib closed 6 years ago

RyabchikSib commented 7 years ago

Hi! I started working with SDR and GNU Radio not long ago and have a misunderstanding.

As far as I understand, the generated chirps in /lib/mod_impl.cc have the bandwidth 2*pi. Then in the flowgraph the interpolation by factor sample_rate/bandwidth is applied and the signal is transmitted. What is the sampling frequency after the modulator? It should be bandwidth rate (250e3, for example). But how is it achived?

The reason I'm asking is that I want to add noise after the modulator and measure the error rate and can't figure out what signal bandwidth to choose to get the right noise power value.

Each and every advice is appreciated)

RyabchikSib commented 7 years ago

Can't get, what does it mean: "The width of the signal is determined by the sample rate."

matt-knight commented 6 years ago

@RyabchikSib:

First, apologies for the delay!

This might be a bit of a tricky answer. Within GNU Radio, there is no base sampling rate as I think you're alluding to. Blocks must be synchronous (matched I/O rates and data types), and they publish/consume samples as fast as the flowgraph allows them to. If there is a throttle or a radio sink/source within the flowgraph it will gate sample flow based on a clock reference, slowing everything down. Without such an element, the flowgraph will run as fast as your CPU allows it to.

With regard to sample rate and bandwidth, the observable bandwidth is simply equal to the sample rate. All that resampling is done to adjust the bandwidth of the signal. The rest just works out based on how the LoRa physical layer is defined (the chirp rate being a function of the bandwidth and spreading factor).

If I've understood your goals correctly, I think you'll want to introduce your voice source after the resampler -- you can do your math based on the signal bandwidth at that point.

Feel free to follow up if you have more questions and I promise I'll answer more promptly :)

matt-knight commented 6 years ago

I'm going to close this due to inactivity -- feel free to re-open or start a new issue if you have further questions.