-1

I am working with IFFT and have a set of real and imaginary values with their respective frequencies (x-axis). The frequencies are not equidistant, I can't use a discrete IFFT, and I am unable to fit my data correctly, because the values are so jumpy at the beginning. So my plan is to "stretch out" my frequency data points on a lg-scale, fit them (with polyfit) and then return - somehow - to normal scale.

f = data[0:27,0]  #x-values
re = daten[0:27,5] #y-values

lgf = p.log10(f)
polylog_re = p.poly1d(p.polyfit(lgf, re, 6))

The fit works definitely better (https://i.stack.imgur.com/TdPeo.jpg), but is it possible to then transform my polynom back into the normal x-scaling? Right now I'm using those logarithmic fits for my IFFT and take the log10 of my transformed values for plotting etc., but that probably defies all mathematical logic and results in errors.

Cris Luengo
  • 55,762
  • 10
  • 62
  • 120
Thore
  • 21
  • 5

1 Answers1

0

Your fit is perfectly valid but not a regular polynomial fit. By using log_10(x), you use another model function. Something like y(x)=sum(a_i * 10^(x_i^i). If this is okay for you, you are done. When you wan't to do some more maths, I would suggest using the natural logarithm instead the one to base 10.

Peter Schneider
  • 1,683
  • 12
  • 31