{"action":"created","issue":{"url":"https://api.github.com/repos/supercollider/supercollider/issues/2539","repository_url":"https://api.github.com/repos/supercollider/supercollider","labels_url":"https://api.github.com/repos/supercollider/supercollider/issues/2539/labels{/name}","comments_url":"https://api.github.com/repos/supercollider/supercollider/issues/2539/comments","events_url":"https://api.github.com/repos/supercollider/supercollider/issues/2539/events","html_url":"https://github.com/supercollider/supercollider/issues/2539","id":193933335,"number":2539,"title":"Hilbert UGens - phase convention requires more detailed documentation OR update","user":{"login":"joslloand","id":2693130,"avatar_url":"https://avatars.githubusercontent.com/u/2693130?v=3","gravatar_id":"","url":"https://api.github.com/users/joslloand","html_url":"https://github.com/joslloand","followers_url":"https://api.github.com/users/joslloand/followers","following_url":"https://api.github.com/users/joslloand/following{/other_user}","gists_url":"https://api.github.com/users/joslloand/gists{/gist_id}","starred_url":"https://api.github.com/users/joslloand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joslloand/subscriptions","organizations_url":"https://api.github.com/users/joslloand/orgs","repos_url":"https://api.github.com/users/joslloand/repos","events_url":"https://api.github.com/users/joslloand/events{/privacy}","received_events_url":"https://api.github.com/users/joslloand/received_events","type":"User","site_admin":false},"labels":[{"id":190319001,"url":"https://api.github.com/repos/supercollider/supercollider/labels/API%20change","name":"API change","color":"fbca04","default":false},{"id":11974270,"url":"https://api.github.com/repos/supercollider/supercollider/labels/comp:%20server%20plugins","name":"comp: server plugins","color":"F4FF75","default":false},{"id":4413799,"url":"https://api.github.com/repos/supercollider/supercollider/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"joslloand","id":2693130,"avatar_url":"https://avatars.githubusercontent.com/u/2693130?v=3","gravatar_id":"","url":"https://api.github.com/users/joslloand","html_url":"https://github.com/joslloand","followers_url":"https://api.github.com/users/joslloand/followers","following_url":"https://api.github.com/users/joslloand/following{/other_user}","gists_url":"https://api.github.com/users/joslloand/gists{/gist_id}","starred_url":"https://api.github.com/users/joslloand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joslloand/subscriptions","organizations_url":"https://api.github.com/users/joslloand/orgs","repos_url":"https://api.github.com/users/joslloand/repos","events_url":"https://api.github.com/users/joslloand/events{/privacy}","received_events_url":"https://api.github.com/users/joslloand/received_events","type":"User","site_admin":false},"assignees":[{"login":"joslloand","id":2693130,"avatar_url":"https://avatars.githubusercontent.com/u/2693130?v=3","gravatar_id":"","url":"https://api.github.com/users/joslloand","html_url":"https://github.com/joslloand","followers_url":"https://api.github.com/users/joslloand/followers","following_url":"https://api.github.com/users/joslloand/following{/other_user}","gists_url":"https://api.github.com/users/joslloand/gists{/gist_id}","starred_url":"https://api.github.com/users/joslloand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joslloand/subscriptions","organizations_url":"https://api.github.com/users/joslloand/orgs","repos_url":"https://api.github.com/users/joslloand/repos","events_url":"https://api.github.com/users/joslloand/events{/privacy}","received_events_url":"https://api.github.com/users/joslloand/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2016-12-07T01:24:29Z","updated_at":"2016-12-08T19:42:28Z","closed_at":null,"body":"**Introduction**\r\n\r\nThere are two different phase (rotation) conventions that have been adopted in the DSP community for specification of the Hilbert transform.\r\n\r\n1. [ cos', sin' ]\r\n2. [ cos', -sin' ]\r\n\r\nGiven an input, two outputs are expected:\r\n\r\n- a \"unit\" output\r\n- a Hilbert \"phase shifted\" output\r\n\r\nThe \"unit\" output is a phase (or time lagged) all-pass filtered signal. With respect to the unit output, the Hilbert output either lags by 90 deg, _Convention 1_, or leads _Convention 2_. This second output should also be all-pass.\r\n\r\nIllustrating in terms of phase:\r\n\r\n1. [ phase lag X, phase lag X - 90 deg ]\r\n2. [ phase lag X, phase lag X + 90 deg ]\r\n\r\n\r\n**Discussion**\r\n\r\n_Convention 1_ is the form suggested by JULIUS O. SMITH III in [HILBERT TRANSFORM DESIGN EXAMPLE](https://www.dsprelated.com/freebooks/sasp/Hilbert_Transform_Design_Example.html). Zolzer, et al., also advocate this convention in [DAFX: Digital Audio Effects, 2nd Edition](http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470665998.html). Additionally, [Wikipedia](https://en.wikipedia.org/wiki/Hilbert_transform#Table_of_selected_Hilbert_transforms) also highlights this form.\r\n\r\nAt the moment SC3's Hilbert and HilbertFIR UGens appear to have adopted the latter form. (Note: I'm one of the authors of the original Hilbert code, AND, there is an output naming discrepancy to be found the [source code for Hilbert](https://github.com/supercollider/supercollider/blob/master/server/plugins/FilterUGens.cpp#L4563): signal var labels for cos and sin are swapped, in error. Either _My Bad_, or _Sean Costello Bad_; [Costello](https://valhalladsp.com/) and I have briefly discussed this.)\r\n\r\nAside from consistency with reference sources, there is an advantage in adopting _Convention 1_ over _Convention 2_, in that an [Analytic Signal](https://en.wikipedia.org/wiki/Analytic_signal) can easily be constructed by mapping the two real outputs to the complex domain:\r\n\r\n[ cos', sin' ] --> [ real, imag ]\r\n\r\n\r\n**Solutions**\r\n\r\nThe most simple solution would be just to document the current behavior of the two Hilbert UGens. And provide some example code illustrating. Also, adding a discussion to PV_PhaseShift90 would also be useful. Here's a gist with some [examps](https://gist.github.com/joslloand/3f7b298034c2ce1d75c8f7eeb16b6d8b).\r\n\r\nMy preferred solution would be to both document and adopt _Convention 1_. The FreqShift UGen would also need to be updated, too.\r\n"},"comment":{"url":"https://api.github.com/repos/supercollider/supercollider/issues/comments/265835035","html_url":"https://github.com/supercollider/supercollider/issues/2539#issuecomment-265835035","issue_url":"https://api.github.com/repos/supercollider/supercollider/issues/2539","id":265835035,"user":{"login":"vivid-synth","id":10969331,"avatar_url":"https://avatars.githubusercontent.com/u/10969331?v=3","gravatar_id":"","url":"https://api.github.com/users/vivid-synth","html_url":"https://github.com/vivid-synth","followers_url":"https://api.github.com/users/vivid-synth/followers","following_url":"https://api.github.com/users/vivid-synth/following{/other_user}","gists_url":"https://api.github.com/users/vivid-synth/gists{/gist_id}","starred_url":"https://api.github.com/users/vivid-synth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivid-synth/subscriptions","organizations_url":"https://api.github.com/users/vivid-synth/orgs","repos_url":"https://api.github.com/users/vivid-synth/repos","events_url":"https://api.github.com/users/vivid-synth/events{/privacy}","received_events_url":"https://api.github.com/users/vivid-synth/received_events","type":"User","site_admin":false},"created_at":"2016-12-08T19:42:28Z","updated_at":"2016-12-08T19:42:28Z","body":"Is there a place we're keeping track of these breaking changes?"}}
{"actor":{"display_login":"vivid-synth"}}