# Conversion from continuous to sampled signal?

I am bit confused regarding sampling as i read different types of statements in different texts

Forexample i have a continous time signal $$x=sin(t)$$ defined for $$t=0:10$$ and i want to sample it with sampling frequency 5000hz How can i obtain sampled signal $$x[n]$$ in this case

Please guide me which of following two ways is correct to define sampled signal?

$$x[n]$$=$$sin(ts)$$ where ts=1/5000

               or


$$x[n]$$=$$sin(ts/fs)$$ where ts=1/5000 and fs=5000

• neither of your functions are a function of n – Stanley Pawlukiewicz May 20 at 12:31
• @StanleyPawlukiewicz i didn't understand your comment,please elaborate – engr May 20 at 17:52
• a function of n, there is no n in the sine terms – Stanley Pawlukiewicz May 20 at 18:00
• @StanleyPawlukiewicz But please let me know,is it essential to introduce or include 'n' term while converting your continous time signal to sampled version – engr May 20 at 18:31
• i don’t want to be disrespectful but do you typically need to be told something 3 times? – Stanley Pawlukiewicz May 20 at 19:02

You typically write a sine wave as $$x(t) = sin(2 \cdot \pi \cdot f \cdot t)$$ where t is time and f the frequency of the sine wave.

Please note that both time and frequency are physical quantities, i.e. they have values and units. The units need to cancel each other since you can't apply the sine function to a unit

If you want to sample this at $$f_s = 5000 Hz$$ you simply calculate the value every a time interval $$T_s = 1/f_s$$. You get

$$x_d[n] = sin(2 \cdot \pi \cdot f \cdot n \cdot T_s)$$

or

$$x_d[n] = sin(2 \cdot \pi \cdot n \cdot f/f_s)$$

Whether this is "correct" or not depends the ratio of frequency to sample rate and whether this meets the criteria of the sampling theorem or not.

• is it must to include'n' term in your equation/definition of sampled signal along with 2,pi and f ? – engr May 18 at 19:42
• @engr What do you suppose it would mean if the value of $x_d[n]$ did not depend on $n$? – Solomon Slow May 22 at 2:07
• @SolomonSlow it wouldn't have been converted into discrete time and it would remain in continous time – engr May 22 at 5:17
• @engr, Math is a language. If you want other people to understand what you're saying when you write mathematical expressions and mathematical equations, then you should learn the language. If you write that $x_d[n]=f(y)$, where $f(y)$ does not depend on $n$, then that is the math way of declaring that every $x_d[n]$ is the same value as every other $x_d[n]$. In other words, it's a declaration that you're sampling a pure DC "signal." – Solomon Slow May 22 at 13:18