# Sampling Theorem

#### Kermit2

Joined Feb 5, 2010
4,162
i'm gonna break for some coffee and pancakes... be back later. Maybe much later

Joined May 19, 2013
214

Joined May 19, 2013
214
More here.

This is all. I don't get it.

I understand bit rate, bit time, sampling frequency, sampling period.
But SPB...

#### Kermit2

Joined Feb 5, 2010
4,162
samples per bit is an awful way to put it.

RESOLUTION. How finely is your captured data point parsed out for a match.

8 bits is 256 discrete levels of possible meaning for your captured data.
16 bits is even more finely divided.
20 bits, 24 bits etc.

Joined May 19, 2013
214
Let's go back to basics because I am confused. Is the first time when I learn about digital communications.

Suppose that I record an audio signal with a sampling frequency Fs, each sample being on n bits (this is the resolution, I am familiar with this notion). Thus, I would have N=Tw*Fs samples separated by Ts if the audio signal takes Tw time. These samples I can store in memory and the audio signal will occupy Size = N*n bits = Tw*Fs*n bits.

Now, I want to play this audio signal. Then, I must play it with the same sampling frequency, i.e. I must give out each sample at a rate of Fs. I cannot just give the first sample and then wait one hour. I must give them out at Fs samples per second so that whoever listens enjoys. And I give them out using the zero-hold process maybe.

Now suppose that I want to send these bits and not play them. Suppose that I send them with s bps. Thus, all the N*n bits I will send in N*n/s seconds.
Is everything correct until now?

Now suppose that I want to send them and play them in the same time, i.e. I receive the first sample, I give her out, and so on. So, of course, I must play them with Fs samples per second. To play them with Fs samples per second, I must send them with Fs samples per second, or, in bit terms, with s=Fs*n bps. Right? And each n bits of each sample must be given out, of course, in parallel, i.e. each sample must be given out sequentially at every Ts.

Is everything correct until now?

I am saying this because this SPB notion, I think, intuitively, has something to do with sending them and playing them in the same time. It must be SPB = Fs/s = 1/n in order to send the samples and play them in the same time.

Other purposes of this notion, I don't see. It must have something to do with sending them and playing them in the same time because it is defined in both the bit rate and the sampling frequency.

Joined May 19, 2013
214
Aaaaa, and bits per sample is n.
So samples per bits is the inverse of bits per sample. So, thats why you say that its an awful way to put it. Right?

They are equivalent notions.

And, of course, If I want to send them and play them in the same time, I must send them with n bits per second,i.e. with one sample per second.

Its all been cleared now.

Joined May 19, 2013
214
But they say that SPB = 4. So, that means that bits per sample is 1/4??

#### crutschow

Joined Mar 14, 2008
32,839
The only converter type I know that uses more than one sample per bit is a sigma-delta type. Is that what you are referring to with SPB?
If so, the SPB is invisible once it generates the output digital word (number) with the specified bits per word. The converter averages the samples internally to derive the output word.

Joined May 19, 2013
214
I don't know what I am referring to. I take this course online on edx and in the first week they introduce this notion out of thin air. I asked on their forum and I still wait for an answer.

Maybe this other slide would make more sense.

#### MrAl

Joined Jun 17, 2014
10,582
Hello,

Yes the first thing you have to do is separate the pure theory from the pseudo theory. The pseudo theory is an attempt to mix real life with theory, which is good when you have to study the effects of real life. But the pure theory is what draws out the road map for why we even want to do stuff like this in the first place. Once the pure theory is established and invoked, then we can start to make approximations. But until that point, the pure theory is not an approximation it is an exacting set of rules that spit out exact values and that is not even to an arbitrarily chosen small error, it is with zero error. Number crunchers will dictate some arbitrarily chosen small error, but then that is part of the transition from pure theory to real life. For the pure theory however, there is no error. Let me state that once more: for the pure theory there is no error whatsoever and that is the very nature of pure theory, unless of course the theory predicts an error and then it is not really an error because it was predicted by the theory that describes the whole process. When the pure theory does not predict an error, then there is no error whatsoever.

As with any theory however, there are assumptions. The assumptions are necessary in order to keep the theory pure and exact. By doing this we learn how the pure theory works, which teaches us a great deal, and then we can figure out how to apply that to the real world where the assumptions get replaced by approximations.

In this case, the assumption is that we are dealing with one perfect frequency component. That frequency component is easily reproducible because it doesnt contain that much information to start with. Given that assumption holds, then a limited amount of information will allow us to reproduce that original information because it was already limited to begin with. Had it been more complex, then we would have needed a perfect filter to filter it into a form that meets the requirements of the assumption (that it had limited information content). We can then get the reproduction of the original as exact as it was before it first was transformed.

So in short, one frequency in, one frequency out. That's why it works. And any frequencies lower than the required assumption frequency means we actually have more information than we really need, so it is no wonder why we can get the original back again.

I cant help but interject a short quote to think about which i think you've all heard now:
"In theory there is no difference between theory and practice; in practice there is."

But isnt that in itself a theory? So if there is no difference between theory and practice that's fine, but if there is (second clause) then that theory is wrong because the first clause states that there is no difference between theory and practice, and that is a theory. So in other words there is always a difference between theory and practice, and so it should read:
"In theory there is always a difference between theory and practice".

Last edited:
• #### crutschow

Joined Mar 14, 2008
32,839
I don't know what I am referring to. I take this course online on edx and in the first week they introduce this notion out of thin air. I asked on their forum and I still wait for an answer.

Maybe this other slide would make more sense.
It would indeed appear that they are taking 4 samples and averaging them to make one output bit.
As I noted, the only converter type I know of that (sort of) does that is a sigma-delta.
It does seem an odd way to introduce the over-sample concept. I've never seen it represented that way anywhere else.
Normally it's the number of over-samples per output word, not output bit, that's discussed.

#### nsaspook

Joined Aug 27, 2009
11,738
It would indeed appear that they are taking 4 samples and averaging them to make one output bit.
As I noted, the only converter type I know of that (sort of) does that is a sigma-delta.
It does seem an odd way to introduce the over-sample concept. I've never seen it represented that way anywhere else.
Normally it's the number of over-samples per output word, not output bit, that's discussed.
Yes, it is sort of strange but it's the way many serial converters work under the hood. On a PIC with a EUSART the internal receive data recovery block is a 16X shifter that samples 16 times per bit time slot to determine if it's a one or zero. So they are using a 1 bit 'ADC' to oversample the input for 1 bit before it goes to the serial data shift register.

Joined May 19, 2013
214
Yes, that is what they really mean. The bit sequence is sampled multiple times per bit.

Consider the following problem:
"Consider a system that uses 8-bit ASCII codes to encode letters. How long will it take to transmit the bit sequence encoding "Good Morning" (not including quotation marks) if we use a bit time of 5 samples per bit, and transmit samples at a rate of 1MHz?"

Ignore the solution.
So, I have 12 characters in that string. That means that I need to send 12*8 = 96 bits. So, I send this sequence of 96 bits. And the bit rate is determined by the sampling frequency at the other end, right?

Oooor, I have the sequence of 96 bits. And at the transmitter part, I sample the 96-bit sequence with 5 samples per bit, and I send the 96*5 samples? So, at the transmitter, I sample the sequence 5 times per bit.

What do I transmit? When am I doing the sampling?
Do I transmit the 96 bits and do the sampling at the receiver, or do I transmit the 96*5 samples?

Last edited:

#### Kermit2

Joined Feb 5, 2010
4,162

Joined May 19, 2013
214
Thanks. That is what happens.

I just saw the laboratory part of the course. It uses two boards facing each other and the transmitting board uses a LED to send bits.
And to send a 1, the LED is switched ON. And it is maintained like so 50 us. And in these 50 us, the other board samples for 50 times with a sampling frequency of 1MHz (so one every microsecond). And the reason for oversampling is reliability.
So, the sampling is done at the receiving part and 96 bits are sent.

But my question is this. What is fixed and what is calculated?
Is the sampling frequency fixed and SPB fixed at the receiver side? And thus, the transmitter will have to adjust its bit rate?
Or the bit rate is fixed, and the transmitter if it wants to sample this many times per bit, then it will have to adjust his frequency sampling?

What is usually fixed?

Last edited: