Curve Fitting with Matlab: Solving Waveform Division using Invfreqz

In summary, the issue with curve fitting using invfreqz in Matlab may be due to incorrect weighting and could potentially be resolved by adjusting the weights and experimenting with different orders for the coefficients.
  • #1
rain2359
18
0
hi,

I am trying to do a curve fitting for a waveform obtained from the division of 2 FFT data. So, I used invfreqz in Matlab so that I can obtain the transfer function of the waveform, and at the same time, find an estimated waveform for the curve obtained. However, I can't seem to do it using this method, even though I had used the varience as the wt of the invfreqz. May I know does anyone knows what went wrong? Really appreaciate any help given. Thanks.

wt(1:k)=0.0002;
wt(1:405)=1;
ff = f1(1:(k));
f_norm = ff / f1(k)*pi;
[num,den]=invfreqz(tf1(1:k), f_norm,3,4,wt)
[h2,w2] = freqz(num,den,k);
 
Physics news on Phys.org
  • #2
plot(w2/pi,abs(h2));

It seems like the problem is with the way you are setting up the weights for the invfreqz. You should use weights that reflect the relative importance of the frequencies in your data. If certain frequencies are more important than others, then they should have higher weights. Additionally, it may be helpful to try different orders for the numerator and denominator coefficients as well.
 
  • #3



Hello,

The process you are describing, using invfreqz in Matlab to obtain the transfer function and an estimated waveform for curve fitting, is a valid method. However, without seeing your specific code and data, it is difficult to determine what may have gone wrong. A few things to consider are ensuring that your input data is formatted correctly and that the parameters you are using for invfreqz are appropriate for your specific data. It may also be helpful to check for any errors or warnings that may have been generated during the process. If you are still having trouble, it may be beneficial to seek out further assistance from a Matlab expert or a colleague who has experience with this process. Best of luck with your curve fitting!
 

1. What is curve fitting and why is it important in Matlab?

Curve fitting is the process of finding a mathematical function that best represents a set of data points. In Matlab, curve fitting is important because it allows scientists and engineers to analyze and interpret experimental data, make predictions, and model complex systems.

2. How does the "Invfreqz" function work in Matlab?

The "Invfreqz" function in Matlab is used for solving waveform division, which involves dividing one signal by another. This function uses an iterative algorithm to find the inverse of a frequency response, which can then be used to solve for the unknown signal.

3. What are the main steps involved in curve fitting with Matlab?

The main steps in curve fitting with Matlab include importing the data, choosing an appropriate function to fit the data, estimating initial parameters, using the curve fitting tool to find the best fit, and evaluating the fit using statistical measures.

4. Can curve fitting with Matlab be used for any type of data?

Yes, curve fitting with Matlab can be used for a wide range of data types, including continuous and discrete data, linear and nonlinear relationships, and even data with noise or missing values. However, the type of function used for fitting may vary depending on the data.

5. Are there any limitations to curve fitting with Matlab?

While curve fitting with Matlab can be a powerful tool, it is important to keep in mind that it is not a substitute for good experimental design or data interpretation. Additionally, the accuracy of the fit may be limited by the quality and quantity of data, as well as the choice of fitting function.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
11K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
Back
Top