-
Notifications
You must be signed in to change notification settings - Fork 0
feat(stream.streamg3_on): Set filter parameters. #457
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
Conversation
942906c to
7cfff95
Compare
jlashner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Tristan, thanks for this! It looks good for the most part, see comments below. Mainly I think we need to talk with Matthew / Max about whether its ok to start specifying filter behavior using filter_cutoff if that means the default filter parameters don't match exactly what's currently used.
We'll also want to investigate what filter cutoff was used to generate the default parameters that we currently use.
|
Thanks for the comments! Between the two options of specifying the filter parameters as coefficients or order/frequency I chose the latter because it seems more user-friendly, but I agree it's less obvious that it guarantees the standard behaviour. I have investigated how the filter parameters are generated, and the ones I put in the defaults reproduce the filter parameters from |
|
But I'm also happy to store the filter coefficients in the device config and have a user pass order / cutoff to the function. I guess it isn't super clear to me if the device config is meant to be user-facing or not. |
|
Ah ok that's great! If this produces the exact same filter params then I don't see any problem with setting the default using the cutoff freq like you're doing here. Thanks for checking! |
|
I've confirmed that the filter parameters in the device config produce the default coefficients on a live SMuRF system now. The coefficients queried before running and after I also checked that they are different if I change the cutoff frequency :) |
7cfff95 to
8b08481
Compare
|
@swh76 may have an opinion on this change? |
|
Great. We should also check with shawn / make sure we test this, but I believe its ok that we don't pad with zeros when we update the filter params. I think that is just done so the initial buffer is set to a large enough length. |
A few comments upstream I checked that the parameters were exactly the same as before using the default values stored in the config. I haven't looked at any data, do you think that is necessary? |
I think what you checked above seems good. But I have Jack's same uncertainty about the zero padding. Perhaps to stay consistent we zero pad the arrays? |
I think this is just a quirk of EPICS (see here). The actual filter doesn't care about the length (here). The fact I was able to set it and it didn't complain suggests that EPICS is happy without zero-padding. Would still be nice to get @swh76 opinion. |
|
Should we go ahead and merge? In any case, one reviewer will need to approve :) |
msilvafe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to hold ya up!
I've yet to test this on a SMuRF system (working on getting that going), and that will involve confirming that I've correctly set the default filter parameters, but I figured it would be useful in the meantime to get feedback on how I've implemented this.