Dracon
Junior Member
Offline
Posts: 11
|
Dear All,
I have a problem with function that should smooth my output signal. The transition(V(x), td,tr,tf) add to signal rise and fall times but only in linear way. I have written following funkction based on Lagrange interpolation between three points (x1,y1) (x2,y2) , (x12,y12) and wanted signal, after smoothing to be more exponential, but I get convergence problem: "internal timestep too small in transient analysis" Note that points(x,y) are changing in time.
analog function real fsmooth; input x,x1,y1,x12,y12,x2,y2; real x,x1,y1,x12,y12,x2,y2; real n1,n12,n2; begin n1 = ((x-x12)*(x-x2))/((x1-x12)*(x1-x2)); n12 = ((x-x1)*(x-x2))/((x12-x1)*(x12-x2)); n2 = ((x-x1)*(x-x12))/((x2-x1)*(x2-x12)); fsmooth = n1*y1 + n12*y12 + n2*y2; end
endfunction Perhaps there is some embedded function to do this??
Thanks for your answers. Best regards, Dracon
|