Answer the question
In order to leave comments, you need to log in
How to build pulse modulation graphs with an array of samples?
Gentlemen, I need help, I have such an array - an array of pulse modulation samples. What software or how can you implement a program to build from these values - a graph, as shown in the picture?
3600 1500 600 1150 550 400 550 350 550 400 500 1250 550 350 550 400 550 400 550 1200 550 400 500 400 350,550,1200,550,400,550,350,600,350,550,1150,600,350,600,350,550,400,550,1200,500,450,550,350,600,350. 550 1200 550 400 550 350 600 350 550 1200 600 350 550 400 550 350 600 1200 550 350 600 300 600 350 550 1200 550 400 500 450 550 350 600 350 550 400 500 1250 550 350 550 400 550 1150 600 350 600 350 550 1200 600 1150 550 400 550 400 550 350 550 350 600 350 600 350 500 450 550 1200 500 1250 500 400 600 300 600 350 550 350 600 350 550 400 550 1150 600 350 600 1150 600 350 550 400 550 350 600 350 500 450 500 400 600, 350, 550, 400, 500, 350, 600, 350, 600, 300, 550, 400, 550, 400, 550, 400, 550, 350,550 350 600 350 600 300 550 400 550 400 550 400 550 350 550 350 600 350 600 350 550 400 550 350 600 350, 550, 400, 500, 450, 550, 350, 600, 350, 550, 350, 550
Answer the question
In order to leave comments, you need to log in
Depends on how you get this array
. If you interrupt with your hands, then there is not much difference anywhere.
Implementation in Matlab, where mass_i is the data you provided:
mass_i = [3600, 1500, 600, 1150, 550, 400, 550, 350, 550, 400, 500, 1250, 550, 350, 550, 400, 550, 400, 550, 1200, 550, 400, 500, 400, 600, 350, 550, 1200, 550, 400, 550, 350, 600, 350, 550, 1150, 600, 350, 600, 350, 550, 400, 550, 1200, 500, 450, 550, 350, 600, 350, 550, 1200, 550, 400, 550, 350, 600, 350, 550, 1200, 600, 350, 550, 400, 550, 350, 600, 1200, 550, 350, 600, 300, 600, 350, 550, 1200, 550, 400, 500, 450, 550, 350, 600, 350, 550, 400, 500, 1250, 550, 350, 550, 400, 550, 1150, 600, 350, 600, 350, 550, 1200, 600, 1150, 550, 400, 550, 400, 550, 350, 550, 350, 600, 350, 600, 350, 500, 450, 550, 1200, 500, 1250, 500, 400, 600, 300, 600, 350, 550, 350, 600, 350, 550, 400, 550, 1150, 600, 350, 600, 1150, 600, 350, 550, 400, 550, 350, 600, 350, 500, 450, 500, 400, 600, 350, 550, 400, 500, 350, 600, 350, 600, 300, 550, 400, 550, 400, 550, 400, 550, 350, 550, 350, 600, 350, 600, 300, 550, 400, 550, 400, 550, 400, 550, 350, 550, 350, 600, 350, 600, 350, 550, 400, 550, 350, 600, 350, 550, 400, 500, 450, 550, 350, 600, 350, 550, 350, 550];
a = [];
b = 0;
c = 1;
for i = 1:length(mass_i)
b = not(b);
for j = 1:mass_i(i)
a(c) = b;
c = c + 1;
end
end
plot(a)
ylim([-0.5,1.5])
1. For C, you can try MathGL or draw it with your hands in the same Qt (or find a suitable library for Qt). If you have a C / C ++ application with a graphical interface, then it is not difficult to reproduce such a graph yourself.
2. Write a module for matlab, as far as I remember it is not very difficult to do there, though I did not transfer data arrays.
3. For these purposes, I made a wrapper over the library that implements the module for Python and now I draw graphics in python. In python, you can transfer the entire array at once, without conversion, and display it in graphics using NumPy and Matplotlib.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question