spectrum analyser

i have to write some software to display an analog wave form sample though the serial port. I want to now how to display this in the form of a spectrum analyser.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Which control are you using to display the wave. If you are not using any control, you can use Olectra Chart.
Are you asking if there is a "spectrum analyser" control or are you asking how to draw on a form?

If it's the latter you use
Form.Line (X1, Y1)-(X2, Y2)
If you are looking for code to do FFT and other DSP stuff, this is not going to be the answer.  If, however, you are just trying to display the waveform on-screen, then checkout:


Look for the sample called Playing and Displaying Wave Data.  Granted, they are taking the waveform data from a .WAV, but it isn't too difficult to change to serial input.  However, their plot is with fixed data (the size of the data is static) so changing it to dynamic data would be more involved.

Good luck.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

MarktalbotAuthor Commented:
i can draw the wave to the screen but a want to be able to display not in the form of an ossiloscope trace but as a nuber of lines repreenting the aplitude of a specific frequency
I know I've seen VB Algorithm books with FFT.  You might want to check out:

I know there are other sites out there with this stuff, but that is what I found first.
Then how about

Form.Line (X1, Y1)-(X1, Y2)

that draws vertical lines.

The simplest way of plotting a chart is to create an array of numeric values, and then set the ChartData property to the array, as shown in the following example:

' This code might be pasted into the Load event
' of a Form that has an MSChart control named
' "MSChart1".
Dim arrPrices(1 to 10)
Dim i As Integer
For i = 1 to 10
   arrPrices(i)= i * 2
Next i
MSChart1.ChartData = arrPrices

My suggestion would be to find out what a good program that provides a spectrum analysis looks like.  I highly recommend checking out www.spectraplus.com  The have a trial 30 day version that will show you in real time in both time, freq and freq over time displays of audio coming into your system (e.g. mike, CD, line in,...)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.