i want to ask a qe. in signal sampling ( A/D )

i really couldn't *imagine* how could i take a wave and sampling it . then restoring it without *any* lose if i took Ws > 2*Wm !!!
i know it is something related to the properties ( which i can imagine ) of *most* signal which is, any wave could be represented by a group of sin and cos.

i know what the laws say. but i used to imagine things and not to trust laws :))
i have searched the net . but all are specking & explaining sampling in frequency domain .

i really will be glad if you guide me to a website or a book that explain sampling in time domain.

I am really very curious to *imagine* how this magic is done, I can't sleep.

to Moderator: Is this is the right place to post this here, if not plz move it to the correct place.

Posted on 2002-06-19 17:42:06 by Sa6ry
Do a search on FIR filter tutorials. Usually they have the background theory (smapling theory) to lead you into the filter tutorial.
Posted on 2002-06-19 18:29:30 by sceptor
hi,

i'm not sure if i can help you, but what does sampling mean? do you want to put a signal into its pieces (sine and cosine)? you told us that you already know that a signal is always represented by sine and cosine waves..

you know, my physics teacher has coded a program in asm that analyzes a short wave file (in german this is called "Fourier Analyse") and shows how much difference sine waves take part in the signal. dunno if this is what you need, but if you're interested i could ask him for the source.

bye,
-NOP-
Posted on 2002-06-21 10:55:50 by NOP-erator
You mention of Nyquist Frequency (Ws > 2*Wm)

This is easy to understand.. but kinda hard to write, so here is a picture:
Posted on 2002-06-21 12:12:13 by NaN
Thing here to note is multiples of the Nyquist sample rate give straight lines: This is cause they are aliased into 0 (zero) hz!!! Or D.C.

(( The more important theory governing all this is call the Z-Transform, and the Unit Circle @ SampleRate ~~ Hint hint: Good google keywords here ;) ))

For every case, the input is a 2khz sine wave.

@ 600uS sampling (1.667khz) the 'sampled' wave is actuall a lower frequency sine wave! This is called ALAISING, the faster wave is viewed as a slower one, or alaised.

The Actual frequency of the samed wave has a period of 3000uS, which is 333.33hz. This can be measured and verified, but can also be calculated as:

AliasedFreq = Absolute ( InputFrequency - SampleFrequency )
333.33hz = 2.0 khz - 1.667khz

This phenomina is also observed in the "car tire" effect. When driving on a highway, and you see a car beside you, its tires sometimes looks to be moving slowly. In fact your eyes are what is slow, not the tire. Your eyes are seing the "frames" at a slower rate, and your brain puts the images together at a slower alaised result!!! The tire has made many full 360 degree revolutions before your eye samples another picture!! The human eye samples somewhere between 30->40 hz. A tire spins a LOT faster than this at 100km/hr ;)

In this case, the RED line would be your eyes, and the BLUE line is the car tire.

Moving on:

@500uS you see a straight line.

0 hz = 2.0khz - 2.0khz !!! (makes sence to me ;)

@420uS you get a faster Alaised result: measured period = 2650uS, or 377hz (close to 380hz).

380hz = abs( 2.0khz - 2.38khz)!

This checks out again..

@250uS you get 2.0 times, or at the Nyquist point.

2khz = abs( 2khz - 4khz)

So why dont you see a full 2khz wave?? Answer is because of the PHASE of the sampled data relative to the input data. Here the phase is 1/500 * 360 degrees (very small amplitude!). Since we are sampling at the same rate as the signal, we get a very low amplitude 2khz signal!. If we delayed the phase by 90 degrees, you would get a a FULL AMPLITUDE, triangle wave at 2khz (since the sample points would be at 90 and 270 degrees).

@200us, we are still getting a 2khz sampled data, but the amplitudes are still a bit erratic, because the samples are still pretty far apart, relative to the 2khz input wave. This is still 2khz tho!

@50us, we get a nice reproduction of the input sine wave, as we get LOTS of samples thru out the wave to reproduce 2khz nicely!

:alright:
NaN
Posted on 2002-06-21 12:33:42 by NaN
There is an ebook !
And it is absolutely free !

visit:
www.dspguide.com

The book has about 700 pages.
Posted on 2002-06-21 12:58:57 by Zero
thanks all for tring to help me.
& thanks NOP-erator for your offer. but i already proved this to myself using matlab.

i have another notice on sampling .

lets say we have

X = Sin(t)
which mean
i will take two samples or more in each period.
according to the sampling theory.

but lets say by luck i took my sampling at every zero
i.e. at Sin(0) , sin(Pi/2) , sin(Pi) .... etc

after sampling i will have an array of Zeros , right ??

Thanks Nan for the example :alright:
but this mean that when i sample their is some loss right ??
they teach us here in the fac that their is no loss.
Posted on 2002-06-22 21:43:59 by Sa6ry
Yup...

You would be sampling at EXACTLY 2*Wm (not greater than). And this case is shown above in the 4'th window down (4Khz sampling).

The only difference here is i started my sampling at position #1, not 0, so i get a very small ripple:

+/- sin( 2*pi*1/500 ) = Amplitude of the ripple

:nan:

PS: There is *always* data loss when converting from analog to digital. Analog by definition is INFINITE precision, in both TIME and AMPLITUDE. Our mortal machine (no matter what company) *CAN NOT* sample all the data for all time.

This is the trade off for things like MP3's: what bit rate do you want for sound quality (sample rate, and max high freq selection), as well as how many bits you want to reserve to store each sample! No point have a very high sample rate if your storing each sample in 2 bits! (00, 01, 10, 11) Doesnt leave alot of room for recreating a smooth wave form! ;)
Posted on 2002-06-22 22:01:33 by NaN
Thanks a lot Nan.:alright:

now it make some sence to me.

in fact what was confusing me so much the word they said.
"no data loss"

thanks a lot.

i may now re-read from another view.

thanks alot
Posted on 2002-06-22 22:20:18 by Sa6ry
I have just found this *great* site .

http://www.jhu.edu/~signals/index.html

hope it may help any.

and thanks for all who helped me here.
Posted on 2002-06-22 22:58:26 by Sa6ry