Fix start values of FIIR
and Biquad filter to second sample
#52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the current implementation of the
![image](https://private-user-images.githubusercontent.com/46198814/395827408-616b5586-2c34-441d-b4e1-0011cd2990ff.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NDMwMzIsIm5iZiI6MTczOTQ0MjczMiwicGF0aCI6Ii80NjE5ODgxNC8zOTU4Mjc0MDgtNjE2YjU1ODYtMmMzNC00NDFkLWI0ZTEtMDAxMWNkMjk5MGZmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDEwMzIxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFkYTZhMjAwZTdkZmJjZjY5MjJiMGMwYjQyOTZiZjU4ZDAxYTk1OTlmMDkzMWI4ZWVmNjFiMTViYjdjN2U2MWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.-BJrhcqFpAjDSEM5oVii4f2i4TNweR_zwVmtxxsL7eI)
![image](https://private-user-images.githubusercontent.com/46198814/395827518-c88b4e78-2e27-47e5-9157-fbbdfebbc297.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NDMwMzIsIm5iZiI6MTczOTQ0MjczMiwicGF0aCI6Ii80NjE5ODgxNC8zOTU4Mjc1MTgtYzg4YjRlNzgtMmUyNy00N2U1LTkxNTctZmJiZGZlYmJjMjk3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDEwMzIxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdlNmNkN2U1OGE1YjVjYTM3YjJiOTdiMGFlYmQ3ZWFjNTMxMjY5NTgzMWI0OGE5MTc4MDA5ZGFkOGVhMzY4ZjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.RoN0w6Bh0xIJExoEYS_OJUZLiuls4SPdypXizZfnTKo)
FIIR
andBiquad
filters, the first sample is off since the algorithms starts with an initial state ofzero(T)
. This creates unwanted behavior e.g. for theDifferentiatorFilter
:The fix sets the first sample to the value of the second sample to avoid this behavior: