N
N
Nikitulb2016-12-07 15:47:13
block diagram
Nikitulb, 2016-12-07 15:47:13

How to generate a rectangular pulse signal programmatically?

Hello, this issue has already been covered in the plane of writing a function for a graph in C ++. I need to understand the algorithm of a program that can generate a rectangular pulse signal. Preferably in block diagram form.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
x67, 2016-12-07
@Nikitulb

The signal is periodic, right? What do we have periodic? well, for example, a sine .. excellent, there is a basis. Now about properties. Is the signal square or do we change the duty cycle? Let's change, suddenly come in handy. Yes, it would be nice to change the period too. Well, the phase then too .. Then we get the following function:
k1 is responsible for the period
k2 is responsible for the phase shift
k3 is responsible for the duty cycle
{
for sin(x*2pi*k1+k2)>k3, Y=5
for sin(x*2pi* k1+k2)<=k3,Y=0
}
Well, you can draw squares even in python, even in assembler. And I also advise you to read something about the Fourier transform later.
And if you want to shove squares in MK, look for libraries with a finished bike. Well, you can play without sines through even / odd, remainder or other similar things

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question