Hello,
I am testing a DVB-T USB key including the Elonics E4000 chipset and I want to check the sampling rate of this card. I set up the sampling rate at 2.048 Ms/s (rtlsdr_set_sample_rate), and my storing buffer is 8*1024 bytes, so I expect receiving 1024 I/Q samples every 500 microseconds. I am using the rtlsdr_read_async function to read the samples. Unfortunately the loop in my program indicates that 8*1024 bytes are read every 2 milliseconds. I am using the gettimeofday function to measure the time in microseconds. Does this result mean that the best I can do is to read some samples every 2 ms at 2.048 Ms/s. This would mean that I am missing 1.5 ms of signal. Is that correct or I am doing something wrong ?
Thanks for your help. Frederic
_________________________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, France Telecom - Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, France Telecom - Orange is not liable for messages that have been modified, changed or falsified. Thank you.
Hi,
and my storing buffer is 8*1024 bytes, so I expect receiving 1024 I/Q samples every 500 microseconds.
This looks awefully small, try a larger buffer ... too small buffers cause too much overhead and can cause overruns ... default buffer size is 262144 , try with that.
Cheers,
Sylvain
Thanks for your answer. I increased the size of the output buffer but, I'm still having the problem. With a buffer of 262144 bytes, at 2.048 Ms/s, it should be full every 16ms, but my program indicates 64ms. Could it be due to a limitation on USB ports, or on my Device (Terratec Cinergy TStick RC) ?
Cheers Frederic
-----Message d'origine----- De : Sylvain Munaut [mailto:246tnt@gmail.com] Envoyé : lundi 17 décembre 2012 10:26 À : EVENNOU Frederic OLNC/OLPS Cc : osmocom-sdr@lists.osmocom.org Objet : Re: Information about the sampling rate of the RTLSDR driver
Hi,
and my storing buffer is 8*1024 bytes, so I expect receiving 1024 I/Q samples every 500 microseconds.
This looks awefully small, try a larger buffer ... too small buffers cause too much overhead and can cause overruns ... default buffer size is 262144 , try with that.
Cheers,
Sylvain
_________________________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, France Telecom - Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, France Telecom - Orange is not liable for messages that have been modified, changed or falsified. Thank you.
Hi,
I increased the size of the output buffer but, I'm still having the problem. With a buffer of 262144 bytes, at 2.048 Ms/s, it should be full every 16ms, but my program indicates 64ms. Could it be due to a limitation on USB ports, or on my Device (Terratec Cinergy TStick RC) ?
Well actually ... now that I rechecked, I think the problem is your math :)
262144 bytes / (2048000 samples/s * 2 bytes / sample ) = 64 ms.
Cheers,
Sylvain
Hello Frederic,
Each sample is I and Q with 8 bit each. That is 2 bytes. When you sample at 2.048 Ms/s you get 4096 bytes/ms so your observation that it takes 2 ms to fill the buffer is fine:-)
The buffer size is not critical. In my project Linrad it is a user parameter because small buffers may be useful for radio amateurs who want a small delay from antenna to loudspeaker when doing two-way communication while larger bufers may be helpful on slower computers.
I tried buffers from 2048 bytes to 524288 without errors on a fast computer.
You are not doing anything wrong:-)
Leif
Hello,
I am testing a DVB-T USB key including the Elonics E4000 chipset and I want to check the sampling rate of this card. I set up the sampling rate at 2.048 Ms/s (rtlsdr_set_sample_rate), and my storing buffer is 8*1024 bytes, so I expect receiving 1024 I/Q samples every 500 microseconds. I am using the rtlsdr_read_async function to read the samples. Unfortunately the loop in my program indicates that 8*1024 bytes are read every 2 milliseconds. I am using the gettimeofday function to measure the time in microseconds. Does this result mean that the best I can do is to read some samples every 2 ms at 2.048 Ms/s. This would mean that I am missing 1.5 ms of signal. Is that correct or I am doing something wrong ?
Thanks for your help. Frederic
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, France Telecom - Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, France Telecom - Orange is not liable for messages that have been modified, changed or falsified. Thank you.
Thanks for your help. I though IQ samples were encoded on 8 bytes. This explains my error.
Cheers Frederic
-----Message d'origine----- De : osmocom-sdr-bounces@lists.osmocom.org [mailto:osmocom-sdr-bounces@lists.osmocom.org] De la part de Leif Asbrink Envoyé : lundi 17 décembre 2012 14:53 À : osmocom-sdr@lists.osmocom.org Objet : Re: Information about the sampling rate of the RTLSDR driver
Hello Frederic,
Each sample is I and Q with 8 bit each. That is 2 bytes. When you sample at 2.048 Ms/s you get 4096 bytes/ms so your observation that it takes 2 ms to fill the buffer is fine:-)
The buffer size is not critical. In my project Linrad it is a user parameter because small buffers may be useful for radio amateurs who want a small delay from antenna to loudspeaker when doing two-way communication while larger bufers may be helpful on slower computers.
I tried buffers from 2048 bytes to 524288 without errors on a fast computer.
You are not doing anything wrong:-)
Leif
Hello,
I am testing a DVB-T USB key including the Elonics E4000 chipset and I want to check the sampling rate of this card. I set up the sampling rate at 2.048 Ms/s (rtlsdr_set_sample_rate), and my storing buffer is 8*1024 bytes, so I expect receiving 1024 I/Q samples every 500 microseconds. I am using the rtlsdr_read_async function to read the samples. Unfortunately the loop in my program indicates that 8*1024 bytes are read every 2 milliseconds. I am using the gettimeofday function to measure the time in microseconds. Does this result mean that the best I can do is to read some samples every 2 ms at 2.048 Ms/s. This would mean that I am missing 1.5 ms of signal. Is that correct or I am doing something wrong ?
Thanks for your help. Frederic
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, France Telecom - Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, France Telecom - Orange is not liable for messages that have been modified, changed or falsified. Thank you.
_________________________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, France Telecom - Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, France Telecom - Orange is not liable for messages that have been modified, changed or falsified. Thank you.