Afedri ppm setting

92 views
Skip to first unread message

Ramiro Aceves

unread,
Dec 7, 2015, 2:46:30 AM12/7/15
to LINRAD

Hi Leif and others,

I am using Linrad 4.08pre and one channel Afedri-Net SDR.

It seems to be some confusion in frequency adjust. Linrad asks for ppm but the xyzt number seems to be ppb. After configuration, it says ppb in the input summary settings.

Another thing. Changing the two least significant digits makes no effect. For example, 2458 does same effect as 2499. Changing the most significant digits seems to have effect. So, I can change only in 0,5 ppm steps.

Thanks so much.

Ramiro, EA4NZ

Leif Asbrink

unread,
Dec 7, 2015, 10:19:33 AM12/7/15
to lin...@googlegroups.com
Hi Ramiro,

The correction is in ppb. I have corrected the setup.
(long ago it was ppm)

The Afedri API steps the frequency in steps of 1 Hz.

If you want accurate calibration, compute the frequency
Linrad asked the Afedri to set.

Multiply the frequency in the frequency box with
(1+0.000000001*correction) and truncate to an integer.

Then compute the correction in ppm using this value.
If you feed in the least significant digits you would find
that the calibration is ok also at 30 MHz where 0.5
ppm is 15 Hz and perhaps not quite what you want.

73

Leif
> --
> You received this message because you are subscribed to the Google Groups "Linrad" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linrad+un...@googlegroups.com.
> To post to this group, send email to lin...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Ramiro Aceves

unread,
Dec 9, 2015, 2:52:43 AM12/9/15
to LINRAD

Thanks Leif, I have svn up to the latest version and ppb is shown ok.

I have discovered something. I perfectly calibrated the system frequency at 10 MHz using the GPSDO. Then I tuned to 77.5 kHz to watch the DCF77 station. I expected a perfectly frequency accuracy but the DCF stacion was something like 0.2 Hz up, 2.5 ppm error.

Thanks,

Ramiro.EA4NZ

al...@4z5lv.net

unread,
Dec 9, 2015, 3:19:47 AM12/9/15
to Linrad
Ramiro,
0.2Hz from 10Mhz it is not 2.5ppm, 2.5ppm from 10Mhz it is 25Hz. in your case error is
0.02ppm = 20 ppb

When calibrating SDR error is calculated for main clock oscillator - i.e value around 80Mhz
And please take in account that there will be thermal drift of main Clock oscillator.

Ramiro Aceves

unread,
Dec 9, 2015, 4:36:43 AM12/9/15
to LINRAD
Hi Alex,

The error of 0.2 Hz was measured in  77.5 kHz, so it is 2.58 ppm.
Yes, I have noticed thermal drifts as my room heating system siwtches ONn and OFF, something like 5 Hz at 10 MHz. It is quite normal.

73, Ramiro.




al...@4z5lv.net

unread,
Dec 9, 2015, 8:33:12 AM12/9/15
to Linrad
Ramiro,
Please check that you are using correct (for your AFEDRI SDR main clock value) sample rate, the value that is not correct can cause error that is increasing when you approaching band edges and minimal (or zero) when you in the middle of reception bandwidth.

73

Ramiro Aceves

unread,
Dec 9, 2015, 9:29:03 AM12/9/15
to LINRAD
Hi

My Afedri clock is 80 MHz. Sample rate is 100 kHz. Last night  I checked the DCF77 in several zones of the screen from the center to the edges and the error was the same. Tonight I will recheck everything to avoid any errors.

Many thanks.
Ramiro.
EA4NZ.
 

al...@4z5lv.net

unread,
Dec 9, 2015, 10:28:31 AM12/9/15
to Linrad
If you have the same error on whole bandwidth - you can ignore my information about sample rate, 100kHz is correct for 80Mhz clock.

Ramiro Aceves

unread,
Dec 9, 2015, 10:31:54 AM12/9/15
to LINRAD
Many thanks, Alex.

Tonight I will recheck everything slowly. First I will calibrate ppm setting at 10 MHz, then see if DCF77 station at 77.5 kHz is in place.

73, Ramiro.

Leif Asbrink

unread,
Dec 9, 2015, 11:42:32 AM12/9/15
to lin...@googlegroups.com
Hi Ramiro,

The Afedri frequency control is in steps of 1 Hz (like several
other SDR hardware.)
At 77.5 kHz you should expect an error between -0.1 and 1.0 Hz

