Help really Needed

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
az1987
Forum Newbie
Posts: 5
Joined: Wed Feb 08, 2012 9:01 am

Help really Needed

Post by az1987 »

Hey guys,
I need some help with a small project I'm doing.
I have a radio receiver hooked up to a serial port and have it
streaming on a web page. I need to create a spectrum plot which will
show the given frequency strength.

I have the chart all ready i just need a way to extract the data from the radio so it goes onto the graph. Anyone know how to do this ?

Also for the chart i will be using google charts
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: Help really Needed

Post by Eric! »

You need to run an FFT on the data to get power versus frequency. Then take that data and plot it. You'll need some kind of Javascript solution to feed this data continuously in real time. I think google charts are all static...not sure.
az1987
Forum Newbie
Posts: 5
Joined: Wed Feb 08, 2012 9:01 am

Re: Help really Needed

Post by az1987 »

Someone on the google chart community did this for me.
http://jsfiddle.net/uTAjq/

If i could use that to get to work with it, that would be great
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: Help really Needed

Post by Eric! »

Is your data in time, voltage?

I still don't think that chart will stream data in real time, but I can help you with the data. This class will do the FFT calculation to convert time and voltage to frequency and power
http://www.phpclasses.org/package/6193- ... -data.html
az1987
Forum Newbie
Posts: 5
Joined: Wed Feb 08, 2012 9:01 am

Re: Help really Needed

Post by az1987 »

Its in frequency and strength
az1987
Forum Newbie
Posts: 5
Joined: Wed Feb 08, 2012 9:01 am

Re: Help really Needed

Post by az1987 »

I've just asked about, and according to them.
Assuming you can get a real-time data stream from your server, yes, you can have the chart update in real-time.
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: Help really Needed

Post by Eric! »

Then all you have to do is provide the data to your chart from your server using whatever connection method/format google chart needs. You're probably going to have to figure that one out on your own or ask the chart group how the chart fetches the data.
az1987
Forum Newbie
Posts: 5
Joined: Wed Feb 08, 2012 9:01 am

Re: Help really Needed

Post by az1987 »

So how do i get this FFT to work then?
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: Help really Needed

Post by Eric! »

If your data is already in power vs frequency you don't need to run the FFT. The FFT is a numerical technique used to convert a amplitude vs time sequence to a power vs frequency sequence. I wrongly assumed that's where you were having problems. I don't know what issue you have now it seems like a the pieces are solved and you just need to put them together.
Post Reply