Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using requested sample rate when computing number of samples to acquire #121

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scos_actions/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "10.0.1"
__version__ = "10.0.2"
3 changes: 2 additions & 1 deletion scos_actions/actions/acquire_single_freq_tdomain_iq.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ def __init__(self, parameters: dict):
self.frequency_Hz = get_parameter(FREQUENCY, self.parameters)
self.classification = get_parameter(CLASSIFICATION, self.parameters)
self.cal_adjust = get_parameter(CAL_ADJUST, self.parameters)
self.requested_sample_rate = get_parameter(SAMPLE_RATE, self.parameters)

def execute(self, schedule_entry: dict, task_id: int) -> dict:
# Use the sigan's actual reported instead of requested sample rate
sample_rate = self.sensor.signal_analyzer.sample_rate
sample_rate = self.requested_sample_rate
num_samples = int(sample_rate * self.duration_ms * 1e-3)
measurement_result = self.acquire_data(
num_samples, self.nskip, self.cal_adjust, cal_params=self.parameters
Expand Down
3 changes: 2 additions & 1 deletion scos_actions/actions/acquire_stepped_freq_tdomain_iq.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
DURATION_MS,
FREQUENCY,
NUM_SKIP,
SAMPLE_RATE,
SingleFrequencyTimeDomainIqAcquisition,
)
from scos_actions.hardware.sensor import Sensor
Expand Down Expand Up @@ -98,7 +99,7 @@ def __call__(self, sensor: Sensor, schedule_entry: dict, task_id: int):
duration_ms = get_parameter(DURATION_MS, measurement_params)
nskip = get_parameter(NUM_SKIP, measurement_params)
cal_adjust = get_parameter(CAL_ADJUST, measurement_params)
sample_rate = self.sensor.signal_analyzer.sample_rate
sample_rate = get_parameter(SAMPLE_RATE, measurement_params)
num_samples = int(sample_rate * duration_ms * 1e-3)
measurement_result = super().acquire_data(
num_samples, nskip, cal_adjust, cal_params=measurement_params
Expand Down
Loading