Piece Wise Linear Fitting

Another dawning while doodling at the beauty shop...

... a way to join line segments easily to form PWL's, while maintaining all derivatives at the joining points.

(Using my TANH version of greater than, less than... I'm working on refining its coefficients to match segment slopes so there's no "peaking" :-) ...Jim Thompson

-- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at

formatting link
| 1962 | I love to cook with wine. Sometimes I even put it in the food.

Reply to
Jim Thompson
Loading thread data ...

Not sure, but those 'peaks' look just like the step response for an abrupt cutoff filter. Or, like the time results using a truncated Fourier series to represent a square wave.

Have you tried convolving the sinx/x function with your data stream? [easy to do in octave] That makes for a remarkably well-behaved waveform. Even satisfies most of the 'violations' done using sampling.

isn't the tanh function like (e^+x + e^-x), or such? Ron Bracewell used that a lot in proving his Fourier Series' He 'bracketed' all the functions with that kind of term and by taking the limit of something to zero proved the existance of the results. Reason? Every derivative existed after adding that function, yet adding the function could be taken to the limit of where it had NO effect on the original, within Engineering limits.

Reply to
RobertMacy

How important is the continuity of higher order derivatives? Cubic B-splines are continuous to the second order, becoming discontinuous at the third, but are much easier/faster to calculate:

formatting link

Reply to
Frank Miles

This is a _DC_ plot. The "peaking" is due to too narrow a TANH switchover range. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142   Skype: Contacts Only  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

Try regular hyperbolae. The derivatives exist... just take care not to divide by zero (which can happen with tanh too, and probably at analogous points, for analogous reasons).

Tim

-- Seven Transistor Labs Electrical Engineering Consultation Website:

formatting link

"Jim Thompson" wrote in message news: snipped-for-privacy@4ax.com...

Reply to
Tim Williams

Division by zero computing tanh of a real number? That would take talent. Care to elaborate?

Cheers

Phil Hobbs

Reply to
Phil Hobbs

Maybe it was atanh, but it's not the function of a real number, it's the derivative that causes problems. Certain people here swear by this for continuous limiter functions in SPICE, but I've found they can go batty rather often.

Incidentally, The Internet doesn't know that degenerate circuits aren't the only condition that can create singular matrices.

Tim

--
Seven Transistor Labs 
Electrical Engineering Consultation 
Website: http://seventransistorlabs.com
Reply to
Tim Williams

All derivatives of TANH exist and don't go "batty". You must be thinking of some other function. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142   Skype: Contacts Only  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.