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

Added digital synapses, fixed filter test #819

Merged
merged 1 commit into from
Aug 27, 2015
Merged

Conversation

hunse
Copy link
Collaborator

@hunse hunse commented Aug 20, 2015

Added ability to specify linear synapses with digital coefficients
directly, since it can often be easier to design filters directly
in the digital domain.

Fixed the test of general linear filters to use much more stable
(less extreme) coefficients, so that backends with more limited
precision can still pass the test.

@hunse hunse added this to the 2.1.0 release milestone Aug 20, 2015
@tbekolay
Copy link
Member

Haha, I have the exact same change in one of my local branches, only with discrete=False as the default instead of analog=True. I have no real preference one way or the other, though, so this looks good to me!

num = num.flatten()

if den[0] != 1.:
raise ValueError("First element of the denominator must be 1")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scipy.lifter handles this by normalizing num and den by den[0] if it isn't 1. Should we adopt that instead? Personally, I spent a buttload of time trying to debug my filter because of this issue, so I'm in favour of the ValueError, just wanted to raise it as another possibility.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just keep the ValueError, because it's nice and explicit if users have to normalize it themselves. Any filters designed using the Scipy functions should already have this property, anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, agreed.

@tbekolay
Copy link
Member

LGTM! Just curious about your thoughts on the inline comment.

@tbekolay
Copy link
Member

Added changelog entry (bfed8de). Will merge on your +1 @hunse!

@hunse
Copy link
Collaborator Author

hunse commented Aug 27, 2015

Looks good!

Added ability to specify linear synapses with digital coefficients
directly, since it can often be easier to design filters directly
in the digital domain.

Fixed the test of general linear filters to use much more stable
(less extreme) coefficients, so that backends with more limited
precision can still pass the test.
@tbekolay tbekolay merged commit f6318cf into master Aug 27, 2015
@tbekolay tbekolay deleted the digital-synapses branch August 27, 2015 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants