How to Calculate and Animate a Digital and Analog Signal

Coolbreeze78

Member
Joined
Mar 15, 2013
Messages
13
Programming Experience
1-3
I need to take a sequence of 1's and 0's and then convert them into a graphical representation of a digital sign that will scroll across the screen. The graph would need to be positioned inside the middle box on the picture below, right under the light gray box. It would need to scroll right to left until it finished.

Capture.JPG

The graph below is a sample of what I need.

digital_signal.gif

What I had planned on doing was using a picture box and just draw the graph through code onto the picture box. There would be four cases, 0,0; 1,0; 1,1; and 0,1. Each of these checks the digit before it to see what it is. Based on the combination of numbers, I would have functions for each case that would draw the lines needed for the graph. Once all the numbers have been read and processed, the results should scroll across the screen while staying inside the center box.

If anyone has any suggestions on how to go about doing this let me know. And if you know of a better way I could use advice on that as well. Thanks.
 
What is even more difficult is, taking the converted signal on the opposite end, and trying to figure out how to read the graph and then convert it back to 0's or 1's. After that I have to convert the digital signal to an analog one using frequency shift keying.
 
I did this before, but I used a grid control, and a set of small transparent GIFs. Each bit consists of a level and (optionally) an edge. So, in order to be able to represent every possible bit, you need representations of:
- A high level
- A low level
- A high level going low (edge)
- A low level going high (edge)

With those 4 GIFs you can populate columns of a grid control (by setting the appropriate image as the cell's background) while keeping a workable timebase and values (as opposed to doing all the graphing in GDI...).

Note that you could also use a MSChart control, all the data gets preserved as points, but it might get complicated to manage. In my case I used a grid because I needed 3 additional rows of data indexed to the bit timebase.

EDIT: This is what mine looked like... You can determine which of the four images to show depending on the current cell and the next's values. For example:

Cycles.png

If Value(n) = 0 Then
    If Value(n + 1) = 0 Then
        Image = LOW
    Else
        Image = LOWTOHIGH
    End If
Else
    If Value(n + 1) = 1 Then
        Image = HIGH
    Else
        Image = HIGHTOLOW
    End If
End If
 
Last edited:
For the analog, could I just use one gif that has one frequency in one time interval and another one with two frequencies in another time interval. One would represent 0 and the other 1. Seems like I could use the same set up that you listed above but with 2 less checks.

Thanks for the help by the way. I really appreciate it.
 
Analog is not 1's and 0's, it's everything in between. For analog you need to take into account amplitude and frequency. But you also need to know what exactly you are measuring. I do not see in the case of your application (ethernet analyser kind of thing?) what could be measured as an analog wave. Unless you want to be able to plot the encoded digital data over a wireless link (which IMO is unrealistic... you typically need a spectrum analyzer with bandwidth in the 10's of GHz to do that...)?
 
Yeah we are just simulating what happens in a network. We basically set the conversion to be used. And since we are using frequency shift keying there would only be two different looking graph waves for either 1 or 0. We are basically converting a string into a binary number, then converting that into a digital signal, then converting that into an analog signal. Since the digital signal that is being converted already represents a 1 or 0, then the analog signal would do the same. Amplitude and phase would not be needed since we are only using frequency shift keying. And since we set the values for the frequency, I would only need two different ones. One for 1 and another for 0. The project isn't too detailed in this respect where we need to do anything really complicated. It's just to show that we have an understanding of how a data packet flows through the network architecture and layers while showing at each step what happens to the data or packet.
 
To make it easier to understand, it's basically showing how when you type "Hello World" into a computer, how that data is packaged, modulated (therefore converted to an analog signal to be sent across a network transmission medium such as cable lines), demodulated, unpacked and then converted back into the string on the receiving end.
 
In that case I would design something that looks like a FFT plot, with frequency on X vs amplitude on Y, then again you can use premade images to represent the keying. Don't forget to show the harmonics... :)

This looks like an interesting educational project, make sure to let us know how it turns out.
 
Back
Top