05-04-2009 06:34 PM
Hey people!
I want to change a binary sequence to a funtion of time, and I have changed it to a sequence of 1s and -1s as required of my application.
I want to plot this new sequence as function of time i.e. each bit being plotted for a time i specify.
How do I do this? I tried using zero order hold, but the hold time in cycles input doesnt seem to change anything.
i have attached an example array below, and an example of how the output shuld look. Any help is appreciated.
Thank you.
05-04-2009 07:16 PM - edited 05-04-2009 07:17 PM
One option is to use a Graph with the following settings:
Bundle a zero constant with a unity constant with your 1D array of data. Pass this cluster into a waveform graph.
Set the plot interpolation to the fifth option (lower middle).
What you've done here is equally spaced each data point by '1', starting from '0'. The '1' is your i.
05-05-2009 04:48 PM
Hey Thoric!
Thanks a lot for your help. Did as you suggest. However, for the last element on the array, the graph doesnt display.
I have attached a figure of what im getting now. It seems that for hte last element, the spacing isn't applying.
Thanks again for your help.
05-05-2009 07:47 PM
What do you mean?
Your image shows a 1 at x=0 and 1, and shows -1 at x=2 and 3, just like your array .
05-05-2009 08:01 PM
05-05-2009 08:18 PM
05-05-2009 09:51 PM
Hello
Was just wondering. Is there a way I can represent the binary sequence on the time axies i.e i want the bit 1 to hav a certain time like 1ms etc.
How do I do this. Im realy stuck on this.
Thanks for all the help.
05-05-2009 10:43 PM
The issue is that you are trying to display 4 bits, but you need 5 points on the display to do this the graph plots points that are essentially at the edges of the bit. It is like the difference between an XY graph in Excel and a bar graph.
x=0 is the start of bit 0
x=1 is the start of bit 1, but the end of bit 0
x=2 is the start of bit 2, but the end of bit 1
x=3 is the start of bit 3, but the end of bit 2
x=4 is the end of bit 3
Just take your array, index out the last value, and just build it back onto the end of the array.
Alternatively, you should probably looking at something like the mixed signal graph to plot digital waveforms.
05-06-2009 02:50 AM
Hi LSASS
Apologies for the late response,
Ravens Fan is correct, there is an extra element in my data set to ensure the final data point is drawn. To duplicate this effect, just copy the last data point back into your array, creating a new array of n+1 data points.
05-06-2009 09:42 AM