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

Math feature does not correct support channel names such as voltage0_i and voltage0_q #451

Open
BrentK-ADI opened this issue Sep 22, 2023 · 1 comment
Assignees

Comments

@BrentK-ADI
Copy link

For certain IIO devices (such as the ADRV9002 in MIMO mode), the channel names of the devices are suffixed with _i and _q, while retaining the same channel number.

The eval function in math_expression_generator.h assumes the channel number is unique, and incorrectly selects the index into the channels_data array. For example, the math expression atanf(voltage0_q / voltage0_i) will evaluate to atanf(channels_data[0] / channels_data[0]). Channel selection should likely be based on name rather than assuming unique channel numbers.

for (pos = match; *pos; pos++) {
	if (g_ascii_isdigit(*pos))
		break;
}
if ((size_t)(pos - match) < strlen(match))
	index = atoi(pos);
else
	index = 0;
@cristina-suteu
Copy link
Contributor

Hi,
We are looking into this

@cristina-suteu cristina-suteu self-assigned this Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants