Skip to main content
1-Visitor
July 23, 2010
Solved

Mathcad 15 "onefn" function problems

  • July 23, 2010
  • 4 replies
  • 30800 views

I am having trouble with the onefn function in Mathcad 15. I get double entries in the 1/f noise vector and if I take the CFFT(ofn) I get a zero as the first result. Also I do not understand the mirrored magnitude plot of the 1/f Noise. I also don’t understand why the range variable even starts at zero. That would give infinity for 1/f. See attached.

Bill

Bill Dumke, RF Engineer

Nsight Telservices dba Cellcom

450 Security Blvd

Green Bay, WI 54313

Best answer by RichardJ

Sorry. Because of where you put the comment I was looking at the wrong thing! Yes, you are correct about the double entries. That must be a bug in the onefn function. Here's a fix.

4 replies

19-Tanzanite
July 23, 2010
I am having trouble with the onefn function in Mathcad 15. I get double entries in the 1/f noise vector

You mean they are complex. Yes, that is a property of the Fourier transform. The FT of a perfectly symmetric function, for example cos(x) is real. The FT of a perfectly asymmetric function, for example sin(x), is imaginary. In general the result of a FT is therefore complex. The magnitude of the signal is the square root of the sum of the squares of the imaginary and real parts, and the phase is the arctan(imaginary/real). So the magnitudes of cos(x) and sin(x) are the same, but the phases differ by 180 degrees.

if I take the CFFT(ofn) I get a zero as the first result.

The result of a FFT always starts at zero frequency, i.e. DC. You subtracted the mean of ofn, so the DC component is zero.

I also don’t understand why the range variable even starts at zero. That would give infinity for 1/f. See attached.

The result of an FFT always goes from zero frequency to some upper limit. Yes, that would result in 1/f being infinite, but the concept of 1/f noise becomes meaningless when f=0. To measure one period of anything with truly zero frequency would take an infinite amount of time. Even very low frequencies have no real meaning for most applications. If you are measuring the period of sunspot activity a period of 1 year has real meaning, but if you are building an RF circuit (an example deliberately chosen because that's your speciality!) a period of 1 year has no practical meaning whatsoever.

BillDumke1-VisitorAuthor
1-Visitor
July 23, 2010

Richard,

Thanks for the reply.

No, they are not complex. Just two rows each of the same real number in the vector. This holds for the entire 1/f vector. I have never seen anything like this.

I have attached a pdf file so you can see the onefn output with Mathcad 15.

Bill

RichardJ19-TanzaniteAnswer
19-Tanzanite
July 23, 2010

Sorry. Because of where you put the comment I was looking at the wrong thing! Yes, you are correct about the double entries. That must be a bug in the onefn function. Here's a fix.

1-Visitor
July 23, 2010

Bill,

Glad you decided to make the plunge. It looks like the Adept site continues to have serious problems. I got a whole bunch of odd emails from some sort of support site as a result of just a couple of postings yesterday.

1-Visitor
July 23, 2010

I am logging the issue with onefn function.

Mona

BillDumke1-VisitorAuthor
1-Visitor
August 16, 2010

Mona,

Attached is the solution to the onefn problem. I suggest the conclusion at the end be added to the Signal Processing Book Noise Generator section to eliminate confusion.

Bill

1-Visitor
August 19, 2010
19-Tanzanite
August 19, 2010

I missed that spike in your last post, and my reply (which you deliberately deleted along with your post). What point are you trying to make with it though? Are you still trying to claim evidence of the mythical CFFT/cfft bug? There is no CFFT/cfft bug. The bug is in the calculation of the residuals.

And please don't delete my posts in the future, even if you don't like or agree with what is said.

1-Visitor
August 19, 2010

Richard Jackson wrote:

I missed that spike in your last post, and my reply (which you deliberately deleted along with your post). What point are you trying to make with it though? Are you still trying to claim evidence of the mythical CFFT/cfft bug? There is no CFFT/cfft bug. The bug is in the calculation of the residuals.

And please don't delete my posts in the future, even if you don't like or agree with what is said.

I like very much and how much you dislike that pest of deleting, no noise from PTC about it. It could happen to me, but don't know how I would react !. The "mytical Fourier-Gibbs" origins from Mathsoft. I made it clear for myself and those interested. I'm not in contradiction with CFFT/cfft simply understanding deeper. There is no bug in the calculation of the relative residuals [ a most universal Engineering formula, and largely used in qualifying the numerical approximations, especially about the problem when the approximation should be 0 @ 0 but is not]. I just designed a quick and irrefutable way of negotiating a discontinuity as soon as possible in the demo.

I agree, the delete bug is quite an offense, same as your private e-mail that came from this forum.

How come Mona didn't notice these two disasters ?

And the spell check does not work with Google Chrome [ underline but no proposition].

5-Regular Member
August 29, 2023

The double entry appears to have been fixed in Mathcad Prime 9.0.0.0.