Skip to content

Can't reach target sampling rate. #155

@gaviniscool

Description

@gaviniscool

I am not sure why I can't reach target sampling rate by the following code:

import time

sdr.sample_rate = 2.048e6 
sample_num = 1024 * 128
iq = []
n=100   #n cycles
tic = time.time()

for _ in range(1,n+1):
    iq.extend(sdr.read_samples(sample_num))

toc = time.time()
dt = toc-tic
sr = len(iq)/dt
print(f'sample rate setting: {sdr.sample_rate}, actual sample rate = {sr}')

result:
sample rate setting: 2048000.0, actual sample rate = 1888409.6998254296

I could only reach target fro samplle_rate<=300KHz

Is there any way I could omptimize my code?
Should I jump to stream(), which read sample in a async way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions