Author Topic: Definition of RxBw with RFM69  (Read 20444 times)

perky

  • Hero Member
  • *****
  • Posts: 871
  • Country: gb
Definition of RxBw with RFM69
« on: November 25, 2015, 02:00:56 PM »
I'm trying to understand how to set the various radio paramemters for a RFM69CW, specifically the relationship between bit rate, frequency deviation and receiver bandwidth for FSK modulation.

So far I've seen these general rules, quoted here and in other places:
https://lowpowerlab.com/forum/index.php?topic=902.5;wap2
 
1)  0,5 <= 2 * Fdev / BR <= 10    (modulation index, MI)
2)  BR < 2 * RxBw     (bit rate)
3)  RxBw > 2 * Fdev     (receiver bandwidth)
4)  Fdev + BR / 2 < 500 kHz

I also have seen violations of these rules, especially the third rule, RxBw > 2 * Fdev.

One library I've seen has BR = 19.2kHz, Fdev = 38.4kHz, and RxBw = 41.6kHz. That gives a MI of 4. This apparently works though.

My understanding is if the MI is high then the energy is concentrated more around the two modulated frequencies, and if low it is more around the centre frequency, so with a high MI as in the above example you would expect a receiver bandwidth that includes the two modulated frequencies, Fc + Fdev and Fc - Fdev.

So is the definition of RxBw actually the width of the passband from the centre frequency outwards, and not for the whole bandwidth between the two modulated frequencies? The RFM69CW datasheet describes RxBw as "single side bandwidth". This would explain why the above example works, and would also mean rule 3 above is using the wrong definition of RxBw.


 

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5850
  • Country: us
    • LowPowerLab
Re: Definition of RxBw with RFM69
« Reply #1 on: November 25, 2015, 03:44:01 PM »
My first thought is that unless there was a copy error I would look at the semtech datasheets instead of the Hope ones: www.semtech.com/images/datasheet/sx1231h.pdf

perky

  • Hero Member
  • *****
  • Posts: 871
  • Country: gb
Re: Definition of RxBw with RFM69
« Reply #2 on: November 25, 2015, 07:28:00 PM »
Yes, I've been looking at the sx1231h as well. The RxBx > 2*Fdev rule didn't come from there, or the RFM69CW spec, I found it on a post which I'm now questioning.

The sx1231h datasheet says that the 20dB bandwidth of a modulated signal is 2*(Fdev + BR/2). If RxBw is actually the sideband bandwidth, and there are two sidebands, then RxBw is half that, i.e. Fdev + BR/2. This formula actually comes from Carson's rule, Bt = 2(Fdelta + Fm) where Fdelta is the maximum deviation from the centre frequency (i.e. Fdev), and Fm is the modulation frequency, but the maximum modulation frequency is half the bit rate (i.e. BR/2) when transmitted as an alternating sequence of 0's and 1's. Bt contains ~98% of the energy of the transmission.

So it appears the optimum bandwidth RxBw = Fdev + BR/2, and RxBw must be equal or greater to this. Just to confirm this thinking, there is a restriction that
Fdev + BR/2 < 500kHz, and 500kHz happens to be the maximum you can select for RxBw. It all fits..!

That's not the full story though as there could be a local oscillator offset (i.e. difference between transmitters LO and the receiver's LO), and that needs to be taken into account:

If not using AFC:
RxBw >= Fdev + BR/2 + LOoffset.

If using AFC you can program the RxBwAfc independently (although I'm not sure how this effects the sensitivity, it can't be made too wide either or you risk 'capturing' an adjacent channel transmission):
RxBw >= Fdev + BR/2
RxBwAfc >=  Fdev + BR/2 + LOoffset

The crystal oscillator specification used on the RFM69 hasn't been disclosed by HopeRf, but has been empirically sampled by this guy who came to the conclusion that the deviation from worst case low frequency to worst case high frequency was around 10ppm at constant temperature/voltage, and at 868MHz this is around 8.68kHz. Very worst case is probably 20ppm, i.e. 17.36kHz as these are probably +/-10ppm crystals.
http://jeelabs.net/boards/6/topics/4624

So the final set of rules I think looks like this (if using AFC):

1)  0.5 <= 2 * Fdev/BR <= 10    (modulation index, MI)
2)  BR < 2*RxBw     (bit rate)
3)  RxBw >= Fdev + BR/2   (receiver bandwidth)
4)  RxBwAfc >=  Fdev + BR/2 + LOoffset (receiver AFC bandwidth)
5)  Fdev + BR/2 < 500kHz  (maximum RxBw setting)

