cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Fourier

confused!
1-Visitor

Fourier

Hi, I'm new to Mathcad, so I'll apologise in advance for what is probably a simpleton's question!

I'm on an engineering course, and have been set a task, part of which is as follows;

using Mathcad FFT and IFFT functions perform the DFT of a signal which consists of 256 discrete samples, showing the resulting frequency spectrum of the signals.

As I said, I am new to Mathcad, and have no idea where to start; so any help or pointers would be much appreciated!

Thanks

19 REPLIES 19
MichaelH
12-Amethyst
(To:confused!)

using Mathcad FFT and IFFT functions perform the DFT of a signal which consists of 256 discrete samples, showing the resulting frequency spectrum of the signals.

Mathcad 15 has extensive help files, tutorials, and example worksheets in the "Help" files.

You'll need to read those to understand the differences between the various FFT functions available, so you should start there.

StuartBruff
23-Emerald III
(To:MichaelH)

In particular, do a search for "FFT" in help, then look at the Quicksheet linked at the bottom of the "FFT/IFFT of Real Data" help page.

Stuart

Thanks for the replies.

I've had a look, but am still a little in the dark.

I thought that whatever I would need to do, there would be 256 calculations. Am I right in thinking this can be input so that Mathcad automatically carries this out?

Thanks again.

StuartBruff
23-Emerald III
(To:confused!)

I'm not quite sure what you mean, but if you have a vector v containing your 256 samples, then all you need to do is type fv:=fft(v) and Mathcad will carry out a discrete fast fourier transform on the data and return the transform as a vector (again 256 elements long), storing the result in the variable fv. The function fft does all the hard work.

Stuart

Werner_E
25-Diamond I
(To:StuartBruff)

StuartBruff schrieb:

I'm not quite sure what you mean, but if you have a vector v containing your 256 samples, then all you need to do is type fv:=fft(v) and Mathcad will carry out a discrete fast fourier transform on the data and return the transform as a vector (again 256 elements long), storing the result in the variable fv. The function fft does all the hard work.

Stuart

The length of fv would be only half of the length of v plus one, 129 in that case.

@confused!: What was the problem with the quicksheet Stuart pointed you to? The formulas you see are just for information to show whats behind FFT etc. Probably, as you wrote you are novice to Mathcad, you'd like to look up things like range variables and vectors?

WE,

It would seem so! As I said, I've never used this before. How do I go about telling mathcad what fv is? ie, how do I type in a function that represents a vector of 256 samples?

Thanks

Werner_E
25-Diamond I
(To:confused!)

Did you look up the built in help, the tutorials and the quicksheets? The help possibilities in Mathcad are far better than most help functions in other programs and suitable for self study.

If you really want to type in the vector elements by manually I would recommend the "stack trick" which I've learned here in the forum. See attached worksheet for other possibilities and take it as a starting point.

Good luck!

See if this simple primer helps. (Note that you COULD read the help and quicksheet files too!

Fred,

Thanks for taking the time to reply, and for the pointer with the file. I'll take a look this evening.

I have looked at the help and quicksheets, and between those and some internet searches I am slowly piecing this together! I am a total novice, unlike most of you guys, but am quickly realising that Mathcad is very powerful but also has some quirks that take a while to get used to (in particular I find it doesn't always like retrospective changes, it is often easier to delete the whole area and re-input!).

Thanks again.

Fred, Thanks for the information, but was just wondering how would it work if it was a square wave instead of a cos? Can you do that please.

Cheers confused. I've needed this for about 3-4 weeks now.

Werner_E
25-Diamond I
(To:wibble)

Maybe the attached is of any help even if its not done with fft.

The worksheet is from

http://learnweb.getsoft.net/_fouriertest/ger/index2.html

I only have added a modified arg-function at the bottom to make it work again. Seems to has been developed under MC11 or prior and the arg-function seemed to have worked a little bit different at those times.

There are a lot of good courses at http://getsoft.net/learnweb/, usually accompanied with Mathcad sheet, but they are in German and some (as the attached) need some small reworking. The course about Fourier transform is still under construction and only partially finished.

Fred_Kohlhepp
23-Emerald I
(To:wibble)

I

Thanks Fred.

Added a "filter" to the square wave

I like you worksheet, Fred.

Attched is a sheet which was part of older (very old, indeed) Mathcad distributions and demonstrate how to use fft for denoising a signal. Sorry, couldn't find the english version, but I'm sure I have it, too, in my collection.

THAT'S A GREAT TECHNIQUE!

Thanks!!

Fred Kohlhepp schrieb:

THAT'S A GREAT TECHNIQUE!

Thanks!!

Not mine, as already stated.

I finally found the english version (not that it really would be necessary, I think). The oldest I could find dates back to 1987(!) and came with Mathcad 2.0. That was (as was 2.5) a DOS version! God, I'm showing my age 😉

I found the file in version 3.1 (also DOS), too, but that file already was in German as is the file coming with version 5+, the first Windows version I could get my hands on.

Sentimental feelings when you look at the text format mcd-files used to have in those days.

RichardJ
19-Tanzanite
(To:Werner_E)

Here's a Fourier filter I wrote that's a lot more general than the one in your sheet. It uses cfft, so it can handle any number of points rather than jst a power of 2. The worksheet also explains how to handle the symmetry issues associated with Fourier transforms. As written it removes a specific, narrow, range of frequencies (i.e. it's a notch filter), but it could be easily adapted to a low or high pass filter.

Werner_E
25-Diamond I
(To:RichardJ)

Thanks, thats a great sheet and so well documented. Very useful, indeed.

Announcements

Top Tags