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

update tria function #224

Merged
merged 2 commits into from
May 17, 2024
Merged

update tria function #224

merged 2 commits into from
May 17, 2024

Conversation

suvanbanerjee
Copy link
Contributor

Changed the function to abs(x % 4 - 2) and span to [0, 4]
@bessman I don't have the required hardware to record the serial traffic.
Closes #218

@suvanbanerjee
Copy link
Contributor Author

@bessman please confirm is this correct or I have to do something else.

@bessman
Copy link
Collaborator

bessman commented May 16, 2024

There is some kind of problem with the new implementation. Blue curve is old, orange is new:
update_tria

I can't immediately see what the problem is. I'll give it a think and get back to you.

@bessman
Copy link
Collaborator

bessman commented May 17, 2024

Only the span should be changed, not the function. The -1 in the function is necessary to get correct analog offset; pslab-android corrects for this offset in loadTable instead.

Please revert the change to tria, but keep the new span. Replace the recorded test data (tests/recordings/waveform_generator/test_triangle_wave.json) with this updated recording: test_triangle_wave.json

Verify that the test passes (pytest -k test_triangle_wave), then update the PR.

@suvanbanerjee suvanbanerjee marked this pull request as ready for review May 17, 2024 11:04
@suvanbanerjee
Copy link
Contributor Author

@bessman test are working fine
image

@bessman bessman merged commit e0da861 into fossasia:development May 17, 2024
5 of 6 checks passed
@bessman
Copy link
Collaborator

bessman commented May 17, 2024

Good work, thanks!

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

Successfully merging this pull request may close these issues.

Update triangle waveform function to match pslab-android
2 participants