Or this (if not using AFC):
1)  0.5 <= 2 * Fdev/BR <= 10    (modulation index, MI)
2)  BR < 2*RxBw     (bit rate)
3)  RxBw >=  Fdev + BR/2 + LOoffset (receiver bandwidth)
4)  Fdev + BR/2 < 500kHz  (maximum RxBw setting)

BTW the sx1231h appears to be rebadged by Microchip as MRF39RA, and also Freescale's MKW01Z128 and MC12311 look similar. The Freescale datasheets can sometimes be a little clearer to read.

I'm hoping someone can test this theory out with some range tests, I will be doing some tests at some point when I get some more hardware. Any comments on this welcomed.

Mark.
« Last Edit: November 26, 2015, 04:47:32 PM by perky »

emjay

  • Full Member
  • ***
  • Posts: 120
  • Country: nl
Re: Definition of RxBw with RFM69
« Reply #3 on: November 26, 2015, 05:38:17 AM »
@perky,

Be very careful with the definition of Fdev - it varies from vendor to vendor and even on the same data sheet !
It can be either:

  • The +/- deviation from a nominal (imaginary) central carrier Fc, seen as the two distinct transmitted frequencies of Fc + fdev, Fc - fdev
  • The total deviation of the nominal (not imaginary) F1 (modulated to show a '1') and F0 (modulated to show a '0')

Ignoring sign (using a higher carrier frequency to represent a '1' is just by agreement between Tx and Rx) this gives:

     Fdev = 2 x fdev  (the use of upper/lower case is not followed consistently in docs)

You see how easy it is for a factor of 2 to creep erroneously into the calculation of modulation index, RxBw etc.

You wrote: .. expect a receiver bandwidth that includes the two modulated frequencies, Fc + Fdev and Fc - Fdev

Indeed, that is essential (and more for the BR/2 + Offset) for successful demodulation. Now think about how a zero-IF receiver works - after the LNA stage, the incoming signal is mixed with a Local Oscillator tuned pretty close to the nominal imaginary Fc. The mixer stage produces the sum and differences  - yielding conveniently +/- fdev (using the first definition above).

Hmm - ok. So what is a negative frequency?  It is just the signal flipped 180  So the output of the mixer is the modulating signal folded about Fc and then Fc set to 0 (i.e. DC).  This is where the terminology "single-sided" comes from for the RxBw. Phase and amplitude are preserved in the I & Q signals and passed to the demodulator.

All a bit simplified to aid the explanation - perhaps this sheds some light.




perky

  • Hero Member
  • *****
  • Posts: 871
  • Country: gb
Re: Definition of RxBw with RFM69
« Reply #4 on: November 26, 2015, 07:59:29 AM »
Thanks for that explanation, that has shed some light on this. I'm surprised the datasheets don't explictly state that RxBw >= Fdev + BR/2, it's sort of implied when it states the bandwidth of the transmitted modulated signal but leaves it at that. Also a pictorial definition of what RxBw and Fdev are would make it easier to understand.

As this is a commercial product I'm designing I have to understand the reasons why certain parameters are chosen rather than just plugging in some third party library values and hoping for the best ;-) Just to confirm though, I have got these rules right?

Thanks,
Mark.

emjay

  • Full Member
  • ***
  • Posts: 120
  • Country: nl
Re: Definition of RxBw with RFM69
« Reply #5 on: November 26, 2015, 09:31:04 AM »
Quote
I have got these rules right?

Close enough for Government work  ;)

perky

  • Hero Member
  • *****
  • Posts: 871
  • Country: gb
Re: Definition of RxBw with RFM69
« Reply #6 on: November 26, 2015, 01:49:56 PM »
OK, good to know  :D

BTW I think the RadioHead standard modem settings violate rules 3 and 4, in other words the receiver bandwidth is not set high enough for the frequency deviation and bit rate settings, and doesn't take into account local oscillator offsets either.

An example is modem config for 19.2 kbit/sec which is:
   { CONFIG_FSK,  0x06, 0x83, 0x02, 0x75, 0xf3, 0xf3, CONFIG_WHITE}, // FSK_Rb19_2Fd38_4
 
