{"action":"created","comment":{"url":"https://api.github.com/repos/scipy/scipy/pulls/comments/22446288","id":22446288,"diff_hunk":"@@ -2024,6 +2074,110 @@ def filtfilt(b, a, x, axis=-1, padtype='odd', padlen=None):\n     return y\n \n \n+def sosfilt(sos, x, axis=-1, zi=None):\n+    \"\"\"\n+    Filter data along one dimension using cascaded second-order sections\n+\n+    Filter a data sequence, `x`, using a digital IIR filter defined by\n+    `sos`. This is implemented by performing `lfilter` for each\n+    second-order section.  See `lfilter` for details.\n+\n+    Parameters\n+    ----------\n+    sos : array_like\n+        Array of second-order filter coefficients, must have shape\n+        ``(n_sections, 6)``. Each row corresponds to a second-order\n+        section, with the first three columns providing the numerator","path":"scipy/signal/signaltools.py","position":98,"original_position":98,"commit_id":"ba0ade453d423ee7a5f1832f7db372ca428ccd94","original_commit_id":"ba0ade453d423ee7a5f1832f7db372ca428ccd94","user":{"login":"endolith","id":58611,"avatar_url":"https://avatars.githubusercontent.com/u/58611?v=3","gravatar_id":"","url":"https://api.github.com/users/endolith","html_url":"https://github.com/endolith","followers_url":"https://api.github.com/users/endolith/followers","following_url":"https://api.github.com/users/endolith/following{/other_user}","gists_url":"https://api.github.com/users/endolith/gists{/gist_id}","starred_url":"https://api.github.com/users/endolith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endolith/subscriptions","organizations_url":"https://api.github.com/users/endolith/orgs","repos_url":"https://api.github.com/users/endolith/repos","events_url":"https://api.github.com/users/endolith/events{/privacy}","received_events_url":"https://api.github.com/users/endolith/received_events","type":"User","site_admin":false},"body":"This should have a more detailed example of the format or link to another function that says it? Like each row is `[b_0, b_1, b_2, a_0, a_1, a_2]`\r\n\r\nI started writing it up here: https://github.com/scipy/scipy/pull/3954/files#diff-bc34cfe49508f8b16faacc64bb77e5f7R733\r\n\r\n","created_at":"2015-01-05T02:56:26Z","updated_at":"2015-01-05T02:56:26Z","html_url":"https://github.com/scipy/scipy/pull/3717#discussion_r22446288","pull_request_url":"https://api.github.com/repos/scipy/scipy/pulls/3717","_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments/22446288"},"html":{"href":"https://github.com/scipy/scipy/pull/3717#discussion_r22446288"},"pull_request":{"href":"https://api.github.com/repos/scipy/scipy/pulls/3717"}}},"pull_request":{"url":"https://api.github.com/repos/scipy/scipy/pulls/3717","id":16837132,"html_url":"https://github.com/scipy/scipy/pull/3717","diff_url":"https://github.com/scipy/scipy/pull/3717.diff","patch_url":"https://github.com/scipy/scipy/pull/3717.patch","issue_url":"https://api.github.com/repos/scipy/scipy/issues/3717","number":3717,"state":"open","locked":false,"title":"ENH: Add second-order sections filtering","user":{"login":"Eric89GXL","id":2365790,"avatar_url":"https://avatars.githubusercontent.com/u/2365790?v=3","gravatar_id":"","url":"https://api.github.com/users/Eric89GXL","html_url":"https://github.com/Eric89GXL","followers_url":"https://api.github.com/users/Eric89GXL/followers","following_url":"https://api.github.com/users/Eric89GXL/following{/other_user}","gists_url":"https://api.github.com/users/Eric89GXL/gists{/gist_id}","starred_url":"https://api.github.com/users/Eric89GXL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eric89GXL/subscriptions","organizations_url":"https://api.github.com/users/Eric89GXL/orgs","repos_url":"https://api.github.com/users/Eric89GXL/repos","events_url":"https://api.github.com/users/Eric89GXL/events{/privacy}","received_events_url":"https://api.github.com/users/Eric89GXL/received_events","type":"User","site_admin":false},"body":"With @endolith, we've put together a working version of second-order sections. Closes #2444.\r\n\r\nThis PR contains:\r\n\r\n1. `sosfilt`, which performs filtering using second-order sections.\r\n\r\n2. `zpk2sos` / `tf2sos` to convert to `sos` format. We might actually want to remove `tf2sos`. I'm worried that users might have filters in `tf` form and think that going to `sos` will reduce numerical error. Forcing them to do `zp2sos(tf2zpk(b, a))` might make them think twice about why there isn't a `tf2sos` function. I'm interested to hear other opinions on this...?\r\n\r\n3. `cplxpair` and `cplxreal`, which are helper functions for dealing with complex conjugate pairings.\r\n\r\nImplementing `filtfilt`-equivalent functionality should be very easy, but I think we should tackle that with #3259 as opposed to adding another function here.\r\n\r\nOne other thing missing is `lfiltic`-equivalent functionality. This will require some state-space gymnastics that I haven't managed to solve (despite some effort). I'll try to figure it out, but I think that could be left to a subsequent PR, especially since this one is already pretty big.","created_at":"2014-06-06T19:06:32Z","updated_at":"2015-01-05T02:56:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53451e2829e2913c6f7cf2d7f909875cfa3a7518","assignee":null,"milestone":{"url":"https://api.github.com/repos/scipy/scipy/milestones/24","labels_url":"https://api.github.com/repos/scipy/scipy/milestones/24/labels","id":792277,"number":24,"title":"0.16.0","description":"","creator":{"login":"rgommers","id":98330,"avatar_url":"https://avatars.githubusercontent.com/u/98330?v=3","gravatar_id":"","url":"https://api.github.com/users/rgommers","html_url":"https://github.com/rgommers","followers_url":"https://api.github.com/users/rgommers/followers","following_url":"https://api.github.com/users/rgommers/following{/other_user}","gists_url":"https://api.github.com/users/rgommers/gists{/gist_id}","starred_url":"https://api.github.com/users/rgommers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgommers/subscriptions","organizations_url":"https://api.github.com/users/rgommers/orgs","repos_url":"https://api.github.com/users/rgommers/repos","events_url":"https://api.github.com/users/rgommers/events{/privacy}","received_events_url":"https://api.github.com/users/rgommers/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":91,"state":"open","created_at":"2014-09-16T21:15:40Z","updated_at":"2015-01-04T18:15:35Z","due_on":"2016-03-30T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/scipy/scipy/pulls/3717/commits","review_comments_url":"https://api.github.com/repos/scipy/scipy/pulls/3717/comments","review_comment_url":"https://api.github.com/repos/scipy/scipy/pulls/comments/{number}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/3717/comments","statuses_url":"https://api.github.com/repos/scipy/scipy/statuses/ba0ade453d423ee7a5f1832f7db372ca428ccd94","head":{"label":"Eric89GXL:sosic","ref":"sosic","sha":"ba0ade453d423ee7a5f1832f7db372ca428ccd94","user":{"login":"Eric89GXL","id":2365790,"avatar_url":"https://avatars.githubusercontent.com/u/2365790?v=3","gravatar_id":"","url":"https://api.github.com/users/Eric89GXL","html_url":"https://github.com/Eric89GXL","followers_url":"https://api.github.com/users/Eric89GXL/followers","following_url":"https://api.github.com/users/Eric89GXL/following{/other_user}","gists_url":"https://api.github.com/users/Eric89GXL/gists{/gist_id}","starred_url":"https://api.github.com/users/Eric89GXL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eric89GXL/subscriptions","organizations_url":"https://api.github.com/users/Eric89GXL/orgs","repos_url":"https://api.github.com/users/Eric89GXL/repos","events_url":"https://api.github.com/users/Eric89GXL/events{/privacy}","received_events_url":"https://api.github.com/users/Eric89GXL/received_events","type":"User","site_admin":false},"repo":{"id":13531922,"name":"scipy","full_name":"Eric89GXL/scipy","owner":{"login":"Eric89GXL","id":2365790,"avatar_url":"https://avatars.githubusercontent.com/u/2365790?v=3","gravatar_id":"","url":"https://api.github.com/users/Eric89GXL","html_url":"https://github.com/Eric89GXL","followers_url":"https://api.github.com/users/Eric89GXL/followers","following_url":"https://api.github.com/users/Eric89GXL/following{/other_user}","gists_url":"https://api.github.com/users/Eric89GXL/gists{/gist_id}","starred_url":"https://api.github.com/users/Eric89GXL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eric89GXL/subscriptions","organizations_url":"https://api.github.com/users/Eric89GXL/orgs","repos_url":"https://api.github.com/users/Eric89GXL/repos","events_url":"https://api.github.com/users/Eric89GXL/events{/privacy}","received_events_url":"https://api.github.com/users/Eric89GXL/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Eric89GXL/scipy","description":"Scipy main repository","fork":true,"url":"https://api.github.com/repos/Eric89GXL/scipy","forks_url":"https://api.github.com/repos/Eric89GXL/scipy/forks","keys_url":"https://api.github.com/repos/Eric89GXL/scipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Eric89GXL/scipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Eric89GXL/scipy/teams","hooks_url":"https://api.github.com/repos/Eric89GXL/scipy/hooks","issue_events_url":"https://api.github.com/repos/Eric89GXL/scipy/issues/events{/number}","events_url":"https://api.github.com/repos/Eric89GXL/scipy/events","assignees_url":"https://api.github.com/repos/Eric89GXL/scipy/assignees{/user}","branches_url":"https://api.github.com/repos/Eric89GXL/scipy/branches{/branch}","tags_url":"https://api.github.com/repos/Eric89GXL/scipy/tags","blobs_url":"https://api.github.com/repos/Eric89GXL/scipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Eric89GXL/scipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Eric89GXL/scipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Eric89GXL/scipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Eric89GXL/scipy/statuses/{sha}","languages_url":"https://api.github.com/repos/Eric89GXL/scipy/languages","stargazers_url":"https://api.github.com/repos/Eric89GXL/scipy/stargazers","contributors_url":"https://api.github.com/repos/Eric89GXL/scipy/contributors","subscribers_url":"https://api.github.com/repos/Eric89GXL/scipy/subscribers","subscription_url":"https://api.github.com/repos/Eric89GXL/scipy/subscription","commits_url":"https://api.github.com/repos/Eric89GXL/scipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Eric89GXL/scipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Eric89GXL/scipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Eric89GXL/scipy/issues/comments/{number}","contents_url":"https://api.github.com/repos/Eric89GXL/scipy/contents/{+path}","compare_url":"https://api.github.com/repos/Eric89GXL/scipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Eric89GXL/scipy/merges","archive_url":"https://api.github.com/repos/Eric89GXL/scipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Eric89GXL/scipy/downloads","issues_url":"https://api.github.com/repos/Eric89GXL/scipy/issues{/number}","pulls_url":"https://api.github.com/repos/Eric89GXL/scipy/pulls{/number}","milestones_url":"https://api.github.com/repos/Eric89GXL/scipy/milestones{/number}","notifications_url":"https://api.github.com/repos/Eric89GXL/scipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Eric89GXL/scipy/labels{/name}","releases_url":"https://api.github.com/repos/Eric89GXL/scipy/releases{/id}","created_at":"2013-10-13T01:20:02Z","updated_at":"2014-07-16T19:56:02Z","pushed_at":"2014-12-31T14:12:17Z","git_url":"git://github.com/Eric89GXL/scipy.git","ssh_url":"git@github.com:Eric89GXL/scipy.git","clone_url":"https://github.com/Eric89GXL/scipy.git","svn_url":"https://github.com/Eric89GXL/scipy","homepage":"http://scipy.org/","size":49912,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scipy:master","ref":"master","sha":"08238a5cde818263a4e165d39bf3d2b233ff8dc8","user":{"login":"scipy","id":288277,"avatar_url":"https://avatars.githubusercontent.com/u/288277?v=3","gravatar_id":"","url":"https://api.github.com/users/scipy","html_url":"https://github.com/scipy","followers_url":"https://api.github.com/users/scipy/followers","following_url":"https://api.github.com/users/scipy/following{/other_user}","gists_url":"https://api.github.com/users/scipy/gists{/gist_id}","starred_url":"https://api.github.com/users/scipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scipy/subscriptions","organizations_url":"https://api.github.com/users/scipy/orgs","repos_url":"https://api.github.com/users/scipy/repos","events_url":"https://api.github.com/users/scipy/events{/privacy}","received_events_url":"https://api.github.com/users/scipy/received_events","type":"Organization","site_admin":false},"repo":{"id":1460385,"name":"scipy","full_name":"scipy/scipy","owner":{"login":"scipy","id":288277,"avatar_url":"https://avatars.githubusercontent.com/u/288277?v=3","gravatar_id":"","url":"https://api.github.com/users/scipy","html_url":"https://github.com/scipy","followers_url":"https://api.github.com/users/scipy/followers","following_url":"https://api.github.com/users/scipy/following{/other_user}","gists_url":"https://api.github.com/users/scipy/gists{/gist_id}","starred_url":"https://api.github.com/users/scipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scipy/subscriptions","organizations_url":"https://api.github.com/users/scipy/orgs","repos_url":"https://api.github.com/users/scipy/repos","events_url":"https://api.github.com/users/scipy/events{/privacy}","received_events_url":"https://api.github.com/users/scipy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scipy/scipy","description":"Scipy library main repository","fork":false,"url":"https://api.github.com/repos/scipy/scipy","forks_url":"https://api.github.com/repos/scipy/scipy/forks","keys_url":"https://api.github.com/repos/scipy/scipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scipy/scipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scipy/scipy/teams","hooks_url":"https://api.github.com/repos/scipy/scipy/hooks","issue_events_url":"https://api.github.com/repos/scipy/scipy/issues/events{/number}","events_url":"https://api.github.com/repos/scipy/scipy/events","assignees_url":"https://api.github.com/repos/scipy/scipy/assignees{/user}","branches_url":"https://api.github.com/repos/scipy/scipy/branches{/branch}","tags_url":"https://api.github.com/repos/scipy/scipy/tags","blobs_url":"https://api.github.com/repos/scipy/scipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scipy/scipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scipy/scipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/scipy/scipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scipy/scipy/statuses/{sha}","languages_url":"https://api.github.com/repos/scipy/scipy/languages","stargazers_url":"https://api.github.com/repos/scipy/scipy/stargazers","contributors_url":"https://api.github.com/repos/scipy/scipy/contributors","subscribers_url":"https://api.github.com/repos/scipy/scipy/subscribers","subscription_url":"https://api.github.com/repos/scipy/scipy/subscription","commits_url":"https://api.github.com/repos/scipy/scipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/scipy/scipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/scipy/scipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/scipy/scipy/issues/comments/{number}","contents_url":"https://api.github.com/repos/scipy/scipy/contents/{+path}","compare_url":"https://api.github.com/repos/scipy/scipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scipy/scipy/merges","archive_url":"https://api.github.com/repos/scipy/scipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scipy/scipy/downloads","issues_url":"https://api.github.com/repos/scipy/scipy/issues{/number}","pulls_url":"https://api.github.com/repos/scipy/scipy/pulls{/number}","milestones_url":"https://api.github.com/repos/scipy/scipy/milestones{/number}","notifications_url":"https://api.github.com/repos/scipy/scipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scipy/scipy/labels{/name}","releases_url":"https://api.github.com/repos/scipy/scipy/releases{/id}","created_at":"2011-03-09T18:52:03Z","updated_at":"2015-01-04T21:43:47Z","pushed_at":"2015-01-04T17:49:07Z","git_url":"git://github.com/scipy/scipy.git","ssh_url":"git@github.com:scipy/scipy.git","clone_url":"https://github.com/scipy/scipy.git","svn_url":"https://github.com/scipy/scipy","homepage":"http://scipy.org/scipylib/","size":79555,"stargazers_count":1412,"watchers_count":1412,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":740,"mirror_url":null,"open_issues_count":719,"forks":740,"open_issues":719,"watchers":1412,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/3717"},"html":{"href":"https://github.com/scipy/scipy/pull/3717"},"issue":{"href":"https://api.github.com/repos/scipy/scipy/issues/3717"},"comments":{"href":"https://api.github.com/repos/scipy/scipy/issues/3717/comments"},"review_comments":{"href":"https://api.github.com/repos/scipy/scipy/pulls/3717/comments"},"review_comment":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/scipy/scipy/pulls/3717/commits"},"statuses":{"href":"https://api.github.com/repos/scipy/scipy/statuses/ba0ade453d423ee7a5f1832f7db372ca428ccd94"}}}}