1

I'm trying to calculate a sine wave using the formula... $$ x(t) = A\sin{(2 \cdot \pi \cdot f_q \cdot t)} $$ Where $t$ is time (seconds), $A$ is amplitude and $f_q$ is frequency (Hz)

When I calculate $x(1) = 1 \cdot \sin{(2 \cdot \pi \cdot 1 \cdot 0.25)}$, I get $1$ which is expected. However, when I calculate $x(1) = 1 \cdot \sin(2 \cdot \pi \cdot 20000 \cdot 1)$, I get -1.9427294e-12. How is the answer $\gt -1$?...The amplitude is 1.

Thanks in advance...

John Omielan
  • 47,976
Paul
  • 47
  • I don't get the logic of you putting in the numbers. At first, you wanted to calculate $x(1)$ which means $t=1$. But you wrote $$ x(1) = 1 \sin{(2\pi\cdot 1 \cdot 0.25)} $$ which has $t=0.25$?! Where did this number come from? And in the last expression you used $f_q=2000$; where did this number come from? Anyway, onto the real question: You literally just have to plug in the correct values and it'll be all correct. And remember to use radians instead of degrees in the calculator. – Matti P. Aug 16 '19 at 05:28

1 Answers1

0

Your equation of

$$x(t) = A\sin(2\pi \times f_q \times t) \tag{1}\label{eq1}$$

has an amplitude of $|A|$, so with $A = 1$, it's amplitude is $1$, as you state. This means the range of the possible values is $-1 \le x(t) \le 1$. With the second set of calculations where you get

$$x(1) = 1 \times \sin(2\pi \times 20000 \times 1) = -1.942794\text{e-}12 \tag{2}\label{eq2}$$

the value of $-1.942794\text{e-}12$ is in scientific notation and means $-1.942794 \times 10^{-12}$, i.e., it is $-0.000000000001942794$, which is very close to the correct value of $0$. Also, this is $\gt -1$, as you state, so it's a valid value.

John Omielan
  • 47,976
  • Thanks for your response. I don't understand the scientific notation I'll do some research on it. Why is the answer not 0? If a sine wave does 2000 cycles per second, at 1 second wouldn't it be 0? – Paul Aug 16 '19 at 06:01
  • @Paul The E-notation section of the Wikipedia article "Scientific notation" has a basic, but fairly good, explanation. As for why it's not $0$, there are several issues. First, the value of $\pi$ is transcendental, so it's representation in the computer is not exact. Also, whatever algorithm is used to calculate $\sin$ will also not give an exact answer. The result you got, which is very close to $0$ (about $-2 \times 10^{-12}$, so over $11$ decimal places accurate), with this small descrepency likely due to those $2$ reasons. – John Omielan Aug 16 '19 at 06:10