This sets the Fdev to 38.4kHz and BR to 19.2kb/s, and then sets RxBw and RxBwAfc to 41.7kHz which is not enough to allow all the signal energy through. If you then add a local oscillator offset of 20ppm which is the worst case difference in transmitter and receiver local oscillator frequencies  the AFC bandwidth is too small by some way.

I think the RadioHead default modem settings use way to high frequency deviation settings, probably to try to achieve a high modulation index, but a MI of 2 should be a good choice. If people are getting poor range this could be the reason.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5850
  • Country: us
    • LowPowerLab
Re: Definition of RxBw with RFM69
« Reply #7 on: November 26, 2015, 10:14:20 PM »
Good discussion, I would add that there were some real tests performed in this thread for temperature drift, which may add value to this topic although it may feel a bit offtopic with regards to RxBw.
Also if anyone that understands the RF technicalities better than the rest of us and would be willing to come up with a few tuned/optimized (and tested) set of settings for low bitrates as well as high, that would be really great.

perky

  • Hero Member
  • *****
  • Posts: 871
  • Country: gb
Re: Definition of RxBw with RFM69
« Reply #8 on: November 27, 2015, 06:54:11 AM »
Thanks Felix. I hadn't seen that link, but actually adds weight to my assumption that the crystal used on the RFM69 modules is +/-10ppm, which at 868MHz makes LOoffset 20ppm or 17.4kHz.  The data in that link is consistent with this. An individual crystal could be anywhere within this tolerance so measuring just one module is not really representative and could give better results.

The standard low cost high accuracy crystal tolerance appears to be +/-10ppm though, tighter than that and the costs start to rise so this is a fair assumption given the empircal data. I'm really surprised that this data is not in the module specifications, it's actually vital when using narrow band transmission so that the RxBw and RxBwAfc can be calculated properly.

emjay

  • Full Member
  • ***
  • Posts: 120
  • Country: nl
Re: Definition of RxBw with RFM69
« Reply #9 on: November 27, 2015, 08:31:31 AM »
@perky,

Remember that the typical crystal spec is +/- 10ppm when selected from the manufacturing run at the vendor. You need to add on further variations:

  • One time frequency "jump" from the stress of reflow
  • One time board level installation variation due to track/placement tolerances and RF chip tolerances
  • Temperature variation (well understood e.g as noted in that reference)
  • Crystal aging - slow, usually monotonic drift as the crystal gets used
  • Vdd dependency if Vdd is direct from a fading battery rather than an LDO

Fortunately these are not all in the same direction, so some error cancelling goes on. 
The bottom line is that if you really need the narrowest bandwidths, you need some meta-scheme to track and adjust the actual offsets for long term reliability, especially in an increasingly busy ISM band.
Simply widening the RxBwAfc risks trouble from false signal capture.

This is why there are not a set of universal "magic numbers" for narrow bandwidth/low baudrate links.

You mentioned your design is for a commercial product - doesn't this suggest you can ask SemTech for guidance directly?


perky

  • Hero Member
  • *****
  • Posts: 871
  • Country: gb
Re: Definition of RxBw with RFM69
« Reply #10 on: November 27, 2015, 10:40:40 AM »
Yes, that isn't an exhaustive list either. Stability of any load capacitors used (internal or external to the chip), linearity of crystal driver in the chip etc. On top of that this ppm value is statistical in that some (very few) might fall just outside of it.

I know in my system I'm not running over the whole temperature range of the module and Vdd is well regulated, even then I've added some margin to the calcs. It's the best I can do without actual specifications and additional information. BTW I'm not talking very narrow band here, my devation is set to 15kHz with 14.4kHz bit rate at the moment (MI of 2.47).

Although this is a commercial product it won't be big enough to get direct support from the manufacturers, I may get some limited support from distributors.
« Last Edit: November 27, 2015, 10:44:07 AM by perky »

WhiteHare

  • Hero Member
  • *****
  • Posts: 1297
  • Country: us
Re: Definition of RxBw with RFM69
« Reply #11 on: December 26, 2015, 10:33:46 AM »
In the absence of information about all the detailed factors (listed above) that might influence a "proper" calculation, what is nonetheless a reasonable number to use for Fdev if using FSK and BitRate=1200?

Extrapolating from the  RadioHead RF69 library pre-configured settings, the answer would be 2.4khz.  However, as noted in the discussion above, that number is suspect.  What would be a better number to use?

According to the RFM69 datasheet (section 3.3.3 FSK Modulation),

Fdev = Fstep x Fdev(13,0)