I have subtracted the rounding error from the frequency in the
baseband. I do not know whether there is any rounding or truncation
inside the Afedri, but I would not think so.

Please try the latest on the repo.

73

Leif

Ramiro Aceves

unread,
Dec 9, 2015, 11:58:57 AM12/9/15
to LINRAD
Hello Leif,

Thanks so much. I will try tonight the latest.

I have just been reading the Afedri 8201 datasheet and says something like:

f=Fclock*(Freq_word/2^32)

where Freq_Word is a 32 bit number for programming the NCO.

That would allow smaller steps. But perhaps I am missing something cause my understanding of this subject is very limited.

For a 80 MHz clock:

80e6*(536870912/2^32)= 10000000

80e6*(536870913/2^32)= 10000000.0186265


A 18.6 mHz step.


Sure I am saying silly things, I just would like to understand it :-)

Thanks.


Ramiro.








al...@4z5lv.net

unread,
Dec 9, 2015, 12:21:25 PM12/9/15
to Linrad
Ramiro,
AFEDRI SDR-Net has 1Hz resolution , I see no any sense to make 18mHz , such precision can cost to much money in real life implementation :-)

73!

Ramiro Aceves

unread,
Dec 9, 2015, 4:15:49 PM12/9/15
to lin...@googlegroups.com
Hi Leif,

I have just svn up and compiled. Linrad does not work ok, something is
wrong with tunning. I first tunned to 100 kHz and Afedri seemed to be
deaf, but as soon as I started to enter more frequencies, I noticed a
strange behaviour, I realized that waterfall was symetric respect the
center frequency. I do not know if you broke something.

Thanks Leif.




El 09/12/15 a las 18:38, Leif Asbrink escribió:

Ramiro Aceves

unread,
Dec 10, 2015, 2:57:49 AM12/10/15
to LINRAD

Thanks Alex, I understand.

Just wanted to know the reason of the 1 Hz restriction having a hardware that is capable of 18 mHz programming steps. Just a concept, not an actual need.

Thanks

73,  Ramiro

Leif Asbrink

unread,
Dec 10, 2015, 8:21:58 AM12/10/15
to lin...@googlegroups.com
Hi Ramiro,

I am sorry, I had tested only on my single channel Afedri which
has only USB mode. I have now corrected the mistake for
Net Afedri (and SDR-IP)

73

Leif

Leif Asbrink

unread,
Dec 10, 2015, 8:51:25 AM12/10/15
to lin...@googlegroups.com
Hi Ramiro,

Why would you want to set the center frequency with better accuracy than 1 Hz?
For any purpose I know of a 1 kHz stepping would be fully adequate.
Fine tuning with 1 mHz or less can be done in the baseband.

The meaning of the 18 mHz is that when one asks for a specific
frequency there will be a truncation error (or rounding error)
from f=Fclock*(Freq_word/2^32)

This error can of course be computed and compensated for, but I
consider that to be overkill considering the stability of the
Afedri.

You might look in afedri.c how fg_truncation_error is computed
and add the appropriate correction for the Afedri chip. If you
report that it works I will include the correction. Note that
fg_truncation_error is computed separately for network and USB.
Maybe adding the Afedri error would be meaningful on VLF.

73

Leif

Ramiro Aceves

unread,
Dec 10, 2015, 10:55:09 AM12/10/15
to LINRAD
Great Leif, I will try tonight when return from my job.

73, Ramiro.

Ramiro Aceves

unread,
Dec 10, 2015, 11:23:14 AM12/10/15
to LINRAD
Hi Leif

Thanks for answering, please see below.

2015-12-10 15:47 GMT+01:00 Leif Asbrink <le...@sm5bsz.com>:
Hi Ramiro,

Why would you want to set the center frequency with better accuracy than 1 Hz?
For any purpose I know of a 1 kHz stepping would be fully adequate.
Fine tuning with 1 mHz or less can be done in the baseband.


Oh, yes, of course that is fine, I can set the frequency at 1 kHz, 5kHz or 20 kHz steps  and after that, I tune with my mouse in the baseband graph in very small steps, that is not a problem. The problem is that the shown  frequency is not true. I calibrated Linrad frequency to be accurate at 10.000.000 Hz using the GPSDO as a signal source. Inmediatly after that, I tuned to 77500 Hz  DCF77 station and if appeared 0.2 Hz off. I expected no error cause if at 10 MHz the error was near zero, at 77.5 kHz, a frequency 129.03 times smaller frequency, the error would be 129.03 times smaller.

