buzsakilab / buzcode

Code for internal lab sharing - polishing has started but is by no means complete
http://www.buzsakilab.com/
GNU General Public License v3.0
119 stars 129 forks source link

Smooth.m edge effects #256

Open DavidTingley opened 6 years ago

DavidTingley commented 6 years ago

Just found an issue with Smooth.m when it handles linear data. it prepends/appends the flipped data, to a vector, then smooths. This works well for circular data, but causes linear variables to greatly diverge from their inputs. Run these two for comparison:

Smooth([1 0 0 0 0 0 0 0 0],2) Smooth([0 0 0 0 1 0 0 0 0],2)

Will fix in the dev branch this week, and close this when it's PRed to master

dlevenstein commented 6 years ago

Does this have functionality on top of the Matlab built-in smoothing functions?

On Oct 14, 2018, at 8:41 PM, David Tingley notifications@github.com wrote:

Just found an issue with Smooth.m when it handles linear data. it prepends/appends the flipped data, to a vector, then smooths. This works well for circular data, but causes linear variables to greatly diverge from their inputs. Run these two for comparison:

Smooth([1 0 0 0 0 0 0 0 0],2) Smooth([0 0 0 0 1 0 0 0 0],2)

Will fix in the dev branch this week, and close this when it's PRed to master

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

brendonw1 commented 6 years ago

Hey thanks David... How will you fix? There are many potential fixes to this all with different issues.

On Sun, Oct 14, 2018 at 8:55 PM Dan Levenstein notifications@github.com wrote:

Does this have functionality on top of the Matlab built-in smoothing functions?

On Oct 14, 2018, at 8:41 PM, David Tingley notifications@github.com wrote:

Just found an issue with Smooth.m when it handles linear data. it prepends/appends the flipped data, to a vector, then smooths. This works well for circular data, but causes linear variables to greatly diverge from their inputs. Run these two for comparison:

Smooth([1 0 0 0 0 0 0 0 0],2) Smooth([0 0 0 0 1 0 0 0 0],2)

Will fix in the dev branch this week, and close this when it's PRed to master

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/buzsakilab/buzcode/issues/256#issuecomment-429678853, or mute the thread https://github.com/notifications/unsubscribe-auth/ADXrTdrJ2scyRYZJ4MKCQzBqMp_SuleJks5uk90LgaJpZM4Xba0P .