mermeladeK Posted February 6, 2007 Report Share Posted February 6, 2007 Hello, I have a spectrum from a signal and I know how it should be theorically: A/(1+Bf**2)step(D-f)+E ...where f is frequency. ...where A, B, C, D and E are constants that I want to get from the real data. To solve this problem I try to use the "Non linear curve fit.vi", but it keeps saying: Error -20041 occurred at NI_Gmath.lvlib:Nonlinear Curve Fit LM.vi Possible reason(s): Analysis: The system of equations cannot be solved because the input matrix is singular. I checked if the array of independent and dependant values are equal, I checked the fitting model and everything seems ok. You know why it keeps saying the input matrix has no inverse matrix? Thank you. I attached a picture with the VI. Quote Link to comment
Kurt Friday Posted February 6, 2007 Report Share Posted February 6, 2007 The issue may not be your code but the input data, can you post the vi with minimal default data that demonstrates the issue. Quote Link to comment
mermeladeK Posted February 9, 2007 Author Report Share Posted February 9, 2007 Hello SciWare, Sorry for the delay. I thought I had posted a message on wednesday but it seems I didn't. The data wired to the Block is in the next picture. It is a spectrum of a 1/f noise plus a white noise. I also attach a graph plot of the data contained in the array in the cluster of the spectrum graph. Nil Quote Link to comment
Neville D Posted February 9, 2007 Report Share Posted February 9, 2007 Hello SciWare,Sorry for the delay. I thought I had posted a message on wednesday but it seems I didn't. The data wired to the Block is in the next picture. It is a spectrum of a 1/f noise plus a white noise. I also attach a graph plot of the data contained in the array in the cluster of the spectrum graph. Nil The last bit of the data seems to be trailing off to 0. That might be the problem. Neville. Quote Link to comment
mermeladeK Posted February 17, 2007 Author Report Share Posted February 17, 2007 As soon as I come back and get working on this again I'll tell you if your answer is right. However if I remember well, the last data in the graph was non-zero. I'll try to plot a logaritmic graph so that it is easier to see it's non zero. QUOTE(Neville D @ Feb 9 2007, 06:58 PM) The last bit of the data seems to be trailing off to 0. That might be the problem.Neville. Quote Link to comment
mermeladeK Posted February 24, 2007 Author Report Share Posted February 24, 2007 QUOTE(mermeladeK @ Feb 16 2007, 11:39 AM) As soon as I come back and get working on this again I'll tell you if your answer is right. However if I remember well, the last data in the graph was non-zero. I'll try to plot a logaritmic graph so that it is easier to see it's non zero. Here I am! Well, I checked what you said and... it's not about the zeros. I tried a different input for the Nonlinear Curve Fit VI and it keeps saying again the same thing: NI_Gmath.lvlib:Nonlinear Curve Fit LM.vi. Does any1 have an idea of what is the problem with this VI? Attached the input waveform: Quote Link to comment
Neville D Posted February 27, 2007 Report Share Posted February 27, 2007 QUOTE(mermeladeK @ Feb 9 2007, 04:32 AM) Hello SciWare,Sorry for the delay. I thought I had posted a message on wednesday but it seems I didn't. The data wired to the Block is in the next picture. It is a spectrum of a 1/f noise plus a white noise. I also attach a graph plot of the data contained in the array in the cluster of the spectrum graph. Nil Why don't you post the VI's (and data if any) instead of a picture of the BD.. that will save people time in trying to re-build your work just to re-create your error. Neville. Quote Link to comment
mermeladeK Posted March 3, 2007 Author Report Share Posted March 3, 2007 QUOTE(Neville D @ Feb 26 2007, 10:37 PM) Why don't you post the VI's (and data if any) instead of a picture of the BD.. that will save people time in trying to re-build your work just to re-create your error.Neville. Here are the VI's. The main one is the one with the word "TEST" in the name. The other 2 are subVI's. The "Acquire 1 divided by f idealized spectrum parameters.vi" is the VI supposed to use the Non linear curve fit. Nil Quote Link to comment
Neville D Posted March 9, 2007 Report Share Posted March 9, 2007 QUOTE(mermeladeK @ Mar 2 2007, 04:36 AM) Here are the VI's. The main one is the one with the word "TEST" in the name. The other 2 are subVI's. The "Acquire 1 divided by f idealized spectrum parameters.vi" is the VI supposed to use the Non linear curve fit.Nil Thanks, I will take a look at it shortly.. been out of town and lots to catch up on. Neville. Quote Link to comment
mermeladeK Posted March 17, 2007 Author Report Share Posted March 17, 2007 Ok, I'll be waiting for your answer. ) Quote Link to comment
Kurt Friday Posted March 19, 2007 Report Share Posted March 19, 2007 There are several subvi's missing Spectrum model.vi Quadradic substract.vi Noise figure to V.vi Noise from KeV to V.vi Post them up and we can take a look at it Quote Link to comment
mermeladeK Posted March 20, 2007 Author Report Share Posted March 20, 2007 Yey! You're right. Here they are. QUOTE(SciWare @ Mar 18 2007, 11:12 PM) Spectrum model.viQuadradic substract.vi Noise figure to V.vi Noise from KeV to V.vi Quote Link to comment
Kurt Friday Posted March 21, 2007 Report Share Posted March 21, 2007 I took a look at you code but it isn't easy to follow. I ran it and it produced the reported error which is due to the Lev Mar Curve Fit being unable to calculate a covariance, I'm not sure why though. What I would strongly suggest is that you check that your curve fit model is correct and that the data that you are trying to fit it to is appropriate. Generate data that fits your model and see if that works, also check your initial coefficients, are they appropriate? Quote Link to comment
mermeladeK Posted March 29, 2007 Author Report Share Posted March 29, 2007 Hi, Following SciWare suggestions I found the problem. It was about estimating one of the parameters. It still gives me an error which I have to find out why, but it gives a good curve now. I'll post more about it once I solve the last error. Thanks. Quote Link to comment
Kurt Friday Posted March 30, 2007 Report Share Posted March 30, 2007 Awsome I look forward to seeing it Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.