S
S
stirvet2019-01-26 23:59:35
C++ / C#
stirvet, 2019-01-26 23:59:35

How to set a sine wave of a specific frequency in C#?

I can’t understand how to set a sinusoid with a certain frequency, so that it would be clearly visible, in accordance with the signatures of the column values. for example, to set the frequency to 100 Hz, there should be 100 oscillations per second, respectively. time on the horizontal axis.
tried to do it this way

chart1.Series[0].Points.AddXY(j, Math.Sin(2*Math.PI*1000*j));

nothing worthwhile is obtained, no binding to the frequency.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
CHolfield, 2019-01-27
@CHolfield

Take a geometry textbook and read about the graph of the function of the sine of an angle, and there is a bit about the coefficients that change the appearance of the graph (frequency and amplitude) - this is called transforming the function graph. You can find it in Google using a similar phrase if you are too lazy to learn. Then think about the scale of your chart1, the spacing, and the x-axis labels. After that, you will understand that the question is not worth a damn. You will soon begin to ask how the ass is wiped, God forgive me.

V
Vadim Mamonov, 2019-01-28
@dikysa

So you need not 1000 coefficients, but 100. cos (2 * Pi * x) - 1 Hz, but cos (2 * Pi * 100 * x) - now 100 Hz. Just not sure what is your problem?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question