That formula answers the question most directly, but what are Fstep and Fdev(13,0)?  According to Table 5, Fstep has a typical value of 61Hz.  But what the heck does Fdev(13,0) refer to?

Looking at the RFM69's default values for possible insight, the default bitrate is 4.8kbps  and the default Fdev is 5Khz.  That suggests that for FSK and BitRate=1200, maybe Fdev can be much closer to 1200Hz than the 2400Hz extrapolated from the preconfigured values in RadioHead's RF69 library.

According to Section 3.4.11 on the FSK Demodulator, it is "most efficient" (whatever that means) when (2xFdev)/Bitrate is between 0.5 and 10.  If that's the primary consideration, then Fdev could be as low as 601 (because there's another rule which says Fdev must be greater than 600).

The 20db bandwidth is given as (2 x (Fdev + BitRate/2)), but I'm stuck without knowing what Fdev should be.  Can anyone here provide any guidance, or at least explain what Fdev(13,0) refers to?
« Last Edit: December 26, 2015, 11:54:44 AM by WhiteHare »

perky

  • Hero Member
  • *****
  • Posts: 871
  • Country: gb
Re: Definition of RxBw with RFM69
« Reply #12 on: December 26, 2015, 05:13:03 PM »
Fdev(13,0) in that equation is the full value in registers RegFdevMsb (register 0x05, containing bits 13-8), and RegFdevLsb (register 0x06, containg remaining bits 7-0).

You need to satisfy 0.5 > (2*Fdev/BR) < 10. I.e. modulation index must be between 0.5 and 10.

RxBw value must be half of the transmitted 20bB signal bandwidth, or greater, since RxBw is a single side bandwidth and there are two sidebands. so RxBw >= Fdev + BR/2.

RxBwAfc value must also take into account offset of TX and RX due to local oscillator difference, i.e. greater than Fdev + BR/2 + LOoffset.

Fstep is not exactly 61, the actual formula is FXOSC/2^19, or 61.03515625. This is important when calculating the actual frequency to transmit or receive on, the small fraction after the decimal point will offset your frequencies if ignored.

So I'll try to answer your question regarding a 'reasonable number for Fdev if using FSK and BitRate=1200'. Presumably you want RxBw and RxBwAfc to be as small as possible with narrow band transmission and therefore using AFC to increase sensitivity. I'll also assume 433MHz for the LOoffset calculation. So the following should work (untested, but I have no reason to believe these won't work from the data in the datasheet):

LOoffset = 20ppm @ 433MHz, = 8.66kHz.
RxBw = 2.6kHz, Fdev 1.1kHz, RxBwAfc = 10.4kHz, BR = 1.2kHz

Note that the LOoffset widens the RxBxAfc bandwidth considerably, this offset therefore has a major influence on sensitivity. Personally I feel a little uneasy at such low deviations, especially as the AFC is 'lumpy', so I think I'd probably sacrifice a bit of receiver bandwidth for greater deviation:

LOoffset = 20ppm @ 433MHz, = 8.66kHz.
RxBw = 3.9kHz, Fdev 2.4kHz, RxBwAfc = 12.5kHz, BR = 1.2kHz

Mark.
« Last Edit: December 26, 2015, 05:15:11 PM by perky »

WhiteHat

  • Newbie
  • *
  • Posts: 2
Re: Definition of RxBw with RFM69
« Reply #13 on: December 27, 2015, 01:22:33 AM »
@perky,

How did you arrive at:
RxBw = 2.6kHz, Fdev 1.1kHz, RxBwAfc = 10.4kHz
for the first set of numbers?  Also, how did you arrive at:
RxBw = 3.9kHz, Fdev 2.4kHz, RxBwAfc = 12.5kHz
for the second set of numbers?

In my case I'm using 915Mhz, so
LOoffset = 20ppm@915Mhz = 18,300
« Last Edit: December 27, 2015, 01:30:22 AM by WhiteHat »

perky

  • Hero Member
  • *****
  • Posts: 871
  • Country: gb
Re: Definition of RxBw with RFM69
« Reply #14 on: December 27, 2015, 06:56:24 AM »
RxBw and RxbwAfc can only have discrete values as given in the table in the datasheet and your goal is to keep these bandwidths as low as possible. The bit rate is already defined as 1200, and LOoffset is already defined. So if you pick an RxBw from the table the only variable you have left to fiddle with is Fdev to meet all of the constraints. I did it by trial and error, but this is a job for a spreadsheet really.