Fun with Maple and waves

Below is a link to something I did today with Maple.

I'm relatively new to Maple and am only familar with a handful of it's built-in functions, so a lot of what is shown in the worksheet could probably be done a lot easier - for example I think Jacques, as an answer to a question of mine here, was suggesting that using Maple tables might be a better way of doing what I did here with arrays. Anyhow, I had a lot of fun doing it the way I did, and I thought maybe someone here might find something in it useful, or may just like to have a look at what a "newbie" such as myself might be doing with Maple.

All it does, is take a bunch of sine waves at various frequencies and amplitudes and adds them together to produce a complicated looking wave, and then it deconstructs that complicated wave into it's various wave components (frequencies and amplitudes), displays the components as well as the wave represented by the components, and then finally puts it all back together again and displays that.

The link displays the page as an HTML, but it has a link at the top to download an archive containing the Maple11 worksheet.

picture show test

It just occured to me that we can put images in messages here so I'm going to try it. The following is just one of the images (the wave I deconstruct) from the HTML.


Robert Israel's picture

Hear the waves

Another thing you can do with this is listen to it. I'll
have to increase the frequencies, of course, to make the
lower frequencies audible. The fundamental will be 40 hertz,
so the highest frequency is 3000. In a one-second recording
we thus want to go up to x = 80*Pi.

> pfun:= unapply(pAll,x);
with(AudioTools):
A:= Create(duration = 1.0); # for a one-second recording
jmax:= op(2,ArrayDims(A));
for j from 1 to jmax do
A[j]:= evalhf(pfun(j*80*Pi/jmax))
end do:
Write("c:/mypath/pAll.wav"); # change the path as desired

And then play the resulting .wav file with your favourite music player.
Not that it's very musical...

Surf's up

Thanks Robert - I really appreciate you showing me that.

I haven't explored Maple's audio package yet, but I remember it being mentioned when I originally viewed the Maple demo CD. It never ceases to amaze me what Maple is capable of.

Using maple to do what I did in that worksheet, helped me better visualize a lot of what I already understood and your example helped even more. With maple the learning is easy, so it's easy to learn a lot... quickly.

Fourier Analysis

Is this the same thing as fourier analysis ?

In your link I think I saw about 5 different waves.

However, would summing a lot more different frequencies and amplitudes have created some arbitrary periodic waveform ?

Also, is the reason the example shown doesn't have any regularity to it is because there still are not enough waveforms included yet ?

v/r,

I'm not sure

I'm not sure if any of this is even remotely related to the Fourier analysis. I'm relatively new to all of this and I'm kinda embarassed to say that I really don't understand the formula that is always referenced in everything that explains anything related to Fourier, so I don't understand any of the discussion that follows it, which usually turns out to be the entire discussion - kinda frustrating. However I hope to understand all those things the longer I work with Maple. The material I've shown is just something I did one day when working with maple and experimenting with waves.

Doing some experimenting, using Maple, It "seems" to me that any wave that repeats itself can be broken down into the waves that make it up by looking for a period that repeats itself and then multiplying that period by waves of various frequencies. For each wave that is used to do this, if the wave is the same as the one being used, then the result of integrating the period will be non-zero. I found this out using maple by taking a wave of one frequency, multiplying it by another and then integrating the result which produced zero. However, that was pretty obvious just by looking at it, without integrating or doing any other type of math since everything above the axis is the same as everything below. I then multiplied two waves of the same frequency and noticed that the result was a wave that went above the x axis and was obviously non zero - in fact the entire wave was above the x-axis. That seemed to work for any wave so it seems like an easy way to "pick out" a wave of any frequency that is inside any repeating wave comprised of many waves that repeats itself over any particular period. The amplitude turns out to be the result of integrating and then dividing by pi. I'm still working on this and hope to add to that webpage and worksheet as I do so.

I apologize if I didn't answer your questions very well, but although I understand what I did in that example, I don't really have a good understanding of how it relates to waves in general yet - but I will.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}