The purpose of accurate frequency is to do this kind of contest:

I did not know that contest but a friend of mine told me that it existed.

My idea to  get started in that kind of contest was first tune Linrad to hear my GPSDO at 10 MHz. As Afedri drifts with temperature, take note of the indicated frequency and calculate the error. After that, quickly retune to the unknown station, take note of the Linrad indicated frequency, apply the error correction  by hand and calculate the real frequency.

 
The meaning of the 18 mHz is that when one asks for a specific
frequency there will be a truncation error (or rounding error)
from f=Fclock*(Freq_word/2^32)


Yes, 18 mHz is very small error, It would be very good for me. The problem is that after a 10 MHz calibration and tune to the DCF station, the calibration is not good, there is an error oh 200 mHz. Sorry for my poor english, I feel that perhaps I am not explaining it right. Also sorry cause my understanding of this subject is very limited.


Thanks so much.

73, Ramiro. EA4NZ.



Ramiro Aceves

unread,
Dec 10, 2015, 4:31:59 PM12/10/15
to lin...@googlegroups.com
El 10/12/15 a las 15:47, Leif Asbrink escribió:
> Hi Ramiro,
>

Hello Leif!

Very good, I have svn up and compiled again. I have calibrated Linrad
against the 10 MHz GPSDO. I think I have "finer grain" ppb adjust now.
And the good thing, now the 77.5 kHz signal is almost perfect placed
over the 77.7 kHz mark!

Thanks so much!!

Ramiro.

Leif Asbrink

unread,
Dec 10, 2015, 10:09:16 PM12/10/15
to lin...@googlegroups.com
Hi Ramiro,

I made an attempt to correct for the rounding error in the Afedri chip.
I set my signal generator to 10 kHz to make the frequency low enough to
make the stability a non-issue. It seems that the rounding error
causes a frequency shift of +/- 5 mHz. When I try to evaluate it
I find +/- 1.5 mHz.(??)

I have used sampling rate 80 kHz, bandwidth reduction=8 for a baseband
sampling rate of 312.5 Hz. With a fft3 size of 32768 the time for a
single transform is 104 seconds and with a cosine window the resolution
(3 dB bandwidth) is about 13 mHz.

This is what I find:

Fcenter Fbaseb
20 10.000107
19 10.000104
18 10.000104
17 10.000098
16 10.000102
20 10.000107

The uncertainty is something like 2 mHz and the differences are real -
presumably caused by rounding or truncation errors in the hardware.

For these tests I increased the number of digits in the frequency readout
when the baseband hz/pixel is below 0.1 Hz. (Now on the repo.)


73

Leif

Ramiro Aceves

unread,
Dec 11, 2015, 3:47:09 AM12/11/15
to LINRAD
Thanks so much Leif.

This is great! This morning before coming to my job  I updated and recompiled Linrad and noticed the digit number increase until mHz resolution in the baseband reading. That is amazing and extremely useful. I was about asking you to do it and you have done it without asking!

This is an superb technical support! :-)

I will play tonight with it.

Thank you very much.

73, Ramiro.
EA4NZ.




Ramiro Aceves

unread,
Dec 13, 2015, 2:46:16 AM12/13/15
to LINRAD
Hi,

Just to say that it works perfectly. Resolution is enough !

Many thanks.


73, Ramiro. EA4NZ


El 11/12/15 a las 09:47, Ramiro Aceves escribió:
> Thanks so much Leif.
>
> This is great! This morning before coming to my job I updated and
> recompiled Linrad and noticed the digit number increase until mHz
> resolution in the baseband reading. That is amazing and extremely
> useful. I was about asking you to do it and you have done it without asking!
>
> This is an superb technical support! :-)
>
> I will play tonight with it.
>
> Thank you very much.
>
> 73, Ramiro.
> EA4NZ.
>
>
>
>
> 2015-12-11 5:05 GMT+01:00 Leif Asbrink <le...@sm5bsz.com
> <mailto:le...@sm5bsz.com>>:
> <mailto:linrad%2Bunsu...@googlegroups.com>.
> To post to this group, send email to lin...@googlegroups.com
> <mailto:lin...@googlegroups.com>.
Reply all
Reply to author
Forward
0 new messages