Coefficients from butter function differ between platforms
1 view (last 30 days)
Bjarke Skogstad Larsen on 17 Feb 2017
I've into something I find odd.
When comparing results with a colleague, we discovered some differences even though we ran the same code and had the same Matlab version (18.104.22.1681360 (R2016a)). In the end, we tracked down the culprit to be the coefficients calculated by Matlab's built-in function: butter.
On Windows we get:
0.1140 0 -0.4560 0 0.6841 0 -0.4560 0 0.1140
On Linux we get
0.1139 0 -0.4558 0 0.6836 0 -0.4558 0 0.1139
I haven't tested to see if these differences extend to other filter functions but I was surprised to see this difference. Is this normal behaviour? Can anybody offer an explanation? :-)
I have some toolboxes on Windows which aren't present on Linux. I doubt this is the reason though?
----- I found someone having a similar problem, though this was due to different versions of Signal Processing Toolbox. I've since check that we have the same version of the Signal Processing Toolbox on Linux and Windows: Signal Processing Toolbox Version 7.2 (R2016a)
Link so solution: https://se.mathworks.com/matlabcentral/answers/98640-why-does-the-butter-function-return-different-results-for-signal-processing-toolbox-4-3-and-5-0?s_tid=srchtitle
I still find this behaviour strange, when both systems have the same version of the toolbox.
Shashank on 23 Feb 2017
There may be many factors causing this mismatch. For example, 'butter' function you mentioned might use some library under the hood for computation, say LAPACK. Different versions of this library might lead to minor differences in the output.
In your case as I observe the difference is minimal.
You can read more about why this may occur here: