Showing results for 
Search instead for 
Did you mean: 

Lorentzian Fitting db and Power

Hi Guys,


I have this silly question.

I tried to do a fitting for Lorentzian with a1+(a2/19.744328)/(x^2+a3^2) formula. If i converted the power to db, the fitting was done nicely. But when using the power (in log), the fitting gone very wrong.



My objective is to get a3 (Fc, corner frequecy) of the power spectrum or half power frequency.

The main question is, how can i get the fitting for power spectrum?




(the fitting might take a while to process)

Download All
0 Kudos
Message 1 of 5

Your problem is related to the high (dynamic) range of values that your Y array can take when not represented in dB.

Your fitting algorithm assumes that all values are equally weigthed is not otherwise specified. This means that fitting errors for very small power values are relatively more important.


Here is what you get if you specify your weighting function as the reverse of your Y input array. 




Lorenzian with Weighting.jpg


   This is just a simple approach, you can probably achieve better results by tweaking your weight array.

Message 2 of 5

Local DSP.


Yeah, it does make it fit I get a gist of what i'm facing now.


Hovewer, is there any way for it to shape like this fitting?Capture.PNG

I tried a lot of weighting tweaking. but didnt find the fit one.

0 Kudos
Message 3 of 5

Why don't you just fit as you do in the dB world and convert the result back to Power?


dB to Power.jpg

0 Kudos
Message 4 of 5

I think that it is important to separate the concept of calculating (fitting) using a log scale (dB) and displaying your result using a log scale (Power). You fitting function will have some restrictions in the way it can 'look' according to your model description formula. For example if you display the result of the Power fitting using the simple 1 / Y weighting method using a linear Power scale (and zoom a little on the X-axis) you get a function that has the same 'look' as your fitting function in the dB world.


Power on Linear Y Scale.jpg


   That function gets obviously distorted when displayed using a log power scale.


    So I am not sure you can expect to find the shape you are looking for in your log-power display using that fitting model description.

0 Kudos
Message 5 of 5