News for hackers. Stuff that matters.
Re:Decomposing a function into its even and odd parts by hellabites on Saturday July 30, 2016 @01:16PM (#12193780)
This can be rather difficult for general data where an explicit equation isn't obvious (even though it'll work quite often as pointed out by johncolanduoni below).

[I think it's neat that] for sufficiently smooth and periodic data, a Fourier transform will do exactly this (decompose a function into its even and odd parts)!

Re:Decomposing a function into its even and odd parts by johncolanduoni on Saturday July 30, 2016 @01:43PM (#12193881)
I'm confused. If you have a table of data where one of the columns varies from -A to A, what is the difficulty in calculating the odd and even parts by just adding (resp. subtracting) the values at x and -x and dividing by two? Even if you don't have a precisely symmetric span of x values you can use simple interpolation as long as your data points are reasonably dense.

Fourier analysis seems to be overkill in this case, unless I'm missing something.

Re:Decomposing a function into its even and odd parts by hellabites on Saturday July 30, 2016 @02:43PM (#12194145)
Your algorithm had a bit of a typo--you want to subtract (resp. add) to calculate the odd and even parts of a function.

If you don't have a nearly symmetric span of x values, you may need to do extrapolation to obtain one, which may be difficult.

I brought up Fourier analysis not as a means to replace the decomposition described in the blog, but to connect it. I think it's neat that Fourier transformations can be viewed as a parity decomposition.

Re:Decomposing a function into its even and odd parts by S4M on Saturday July 30, 2016 @05:56PM (#12194839)
if your data are over [a,b], where a < 0 and b > 0, you can do the decomposition mentioned in the article over [-c,c], where c = min(|a|,|b|), so you don't need to extrapolate.