beautypg.com

2 manipulating data for better curve fit, An374 – Cirrus Logic AN374 User Manual

Page 27

background image

AN374

AN374REV2

27

6.4.2 Manipulating Data for Better Curve Fit
As mentioned previously, the curve fitter looks for a polynomial fit with a maximum of fourth order. There are
a few quick techniques that can be performed to make a better fit. This section shows some of the common
techniques used to improve the quality of data and therefore the quality of the fit. In this section, it is assumed
that the data, if attempted to be fitted using a curve fitter, provides a large error, so improvements are
necessary.

Step 1)

Use a weighted fit

A weighting inequality can be enforced such that some regions can be given higher weights thereby forcing
the curve fitter to reduce the error while fitting in those regions. This is particularly useful when the observed
error is skewed more towards the region of interest as opposed to regions where the light bulb may not operate
regularly.

Step 2) Identify the region of interest
Some data points on the curve fitter have a larger significance to the light bulb as opposed to others. These
regions should be identified immediately and the curve fitting should be done in such a way that the errors in
these regions are minimized as a first priority.
Consider an example where an incandescent dimming profile is requested with 2% lumen output is required
at the lowest dim settings. Since all the major standards and specifications such as UL, LM79 are based on
full sine wave operation, that region is important and high accuracy in both lumen output and CCT is desirable.
From experience, it has been observed that at a low conduction angle, the light output is so small that the eye
is not yet saturated and if the two strings are not mixed correctly along the Planckian locus, the individual
components will be visible. It is important for the curve-fitting process to have minimal error in this region. In
most of the other regions, some amount of allowance could possibly be made depending on the application.

Step 3) Add trendline in a spreadsheet to see outliers in data
The trendline function in a spreadsheet or any other function in a compatible software helps identify any
outliers in the data. The following guidelines describe what to consider while using this trendline functions:
1. Choose a polynomial function of order 2, 3, or 4 for the current versus dim on the red and white currents.

A linear fit is acceptable if it produces a lower mean squared error (MSE).

2. Set intercept to origin
3. Display the equation on the chart
4. Display MSE on the chart (R2)
5. The trendline provides physical intuition in understanding where the potential problems may lie in trying to

fit the data into a polynomial curve.

Step 4) Dim axis remapping
Many data that may even look fundamentally incompatible with the curve fitter can be made to fit well by
remapping the dim axis. Mathematically a straight line with an equation Y = Mx + B can be made to be a line
Y = Mx by adding -B/M to every point on the x axis. Thus by shifting the whole axis to the right by B/M, the
curve can be made to pass through the origin.
Figure 20 shows another example of the above statement. In this case, by merely changing the dim point on
the axis from 0.4 to 0.5, the data that was an outlier is now part of the good data set. From a physics standpoint,
this still does not have any impact to the system specifications since the red current and the white current
combination remain the same.