# LabVIEW

cancel
Showing results 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.

*db=10log(power)

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)

Message 1 of 5
(1,864 Views)

## Re: Lorentzian Fitting db and Power

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.

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

Message 2 of 5
(1,839 Views)

## Re: Lorentzian Fitting db and Power

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?

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

Message 3 of 5
(1,803 Views)

## Re: Lorentzian Fitting db and Power

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

Message 4 of 5
(1,797 Views)

## Re: Lorentzian Fitting db and Power

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.

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.

Message 5 of 5
(1,795 Views)