YouTube2Text

EECS 373 - Fall 2026 - Lecture 13: "Overview: Analog Signals" — Transcript

by Interactive Sensing and Computing Lab · 10,670 words · 1,639 segments · language en · Watch on YouTube

Full transcript

  1. 0:28All right, let's get started.
  2. 0:30Can you guys hear me? Okay. Y
  3. 0:33Okay. So, today we're going to be
  4. 0:35talking about uh analog signals.
  5. 0:38Quick announcement. If you haven't
  6. 0:40already put your team into that Google
  7. 0:43forms, if you could do that, I think we
  8. 0:45still have a couple teams that haven't
  9. 0:47done it. So, go ahead and get registered
  10. 0:49today. That's due today.
  11. 0:52Okay. So we're going to be talking about
  12. 0:54uh analog signals and how they uh
  13. 0:57interact with embedded systems or why we
  14. 0:59need them for embedded systems. Uh so
  15. 1:01today we're just going to do kind of an
  16. 1:03overview and then next week I don't
  17. 1:06think you guys have lecture. After that
  18. 1:07you'll learn more about the specific
  19. 1:10analog to digital converters, the
  20. 1:12different versions that we have and then
  21. 1:14digital to analog converters, all the
  22. 1:17different kinds we have for those. But
  23. 1:19today is just kind of like an overview
  24. 1:20on how all that works.
  25. 1:24So uh why is this important? So digital
  26. 1:29systems they need to kind of interact
  27. 1:31with the real real world. So the real
  28. 1:33world is analog, right? So there's a lot
  29. 1:35of things that we need to inter uh
  30. 1:37interact with like sensors and maybe
  31. 1:40some sounds that are analog. Okay. And
  32. 1:43in embedded systems, a lot of these
  33. 1:45embedded systems, you're you're
  34. 1:46interacting with them quite a lot. If I
  35. 1:49was designing maybe a server in the
  36. 1:51cloud, maybe I don't care that much
  37. 1:53about that being able to interact with
  38. 1:56analog. But for embedded systems, analog
  39. 1:59is really important. And it's important
  40. 2:00that our microcontrollers, for instance,
  41. 2:03have those analog to digital converters
  42. 2:05or those digital to analog converters.
  43. 2:10So, uh, we want to potentially measure
  44. 2:13analog signals, but there's also
  45. 2:14scenarios where maybe we want to control
  46. 2:17analog signals. Um, so maybe we want to
  47. 2:20generate sound. That would be an
  48. 2:22example.
  49. 2:23So, to to measure analog signals, we use
  50. 2:27something called an analog to digital
  51. 2:29converter. And that's basically going to
  52. 2:31take some kind of signal, usually a
  53. 2:33voltage, and it's going to convert it
  54. 2:35into a digital value. Okay. The the most
  55. 2:39go-to example is a microphone. Okay, a
  56. 2:42microphone is going to take sound waves.
  57. 2:44It's going to vibrate and it's going to
  58. 2:46create this analog voltage. If we hook
  59. 2:49that up to, for instance, a
  60. 2:50microcontroller, we would use an analog
  61. 2:52to digital converter inside the
  62. 2:54microcontroller to convert that to a
  63. 2:56digital value. And then I could, for
  64. 2:57instance, record an MP3 file. Okay.
  65. 3:01Other things that we might want to use
  66. 3:03an ADC for, um, a bunch of different
  67. 3:07sensors. Basically, any sensor out
  68. 3:08there, whether it's like a temperature
  69. 3:10sensor or a light sensor, it's going to
  70. 3:12output some kind of analog value. Okay.
  71. 3:15So, if we want to interface with those
  72. 3:17sensors, we need to use an ADC.
  73. 3:22All right. Going the other way around,
  74. 3:23let's say I have an audio file, an MP3
  75. 3:26file, and I want to listen to that,
  76. 3:28right? How am I going to do that? Well,
  77. 3:30I'll use a digital to analog converter.
  78. 3:32It'll take that MP3 file, and then
  79. 3:34convert it into a voltage, maybe like a
  80. 3:37sine wave, and then we could put that
  81. 3:39onto a speaker, and then we would hear
  82. 3:41that. Um, does does everyone know how a
  83. 3:43speaker works? I find that a lot of
  84. 3:45people don't know this. So, a speaker is
  85. 3:47like a coil wrapped around a magnet.
  86. 3:50They call it a voice coil. And then that
  87. 3:52coil is connected to a diaphragm. And
  88. 3:54when you put voltage through that coil,
  89. 3:56it'll shake back and forth. that
  90. 3:58diaphragm will move back and forth and
  91. 4:00then you'll hear that audio. Okay,
  92. 4:01that's kind of how it basically works.
  93. 4:03But we first need to start with that
  94. 4:04voltage in order for that thing to work.
  95. 4:06And so that's where a digital to analog
  96. 4:09converter comes in. Um radio
  97. 4:12transmitters that might be another
  98. 4:13scenario or another use case where we
  99. 4:15might need a DAC if we want to generate
  100. 4:18radio frequencies use those are often
  101. 4:20done with DAXs.
  102. 4:23Does that kind of make sense why these
  103. 4:24are important for embedded systems?
  104. 4:29So, you guys have already used an ADC in
  105. 4:31a DACK in lab. So, the oscilloscope,
  106. 4:34that's a good example of an ADC. It's a
  107. 4:36pretty fancy ADC. Um, it has really low
  108. 4:40noise. It can also measure a bunch of
  109. 4:42different voltage ranges. That's kind of
  110. 4:44the unique thing about an oscilloscope.
  111. 4:47Um, or function generator. That's how
  112. 4:50that works is it has a DAC inside of it
  113. 4:53and it takes some digital value. Let's
  114. 4:55say you're trying to generate a sine
  115. 4:56wave. It takes the digital
  116. 4:58representation of that and converts it
  117. 5:00into an analog signal that's outputed uh
  118. 5:03on the output jack. Okay.
  119. 5:08Okay. So sampling rate. So if we had a
  120. 5:11sine wave for instance
  121. 5:13um and we wanted to capture that there's
  122. 5:16infinite amount of points on that on
  123. 5:19that sine wave, right? So we can't store
  124. 5:22infinite data. So what we have to come
  125. 5:24up with is a way to sample that and we
  126. 5:26have to come up with a reasonable
  127. 5:27sampling rate. So how often are we
  128. 5:30actually going to measure that analog
  129. 5:32voltage? That's what we call sampling
  130. 5:34rate.
  131. 5:36Um okay an example might be a CD. Uh who
  132. 5:41knows what a CD is?
  133. 5:44Raise your hand. Okay. Who has listened
  134. 5:46to a CD?
  135. 5:48Okay. A couple. Okay. A decent amount. I
  136. 5:50thought it was going to be less. Um, I
  137. 5:52think the I the iPod came out what in
  138. 5:552001. So that that predates everyone
  139. 5:57here, right? I think um doesn't predate
  140. 6:00me obviously. Well, maybe not obviously.
  141. 6:02[laughter]
  142. 6:03Okay. Who here has listened to Spotify?
  143. 6:07Okay. I think that's everyone. I think
  144. 6:09that's a better example.
  145. 6:11So, if you were to go to Spotify's
  146. 6:14website and you looked at the audio
  147. 6:16qualities that they support, if I sp if
  148. 6:19I pay for Spotify premium
  149. 6:22um and I I put my audio quality to the
  150. 6:24max quality, they call it lossless. So,
  151. 6:27that means that um it has all of the
  152. 6:29audio data there that would be in the
  153. 6:32original file. They have these little
  154. 6:34specs here and we can see it says 24bit.
  155. 6:37That's going to be our resolution. And
  156. 6:39we'll talk about that a little bit
  157. 6:40later. And then this right here, we have
  158. 6:4344.1 kHz. Okay, that is our sampling
  159. 6:46rate. Okay, why did they pick that
  160. 6:50number? Does anyone have any idea why
  161. 6:52they picked 44.1 kHz?
  162. 6:58What can our ears hear like in air? If
  163. 7:02there's a sound sound waves coming, at
  164. 7:05what frequency can we no longer hear
  165. 7:07beyond that? Do you guys know? Yeah,
  166. 7:09>> it's 20 kHz.
  167. 7:11>> Yeah, it's 20 kHz. Yeah, it's about 20
  168. 7:13kHz. Younger people are are higher,
  169. 7:16older people are or lower. Um, okay. So,
  170. 7:20based on that, so 20 kHz, why did they
  171. 7:22kind of double that and go to 44 kHz to
  172. 7:25represent audio? Yeah.
  173. 7:27>> Um, in order to recreate a signal from
  174. 7:30sampling, you have to sample at the
  175. 7:32frequency, which is double um like sort
  176. 7:34of the maximum
  177. 7:36frequency. So, The maximum frequency is
  178. 7:3820.
  179. 7:40>> Yep. Exactly. And we'll talk about that
  180. 7:42in the next slide, but you're right.
  181. 7:44It's Nyquist and they did 44 because
  182. 7:46they wanted to go a little bit higher
  183. 7:48than 40 uh because there's you're going
  184. 7:51to have some filters in there and we
  185. 7:52kind of give want to give some headroom
  186. 7:54for those filters. We can talk about
  187. 7:55that later as well, but that's where
  188. 7:57that 44 kHz comes from.
  189. 8:00Okay, this is on the slide. I'm not
  190. 8:03really sure what medium quality sampling
  191. 8:05rate means, but there you go. 22 kHz is
  192. 8:08medium sampling. And then phone
  193. 8:11sampling. Um, who here has talked on a
  194. 8:14landline?
  195. 8:17Okay, most of you. Okay. [laughter]
  196. 8:20Um, so back in the days when we had
  197. 8:22landlines all over the place, those were
  198. 8:24at like 8 kilhertz. Okay. Um, nowadays
  199. 8:28if you're doing a call over 5G, it's
  200. 8:31actually sampled at like 48 kilhertz. So
  201. 8:34quite it sounds pretty good nowadays,
  202. 8:36but back in my day it didn't sound as
  203. 8:38good. If you guys have called like um a
  204. 8:42company and they put you on hold and
  205. 8:44they have that that on hold music
  206. 8:46playing and it sounds like like crap,
  207. 8:49it's because it's being sampled so low.
  208. 8:51That's what's going on there.
  209. 8:53Why when they were, you know, making
  210. 8:55these landlines, why did they decide
  211. 8:57that, okay, we're going to use 8 kHz as
  212. 9:00a sampling rate when we really need like
  213. 9:0340 kHz in order to actually represent
  214. 9:05the audio that you can hear? Why did
  215. 9:07they pick 8,000?
  216. 9:10Does anyone have an idea why they did
  217. 9:11that?
  218. 9:14So, yeah, go ahead.
  219. 9:19>> Yeah. Yeah, that's the idea behind it.
  220. 9:21So our voices, most of the the sound
  221. 9:24that our voices are making are below 8
  222. 9:27kHz or probably below 4 kHz. And so they
  223. 9:32decided, okay, 8,000 is enough to convey
  224. 9:35people's voice. And and if they went
  225. 9:37higher, that would use more data. Their
  226. 9:40the phone lines would have to be faster.
  227. 9:42So that's how they came up with 8,000
  228. 9:44kHz. Okay. So does sampling rate kind of
  229. 9:47make sense? This is all talking about
  230. 9:49audio, but we could obviously sample
  231. 9:50things that are a lot faster. Um, but
  232. 9:54yeah, so let's go on to Nyquist.
  233. 9:57Okay, so this is a theorem, Nyquis
  234. 10:00Shannon sampling theorem. And the
  235. 10:02theorem is is that if we want to
  236. 10:05replicate a signal that we have sampled,
  237. 10:08we have to sample it at twice or more
  238. 10:11than twice the maximum frequency that
  239. 10:14we're sampling. Okay, that's the only
  240. 10:16way that we can reconstruct that signal.
  241. 10:21Okay, and if we don't do that, there's
  242. 10:23something that happens called al-isting.
  243. 10:26And this is some error. And we'll kind
  244. 10:28of show some examples of what that would
  245. 10:29look like. But if if we have some
  246. 10:31signals in the signal that we're
  247. 10:34sampling that are at a higher frequency
  248. 10:36than our Nyquis rate, then we'll have
  249. 10:38alysine and it would cause issues.
  250. 10:43Okay? And it'll it'll make it look like
  251. 10:45we're actually sampling different
  252. 10:46frequencies instead of what we are
  253. 10:48actually sampling.
  254. 10:51And this theorem assumes that there's no
  255. 10:54noise and there's no clock jitter. Okay?
  256. 10:57So noise would be like if there's some
  257. 10:59high frequency noise in the background,
  258. 11:01we need to make sure we filter that out
  259. 11:03before we do our sampling. Otherwise,
  260. 11:05it's going to screw up this whole thing
  261. 11:06and we won't be able to reproduce the uh
  262. 11:09the signal that we recorded. And then
  263. 11:11clock jitter. That's how precisely we're
  264. 11:14taking these measurements. Like we need
  265. 11:16the time between each measurement to be
  266. 11:19very precise. Otherwise, it screws up
  267. 11:22Nyquis. Okay? So that's why if you were
  268. 11:25for instance uh measuring some kind of
  269. 11:27signal with an ADC, you probably want to
  270. 11:30put a timer into that ADC to basically
  271. 11:33tell it, okay, exactly at this time,
  272. 11:35this is when you're going to do that
  273. 11:36sampling. Okay.
  274. 11:42All right. So if we look at this this
  275. 11:45signal here, this has been sampled. What
  276. 11:48is the sampling rate of this signal? So
  277. 11:51why don't you guys spend like 20 seconds
  278. 11:53thinking about that and let me know.
  279. 12:10>> [clears throat]
  280. 12:13>> Does anyone have a guess?
  281. 12:17>> Yeah.
  282. 12:20>> What' you say?
  283. 12:21>> It's not 3 kHz. It's close. You're close
  284. 12:24though. Maybe you counted slightly
  285. 12:25wrong. Yeah.
  286. 12:27>> Yeah, it's 2 kHz.
  287. 12:29Um, yeah. So, we're That's how many
  288. 12:31That's how often we're taking these
  289. 12:32samples. How far apart these these
  290. 12:34points are. What is the signal? If you
  291. 12:36kind of just connect the dots,
  292. 12:39what would the What do you think the
  293. 12:40signal that we're measuring here, what
  294. 12:43frequency is that at?
  295. 12:55>> Yeah,
  296. 12:56>> I think it's 200.
  297. 12:58>> Yeah, it's 200 kHz.
  298. 13:00Okay. So, that's that's what we were
  299. 13:03that was the signal, right? that sine
  300. 13:04wave right there that was a signal. We
  301. 13:06took some samples along that point and
  302. 13:09then we can easily just reconstruct it.
  303. 13:12Okay, so if I were to output this, it
  304. 13:15would clearly be a sine wave. Okay, so
  305. 13:17this is where Nyquis works out. We did
  306. 13:19everything right. We sampled at a fast
  307. 13:21enough rate and it's really easy for us
  308. 13:24to uh reproduce this signal.
  309. 13:28Okay, what's going on here?
  310. 13:30What if I told you there was a sine wave
  311. 13:33somewhere in there? What What's going
  312. 13:35on? What's going wrong here?
  313. 13:41Is it that maybe we're not sampling
  314. 13:43quick enough? Right. So here, let's kind
  315. 13:46of look at what's going on.
  316. 13:49You can see there is a sine wave in
  317. 13:52there, but we're only we're sampling
  318. 13:53where it's at that crossover point,
  319. 13:55right? So the problem is is we are
  320. 13:58sampling at exactly
  321. 14:00twice what the frequency is. So this is
  322. 14:03a I have it here in my notes. This is a
  323. 14:072000
  324. 14:08or no are oh we're just sampling a 2000
  325. 14:10hertz signal at 2000 hertz. Okay. And so
  326. 14:14then that that's what happens there.
  327. 14:16Okay. So we can't actually reproduce
  328. 14:18that because we weren't sampling fast
  329. 14:20enough.
  330. 14:23All right. What about this? This looks
  331. 14:24very similar to the one that we looked,
  332. 14:26In fact, I think it's identical to the
  333. 14:28one we looked at uh two slides ago. But
  334. 14:31what's actually going on here? Well, we
  335. 14:33really screwed up here. We are sampling
  336. 14:36way too slow. And this 2,200
  337. 14:40hertz signal looks more like a 200Hz
  338. 14:43signal because we weren't sampling it
  339. 14:46fast enough. Okay, does that all kind of
  340. 14:48make sense? What's going on with this?
  341. 14:52All right.
  342. 14:55All right. Do we think that this we were
  343. 14:59sampling fast enough for this plot here?
  344. 15:03Yes. No. Maybe. Any guesses?
  345. 15:12So, let's look at what this actually is.
  346. 15:15So, that that's actually what the signal
  347. 15:17was. And this is a valid. This is some
  348. 15:19signal that you could have actually been
  349. 15:20sampling. In this example, what we have
  350. 15:23here is we have 100 hertz on top of 400
  351. 15:26htz on top of 1,600
  352. 15:29hertz. Okay. Um, and I believe, yeah,
  353. 15:33and this is sampled at 4,000 hertz. So,
  354. 15:36we're way above the the Nyquis rate. And
  355. 15:38we were able to accurately reproduce
  356. 15:40what was going on here. This is what
  357. 15:42like if I was recording someone's voice,
  358. 15:44this is kind of what it would look like.
  359. 15:46So we have something called a
  360. 15:48fundamental frequency and that's how
  361. 15:50fast our vocal cords vibrate. It's
  362. 15:53somewhere be between like 100 and 200
  363. 15:55hertz. But to actually like make that
  364. 15:58tone into like words that actually make
  365. 16:01sense, you have something called
  366. 16:02harmonics, which are actually higher
  367. 16:04frequencies that your mouth makes and
  368. 16:07your tongue makes. And that's how you
  369. 16:09can actually make voice, right? Or a a
  370. 16:12voice that you can understand. And so
  371. 16:14those harmonics, those are those higher
  372. 16:16frequencies in here that get overlaid on
  373. 16:18top of that fundamental frequency. Okay?
  374. 16:21So if you ever look at like a waveform
  375. 16:23of someone's voice, it's going to look
  376. 16:25really messy. It's not going to be
  377. 16:26really clear what frequencies are going
  378. 16:28on. Uh but we could use Nyquis and we
  379. 16:31could figure out exactly what those
  380. 16:32frequencies are.
  381. 16:35Okay.
  382. 16:38All right.
  383. 16:41What's wrong with my slides?
  384. 16:44Okay, this is a a theorem that I think
  385. 16:46professor sample came up with and it's
  386. 16:48called the oscilloscope sampling. His
  387. 16:51his last name is sample. So he's he came
  388. 16:53up with his own um his own theorem
  389. 16:56called the oscilloscope sampling
  390. 16:58theorem. And the idea behind this is
  391. 17:02Nyquis is like ideal like if everything
  392. 17:04is perfect, there's no noise, everything
  393. 17:06is working out well, then we can do
  394. 17:08double uh we can just we just have to
  395. 17:11double it. But in reality, if you really
  396. 17:13want something to look like what it is,
  397. 17:16five times is um what you really want to
  398. 17:20do. Okay? And that's kind of what
  399. 17:21oscilloscopes do. So let's kind of look
  400. 17:23at this spec right here. So if you look
  401. 17:27at any oscilloscope, it's probably going
  402. 17:28to have a number at the top of it. And
  403. 17:30it's and for instance, this one, it says
  404. 17:32200 megahertz. Does anyone know what
  405. 17:34that number means?
  406. 17:39That's basically the limit that you can
  407. 17:41use this oscilloscope. Like that's the
  408. 17:43max frequency that you can measure with
  409. 17:45this oscilloscope. But underneath that
  410. 17:48there's this other thing um called 5
  411. 17:53GASA
  412. 17:56uh over S. Can anyone guess what that
  413. 18:00stands for? Yeah.
  414. 18:03>> Yeah. Giga samples per second. So here
  415. 18:05we have five giga samples per second. Um
  416. 18:08and this is a 4 channel uh oscilloscope.
  417. 18:13Uh if for instance this oscilloscope let
  418. 18:16me measure a signal on one of the
  419. 18:19channels at 5 giga samples per second.
  420. 18:22Some of them don't. Some of them will
  421. 18:23actually spread all those samples across
  422. 18:25all of those channels. But let's assume
  423. 18:27that it could do that. In this example,
  424. 18:30this oscilloscope would be oversampling
  425. 18:33the signal like a 200 megahertz signal
  426. 18:35by like 25 times. Okay? And so the the
  427. 18:39faster you can sample it, the more
  428. 18:40accurate those signals are going to
  429. 18:42look. Does that make sense?
  430. 18:46All right.
  431. 18:48Okay. So, we talked about sampling.
  432. 18:50That's like the time between the
  433. 18:52measurements. But how do we actually uh
  434. 18:54turn those measurements into values that
  435. 18:57are digital? Um again you know we have
  436. 18:59that that problem where a a signal is
  437. 19:02has infinite values okay and we we don't
  438. 19:05have infinite bits to store that. So we
  439. 19:07have to do something called quantizing
  440. 19:10and that's where we convert those
  441. 19:11voltages to uh like basically round them
  442. 19:14to the nearest value that we can
  443. 19:16represent.
  444. 19:18Okay. And so in this example let's say
  445. 19:22we're using only three bits to represent
  446. 19:25a voltage. That means we can basically
  447. 19:28uh store eight different values uh when
  448. 19:31we're measuring something. And so if we
  449. 19:33were trying to measure the sine wave and
  450. 19:34we were taking samples, you can see that
  451. 19:37there's kind of big step. It's like
  452. 19:38there's steps there, right? And that's
  453. 19:40because we just don't have many bits to
  454. 19:42store that information. Okay? If we
  455. 19:45added more and more bits, this blue
  456. 19:48stair stair step would look more and
  457. 19:50more smooth as we uh add more of those
  458. 19:52bits. And so a potential issue with that
  459. 19:56is let's say we have this voltage right
  460. 19:59here.
  461. 20:01Well, it's going to be represented as a
  462. 20:03four. But that four could mean somewhere
  463. 20:06between 1 volt and 1.25 [snorts]
  464. 20:09volts. Okay. And so that is a limitation
  465. 20:12we have. We have to decide how many bits
  466. 20:15we want to use to to represent this
  467. 20:17data.
  468. 20:20All right. And that's that's called
  469. 20:21resolution. And the way that we can
  470. 20:23calculate that often when um when
  471. 20:27engineers talk about the resolution of
  472. 20:29an ADC, they're going to just say, "Oh,
  473. 20:32this ADC is 8 bits." Okay, but that's
  474. 20:34technically not what the resolution of
  475. 20:37the ADC is.
  476. 20:39Um
  477. 20:42this is actually the formula u that it
  478. 20:46is. Well, not quite. We we'll we'll see
  479. 20:48why that isn't quite this. uh but it
  480. 20:51kind of makes intuitive sense. You have
  481. 20:53to first take the reference voltage and
  482. 20:56that's the voltage that's the voltage
  483. 20:58range that you're measuring at. So in
  484. 21:01this example, we're measuring between 0
  485. 21:03volts and 5 volts. Okay? So that's an
  486. 21:06important input into this equation. So
  487. 21:09that this voltage reference would be 5
  488. 21:11volts here. And then we'd be dividing it
  489. 21:13by the number of steps we have which is
  490. 21:152 to the n. n is three. So this would be
  491. 21:17basically 5 over 8. And that's how wide
  492. 21:20each each of these steps is. But if we
  493. 21:23actually look at this and we count how
  494. 21:26many steps there are for this voltage
  495. 21:28range, let's just count it out. We got
  496. 21:30one here, 2, 3, 4, 5, 6, 7. We don't
  497. 21:35actually have eight. And so that's why
  498. 21:37the equation has to be 2 the n minus
  499. 21:40one. But a lot of the times if you look
  500. 21:42in data sheets, they're just going to
  501. 21:43use this equation right here. um just
  502. 21:46because once we get to bigger bit sizes
  503. 21:49it really doesn't matter and if we kind
  504. 21:52of do that math if we have a 12bit ADC
  505. 21:55for instance
  506. 21:57if we do the math there the the
  507. 21:59difference in resolution between one or
  508. 22:01the other this equation or this equation
  509. 22:04is 0.1
  510. 22:06molts which is like basically nothing um
  511. 22:10so like for instance the ADC on your XMC
  512. 22:144700 it has a 12 bit ADC and so this
  513. 22:18would be kind of the difference between
  514. 22:19these two equations. Okay, the problem
  515. 22:22with this is see this 5 volts here. The
  516. 22:25only way that we can represent
  517. 22:27one one or the only uh voltage that will
  518. 22:30actually result in this code here 111 is
  519. 22:34if we have exactly 5 volts. Okay, but
  520. 22:37all these other steps like there's a big
  521. 22:39voltage range where it would result in
  522. 22:42this value. So it's very it'd be like
  523. 22:43almost impossible that we would actually
  524. 22:45get to this this value right here 111.
  525. 22:49So that's kind of an issue. Let's kind
  526. 22:51of talk about um how we could
  527. 22:54potentially fix that. Before we do that,
  528. 22:57let's look at how we actually take um a
  529. 23:02voltage and figure out what the code
  530. 23:04would actually be. So this is the
  531. 23:06equation we can use to take a voltage
  532. 23:09value and convert it into a digital
  533. 23:11value. Okay? And I'd encourage you to
  534. 23:15not memorize these. You should be able
  535. 23:18to once you kind of understand how this
  536. 23:19all works, you should be able to just
  537. 23:21kind of infer what the equation should
  538. 23:23be. Okay? Maybe right now an equation is
  539. 23:26good to kind of understand how this
  540. 23:27works. But as we talk about it more, you
  541. 23:30should be able to just kind of come up
  542. 23:31with this equation. Like I don't have
  543. 23:33these memorized, but if someone were to
  544. 23:35ask me how do I convert uh this voltage
  545. 23:38to this value on an ADC, I'd be able to
  546. 23:41do it. So what is this equation actually
  547. 23:44talking about here? Well, we have these
  548. 23:45things called RL and RH. These are our
  549. 23:49reference voltages. In this example, our
  550. 23:52reference voltage, our low reference
  551. 23:55voltage is zero and our high is 5 volts.
  552. 23:58But we'll find out later when we talk
  553. 24:00about ADCs that you can actually change
  554. 24:04these references here. Okay? So, if I
  555. 24:07wanted to measure a smaller signal, I
  556. 24:08could potentially make this reference
  557. 24:10smaller, but you need that voltage range
  558. 24:12in order to calculate what the actual
  559. 24:14digital value is going to be because
  560. 24:15they're going to spread that digital
  561. 24:17value across the whole voltage voltage
  562. 24:20range. Does that make sense?
  563. 24:24Any questions on how that equation kind
  564. 24:26of works?
  565. 24:29Okay. So, if we kind of plug some
  566. 24:31numbers into this equation, if we have
  567. 24:352.8 volts, we can see by based on this
  568. 24:38stair step that we're probably going to
  569. 24:39get uh three here. And how does that
  570. 24:42actually work out? So, here's the math.
  571. 24:44Figure it all out. And then we have to
  572. 24:46do a floor function because we can't
  573. 24:48have a a floating point in here, right?
  574. 24:50Usually an ADC is representing the value
  575. 24:53in an integer. We have to do a floor.
  576. 24:56And you can see in this example uh
  577. 24:58that's going to be three. Okay, that's a
  578. 25:00digital value that's actually going to
  579. 25:02be stored. But this this has some issues
  580. 25:05here. We have we have a lot of error,
  581. 25:08right? The actual uh um like floating
  582. 25:12point value that we're trying to
  583. 25:13represent is 3.92. That's pretty far
  584. 25:16away from from three, right? Four would
  585. 25:19probably be a better number to represent
  586. 25:21this. So how can we do that instead?
  587. 25:24Another issue with this is this 5 volts,
  588. 25:26right? The issue that we talked about in
  589. 25:28the last slide. So what can we do
  590. 25:31instead? We can actually shift this. And
  591. 25:33this is what a lot of like ADCs will do
  592. 25:36is they will shift over that function so
  593. 25:39that our um error is not as big. Okay.
  594. 25:43So in this example, they're adding, they
  595. 25:45call it adding half a least significant
  596. 25:47bit, and that will make our ADC
  597. 25:51half a least significant bit more
  598. 25:54accurate.
  599. 25:55Does that make sense? It's kind of maybe
  600. 25:58I'll show you the math here and maybe
  601. 25:59it'll make more sense.
  602. 26:02Um, but anyways, you plug in this, you
  603. 26:05add that half of a least significant bit
  604. 26:08and then when we do a floor for that, we
  605. 26:10get a much more accurate value. we get
  606. 26:12four instead of three. Okay, which is a
  607. 26:14lot closer to 3.92. The actual like if
  608. 26:17we were to do floating point that would
  609. 26:19be the actual value that would be stored
  610. 26:21digitally.
  611. 26:24Does that make sense?
  612. 26:28Okay.
  613. 26:32All right. So, we kind of talked about
  614. 26:34what resolution is. That's kind of just
  615. 26:36like the distance between each step.
  616. 26:38Like what's the voltage range for each
  617. 26:40step? That's our resolution. If we have
  618. 26:43larger steps, that means we have less
  619. 26:45information and a worse resolution. So
  620. 26:48if we need really good resolution, we
  621. 26:50need to decrease that step size or
  622. 26:52increase the number of bits that we're
  623. 26:55using. Quantization error. This is this
  624. 26:59is that error we were talking about. Um
  625. 27:02and we can change it. So if if in this
  626. 27:04example the quantization error is one
  627. 27:08significant bit or least significant bit
  628. 27:10one least significant bit. Okay so we
  629. 27:12could be off by a whole least
  630. 27:14significant bit. But if we shift this
  631. 27:16over the max error that we can have so
  632. 27:19at these corners that's where we're
  633. 27:21going to have the most error. That's
  634. 27:23going to be half the least significant
  635. 27:25bit. And so this this plot here kind of
  636. 27:27shows at these points that's where we're
  637. 27:30seeing the most error. If we get really
  638. 27:32lucky, maybe we'll be right on the dot.
  639. 27:34Uh, but this is what our max error is
  640. 27:36going to be. Does that make sense?
  641. 27:39Because it So, make sure that you
  642. 27:41understand these two terms because
  643. 27:43that's going to be the next question
  644. 27:45here.
  645. 27:48So, look at them just a little bit
  646. 27:50longer.
  647. 27:51All right. So for this question, why
  648. 27:55don't you work for 90 seconds with your
  649. 27:56neighbor and tell me what the
  650. 27:59quantization error is for a 12bit ADC
  651. 28:03with a voltage range of 0 to 3 volts.
  652. 28:06Okay,
  653. 28:08so we gave you that equation a couple
  654. 28:09slides back. Think about it a little bit
  655. 28:11and what would the quantization error
  656. 28:13be? So go ahead and work with your
  657. 28:14partner.
  658. 29:07>> [clears throat]
  659. 29:12>> power.
  660. 29:18You're like angels.
  661. 29:37It's like I
  662. 29:39really like
  663. 30:03All right. Does anyone want more time?
  664. 30:07Does anyone have an answer? Like an
  665. 30:10actual value
  666. 30:12like they plugged into a calculator.
  667. 30:13Does anyone have a number?
  668. 30:17No one has it. Yeah.
  669. 30:2136.
  670. 30:22>> Yeah, you got it right. U so it's really
  671. 30:25small. It's in the millolt range because
  672. 30:27our ADC is so it has so many bits. It
  673. 30:30has 12 bits. The quantization error is
  674. 30:33quite low. Okay. [snorts] And this is
  675. 30:34going to be way below whatever noise
  676. 30:36you'll typically experience. So, um,
  677. 30:39once we get to these these size ADCs,
  678. 30:42unless you have a really, u
  679. 30:45analog circuit on the front end of this,
  680. 30:49um, you're most likely these lower bits
  681. 30:51are just going to be kind of blown away
  682. 30:53by noise.
  683. 30:56Okay, is anyone confused how this
  684. 30:58equation kind of works? And is anyone
  685. 30:59kind of confused
  686. 31:01uh why this equation should be
  687. 31:04intuitive? Is it intuitive to everyone
  688. 31:06now? how how you would kind of take a
  689. 31:09voltage range and then divide it by
  690. 31:13uh the number of steps we have.
  691. 31:19Everyone's good on this.
  692. 31:21Okay.
  693. 31:25All right. So, let's talk about that
  694. 31:26voltage range a little bit more. Okay.
  695. 31:28Let's say we have this signal. If we put
  696. 31:31our our lower range and our higher range
  697. 31:35inside of that, well, we're going to
  698. 31:36have we're going to have clipping. Okay,
  699. 31:39that's what that's called clipping. And
  700. 31:41so, we're not actually getting our whole
  701. 31:42signal there. So, we have to be careful
  702. 31:44with those those reference voltages in
  703. 31:46order to make sure that our signal
  704. 31:48actually fits between them. But we also
  705. 31:51don't want to make them too big. The
  706. 31:54reason why is we're kind of we're kind
  707. 31:55of throwing away a lot of resolution of
  708. 31:57our ADC, for instance. So, let's say I'm
  709. 32:00trying to measure uh brain waves. Brain
  710. 32:03waves are like in the millolt scale. If
  711. 32:06I were to just hook up my ADC on my XMC
  712. 32:084700, which has a reference voltage of
  713. 32:113.3 volts, so 0 to 3.3 volts, and we're
  714. 32:15trying to measure brain waves, which are
  715. 32:16like millolts. We're going to have this
  716. 32:18issue here where the signal is just so
  717. 32:21small that it's only going to be a
  718. 32:23couple values. It's only going to vary
  719. 32:25by a couple digital values. Okay? And so
  720. 32:28what we could do is we could actually
  721. 32:30shrink that range to kind of get our
  722. 32:32signal. What's another another way that
  723. 32:34we could modify the signal to like if we
  724. 32:39had an ADC that was between zero and 3.3
  725. 32:41volts? Uh what could we do to the signal
  726. 32:44in order to actually read it with that
  727. 32:46ADC? Yeah.
  728. 32:49>> Yeah. Amplify it. So that's often what
  729. 32:52you would do if you wanted to read brain
  730. 32:54signals. probably want some analog
  731. 32:56circuit before your ADC, some kind of op
  732. 32:59amp that's going to amplify that signal
  733. 33:01for our ADC.
  734. 33:05And so, ideally, this is what we want to
  735. 33:07see. We want to see that signal just
  736. 33:09barely below the top reference voltage
  737. 33:12and just barely above the bottom
  738. 33:14reference voltage, but not outside of
  739. 33:16it. Does that make sense for everyone?
  740. 33:20Cool.
  741. 33:24All right. So, we talked about going, I
  742. 33:28think, from a voltage to a binary code.
  743. 33:30Oh, wait. No, this is different. All
  744. 33:32right. What are we talking about here?
  745. 33:33This is just talking about um what the
  746. 33:36the different uh digital values could be
  747. 33:39for different reference voltages. So,
  748. 33:41for here, we have a reference a lower
  749. 33:43reference of zero and an upper reference
  750. 33:45of 4 volts. And so, if we have a voltage
  751. 33:48of 3.25, 25 that would result in a code
  752. 33:52of 110.
  753. 33:55And if we change those reference
  754. 33:56voltages to one and 5 volts
  755. 34:01and we have that 3.25, that same thing,
  756. 34:04well, you can see that that's a
  757. 34:05completely different digital value that
  758. 34:07we're going to record because those
  759. 34:08reference voltages are different. Make
  760. 34:11sense?
  761. 34:18Okay. Um
  762. 34:21what is this talking about? Okay, using
  763. 34:23anti-aliasing filters. Okay, so we can
  764. 34:26actually use uh analog filters to make
  765. 34:29sure that those higher frequencies are
  766. 34:31not getting into our our sampled signal.
  767. 34:35Okay, a simple way to do that is with a
  768. 34:38simple RC filter. Um
  769. 34:42and we would call that an anti-alysis
  770. 34:44filter. Do we actually need to do this?
  771. 34:48Yes.
  772. 34:49uh longer answer, yes, but sometimes
  773. 34:52it's already done for you. So, a lot of
  774. 34:54ADCs are already going to have that
  775. 34:56filter built into it, but but you need
  776. 34:58to read the data sheet in order to
  777. 34:59understand if it's actually doing that
  778. 35:01and to understand what that filter is
  779. 35:03actually filtering out. Um, it's going
  780. 35:07to be designed to filter out. It's
  781. 35:09basically be right at that Nyquis limit,
  782. 35:11right? So you need to be uh filtering or
  783. 35:14sorry you need to be sampling at your
  784. 35:16maximum rate in order for that filter to
  785. 35:18actually do its job. If you're sampling
  786. 35:20at a much much uh smaller rate, let's
  787. 35:23say I'm sampling audio, right? My a the
  788. 35:26ADCs on our microcontrollers can go way
  789. 35:29faster, like in mega samples per second.
  790. 35:33But if I'm doing audio, I'm sampling way
  791. 35:35lower. So, I'm going to have to actually
  792. 35:36put an external circuit out there in
  793. 35:38order to filter out all of those
  794. 35:41frequencies outside of my Nyquis rate.
  795. 35:44Okay? Okay. So, if I'm sampling at uh 48
  796. 35:47kHz, then that's that's where my filter
  797. 35:50needs to live more in that range than in
  798. 35:52the like mega megahertz range.
  799. 35:58And this is a little bit more detail on
  800. 36:00how you would actually create an RC
  801. 36:02filter. Where do they teach this in 215,
  802. 36:06right?
  803. 36:07>> 216. Okay. So, if you took 216, this
  804. 36:10should be familiar. If you ever need to
  805. 36:13need to look back at these slides
  806. 36:14because you need to do some filtering,
  807. 36:16you can look back at this. But one
  808. 36:18important thing is this is uh it's it's
  809. 36:20kind of there's a rolloff here, right?
  810. 36:22It's not like these filters are magic in
  811. 36:25that they immediately just uh filter any
  812. 36:29frequency above what it's designed for.
  813. 36:32There's kind of a rolloff there. And
  814. 36:34that kind of goes back to why um they
  815. 36:37sample audio at 44 kHz because they're
  816. 36:40kind of accounting for this that some of
  817. 36:42those higher frequencies are actually
  818. 36:43going to kind of sneak through uh
  819. 36:46because this thing rolls off. All right,
  820. 36:50but yeah, you can take a look at this
  821. 36:51equation if you ever need to build one
  822. 36:53of these circuits.
  823. 36:57Okay, so going from analog to digital.
  824. 37:01So, we have a physical phenomena and we
  825. 37:03put it into a magic black box and then
  826. 37:05we get engineering units. That's what we
  827. 37:07want. How do we get there? We take that
  828. 37:11thing. Maybe it's light. We have a
  829. 37:13sensor. That sensor also is known as a
  830. 37:17transducer
  831. 37:18that converts that light into, let's
  832. 37:20say, a voltage or maybe a current. We
  833. 37:23then plug that into our ADC
  834. 37:26analog to digital converter. that's
  835. 37:29going to make some digital value and
  836. 37:32then we're going to use our software to
  837. 37:33convert that into
  838. 37:36maybe we're measuring light. So we're
  839. 37:38going to convert that into lux which is
  840. 37:40a way to measure light. Okay. So this is
  841. 37:42the way that we would take light and
  842. 37:44convert it all the way to lux.
  843. 37:48So here's an example where
  844. 37:50we have a temperature sensor. Um, and
  845. 37:55this you'll often find this with
  846. 37:56temperature sensors where uh they'll
  847. 37:59take um
  848. 38:02like a temperature for instance and
  849. 38:03they'll output a voltage. Okay, you
  850. 38:05actually need to power this thing. Some
  851. 38:06of these pins are your power and then
  852. 38:09usually the middle pin is a voltage
  853. 38:11that's going to be outputed. Okay, and
  854. 38:13the great thing about this is we can use
  855. 38:15an ADC to measure that voltage and then
  856. 38:18we can figure out what the actual
  857. 38:19temperature is. Okay, but we have to do
  858. 38:22a lot of math in order to get that to
  859. 38:23work. Um, so we call it, so taken from
  860. 38:26Wikipedia, a transducer is a device that
  861. 38:29converts one type of energy to another.
  862. 38:31So here we're converting temperature
  863. 38:33into a voltage. And this is this would
  864. 38:36be something that would be get pulled
  865. 38:38out of a data sheet. So you would buy
  866. 38:40this temperature sensor here and you
  867. 38:42would look at the data sheet and they
  868. 38:43would have this graph here. And then you
  869. 38:46would have to use this graph in order to
  870. 38:48figure out what your code is actually
  871. 38:50going to do with this voltage value
  872. 38:52because we have to convert that voltage
  873. 38:53into a temperature. Temperature is what
  874. 38:55we're trying to get here. So that's
  875. 38:57what's actually useful. But we would
  876. 38:58need to convert it first. Okay? And so
  877. 39:01you would go into the data sheet, you
  878. 39:02would see something like this. Hopefully
  879. 39:05they give you an equation and then you
  880. 39:07can put that into your software for it's
  881. 39:10really important you guys know how to do
  882. 39:12this because it's going to be on the
  883. 39:14midterm. So definitely something like
  884. 39:15Oh, everyone. That was crazy. I said
  885. 39:17midterm and everyone's head just like
  886. 39:19went up. That was crazy.
  887. 39:23Okay. [laughter]
  888. 39:28Um Okay. So, I'm going to have you do a
  889. 39:30worksheet, okay? And I want you to
  890. 39:32answer these four questions
  891. 39:35um using the information that you have
  892. 39:36on this slide.
  893. 39:41Go.
  894. 39:43Go.
  895. 39:45>> [snorts]
  896. 39:45>> Yep.
  897. 40:00>> Thank you.
  898. 40:01>> Yeah.
  899. 40:06>> Here you go.
  900. 40:09>> Here you go.
  901. 40:21I mean this is the first
  902. 40:38you
  903. 40:56Pass those down.
  904. 41:15Thank you.
  905. 41:15>> Yep. No problem.
  906. 41:25>> Yep.
  907. 41:31Here you go. Here you go, guys.
  908. 41:41terrorist.
  909. 41:45>> Mhm.
  910. 42:08I'll pass this down.
  911. 42:21>> Yep.
  912. 42:22Those are good.
  913. 42:26Yep.
  914. 42:36>> [sighs]
  915. 42:46>> Yep.
  916. 42:55>> [clears throat]
  917. 42:59>> Yeah,
  918. 43:05>> there's three. I think
  919. 43:09>> you're not in this class.
  920. 43:13>> I heard you were giving. [laughter]
  921. 43:16>> There you go.
  922. 43:20I think you can just count.
  923. 43:24>> That should be three. If not, let me
  924. 43:26know. There you go.
  925. 43:34>> Yep.
  926. 43:42>> Very good at this.
  927. 43:58I might have given you too many.
  928. 44:02>> Good.
  929. 44:06Right.
  930. 44:12I miss anyone?
  931. 44:31He's
  932. 44:58a one status.
  933. 45:0712 something.
  934. 45:39Yeah.
  935. 45:48[snorts]
  936. 45:56Whatever.
  937. 46:05Good morning.
  938. 46:31>> [clears throat]
  939. 46:44>> I think
  940. 46:46I
  941. 46:58The only thing
  942. 47:12I like.
  943. 47:38Oh yeah.
  944. 47:41>> Yeah.
  945. 47:56Sorry guys.
  946. 48:28>> [clears throat]
  947. 48:33>> Yeah,
  948. 48:35there you go. Yeah.
  949. 48:48I should have
  950. 48:52second
  951. 49:07and Like I was
  952. 49:18thinking,
  953. 49:36you know, I
  954. 49:38teasing me.
  955. 49:59Let's do that.
  956. 50:05[clears throat]
  957. 50:07Does anyone need help and want me to
  958. 50:08come by?
  959. 50:10>> Anyone? [clears throat]
  960. 50:33>> Yes.
  961. 50:36>> [clears throat]
  962. 50:39>> As far as like the step size, that part
  963. 50:41I think made sense. It's just the same
  964. 50:43process of doing like 3.3 over.
  965. 50:49>> Yeah.
  966. 50:50>> And then actually going from like the
  967. 50:51transfer function part are is that
  968. 50:54should we be like then using this
  969. 50:57>> or I'm kind of confused.
  970. 50:59>> But you also have to use this, right?
  971. 51:01>> Is that to get
  972. 51:05So what what your alult your ultimate
  973. 51:07goal is to take think about the software
  974. 51:09that you're going to write, right? So
  975. 51:11the software is going to output an ADC
  976. 51:13value and this is an integer between 0
  977. 51:17and 2 to the n minus one.
  978. 51:19>> Yeah.
  979. 51:20>> Uh so that's what my ADC is going to
  980. 51:21output. I want to take that value and I
  981. 51:25want to convert it into a temperature.
  982. 51:26Let's say this is a lab, right? And we
  983. 51:29want to put temperature out on the
  984. 51:31terminal. Okay. Yeah.
  985. 51:33>> So, we have an So, we have this equation
  986. 51:36is how we take um an ADC value. Well,
  987. 51:41you'd have to flip it. This is how you
  988. 51:42take an ADC value and turn it into a
  989. 51:45voltage or the other way around. You
  990. 51:47take a voltage and turn it into an ADC
  991. 51:49value.
  992. 51:50>> Okay.
  993. 51:50>> Okay. And this is an equation that takes
  994. 51:53a voltage and turns it into a
  995. 51:56temperature. So if you can combine those
  996. 51:58together,
  997. 52:01I can take an ADC value, convert it into
  998. 52:04a voltage, and then convert it into a
  999. 52:06temperature.
  1000. 52:07>> Okay.
  1001. 52:08>> Okay. So I Okay. So I originally I was
  1002. 52:12kind of on that track, but I guess I
  1003. 52:13then I missed this aspect of actually
  1004. 52:15getting the
  1005. 52:24>> Yeah. Keep thinking about it. You're
  1006. 52:25good. All right.
  1007. 52:28Yeah.
  1008. 52:31[clears throat]
  1009. 52:35>> Yeah.
  1010. 52:38>> Almost like reverse engineering it like
  1011. 52:40we're giving we're given an ADC value
  1012. 52:42and we kind of go backwards and see okay
  1013. 52:44what's the temp that gave this
  1014. 52:45>> and then what would the temp be that
  1015. 52:47gave that.
  1016. 52:48>> Yep.
  1017. 52:48>> Okay. And then for four for the same
  1018. 52:50thing frequency like I'm obviously
  1019. 52:51thinking of like Nyquist. Um, but like I
  1020. 52:54guess I don't know how we get a
  1021. 52:55frequency out of just like
  1022. 52:59>> you don't you have to think about the
  1023. 53:00application.
  1024. 53:02Think about why you would want to use
  1025. 53:04this temperature sensor and what
  1026. 53:06sampling frequency you would want to do
  1027. 53:08based on what I'm using it for. And we
  1028. 53:11didn't really give you that much
  1029. 53:12information.
  1030. 53:12>> So is it possible that people get
  1031. 53:14different answers?
  1032. 53:15>> Oh yeah.
  1033. 53:15>> Okay.
  1034. 53:15>> Yeah.
  1035. 53:16>> So it's kind of just like
  1036. 53:17>> Yeah.
  1037. 53:19>> Yeah. Think of a use case where you
  1038. 53:20would use a temperature sensor and then
  1039. 53:22tell me what you think that sampling
  1040. 53:24frequency is.
  1041. 53:31>> Yep.
  1042. 53:40>> How we doing?
  1043. 53:46>> I think we're figuring it out. Okay.
  1044. 53:58>> How do you already get How did you
  1045. 53:59Where's your work?
  1046. 54:01>> You did this all in your head.
  1047. 54:03>> Oh, well, I used a calculator.
  1048. 54:05[laughter]
  1049. 54:07>> Dang. Okay, man. These calculators must
  1050. 54:10be advanced now, huh?
  1051. 54:12>> So, I guess we can use like
  1052. 54:13>> I mean, is this looking correct? Because
  1053. 54:16this is just
  1054. 54:17>> I mean,
  1055. 54:20Oh, no. That's not right.
  1056. 54:22>> Okay. [laughter]
  1057. 54:25>> Well, maybe it is.
  1058. 54:27>> I don't know.
  1059. 54:29>> Um, what are you trying to do here? So,
  1060. 54:31you're trying to get a temperature X.
  1061. 54:33What is X here?
  1062. 54:34>> Oh, that is
  1063. 54:36the ADC value. Sorry.
  1064. 54:45size
  1065. 54:46>> it might be right
  1066. 54:48>> but
  1067. 54:50>> I don't know
  1068. 54:51>> I don't have it memorized so
  1069. 55:28>> Yeah.
  1070. 55:38>> Hey, how you guys doing?
  1071. 55:41>> Little confused.
  1072. 55:42>> Yeah.
  1073. 55:43>> Okay.
  1074. 55:43>> For the first part, is it is the right
  1075. 55:46do like 3.3 / 2 to 10us for the first
  1076. 55:49part. Okay, for the second part we were
  1077. 55:53just talking about would we rearrange
  1078. 55:55this?
  1079. 55:56[sighs]
  1080. 55:59>> Um,
  1081. 56:01yeah, that that could be a Yeah,
  1082. 56:04>> basically what we're trying to do is
  1083. 56:05we're trying to take
  1084. 56:07um
  1085. 56:10>> we're trying to take a a temperature and
  1086. 56:13figure out what the resulting Well,
  1087. 56:15actually the other way around. We're
  1088. 56:16trying to take an ADC value. We're
  1089. 56:18trying to figure out get an equation
  1090. 56:21that would actually tell us the
  1091. 56:22resulting temperature.
  1092. 56:25>> Oh, I see.
  1093. 56:27>> So, if we rearrange this so you can
  1094. 56:42>> Yeah. So if you go uh one slide back,
  1095. 56:47these equations here, that's a way to
  1096. 56:49get an ADC value with a voltage, right?
  1097. 56:52And this equation right here gives us a
  1098. 56:54voltage. So we could plug that into
  1099. 56:57there. But this one is taking it the
  1100. 57:00other way around. It's taking a voltage,
  1101. 57:02converting it to an ADC value. We need
  1102. 57:03to take an ADC value and convert it into
  1103. 57:06a voltage and then convert it into a
  1104. 57:08temperature.
  1105. 57:39The sample your You're asking what the
  1106. 57:41answer would be for four.
  1107. 57:43>> I'm guessing like are we like do we just
  1108. 57:45base it off the output frequency of the
  1109. 57:47temperature sensor?
  1110. 57:48>> We don't know the output frequency of
  1111. 57:50the temperature.
  1112. 57:50>> So I have to figure that out without
  1113. 57:52knowing.
  1114. 57:52>> It could be could be infinite kind of. I
  1115. 57:58guess you have to think about your use
  1116. 57:59case. What would you use a temperature
  1117. 58:01sensor for?
  1118. 58:03>> Maybe like I don't know if you like
  1119. 58:06temperature maybe. How often would you
  1120. 58:08need to sample if you were doing room?
  1121. 58:10>> Barely. Maybe once every like half an
  1122. 58:12hour or something.
  1123. 58:13>> Yeah. Well, probably every minute. I
  1124. 58:16mean, a thermostat will probably do it
  1125. 58:18once a second.
  1126. 58:19>> Oh, really? It's pretty fast.
  1127. 58:21>> Yeah. Yeah.
  1128. 58:22>> Okay. So, like a use case.
  1129. 58:23>> Yeah. Yeah. I think about a use case.
  1130. 58:25Yeah.
  1131. 58:25>> Can I ask you a prelab question?
  1132. 58:26>> Yeah.
  1133. 58:27>> I was working on the prelab
  1134. 58:29>> for seven
  1135. 58:31>> or six.
  1136. 58:32>> For six.
  1137. 58:33>> Okay.
  1138. 58:36I was going to say I just posted seven.
  1139. 58:37Yeah, you you're on it.
  1140. 58:54>> Um, not whether or not you need to pay.
  1141. 58:56Well, I don't I have no idea if ST paid
  1142. 59:00for these addresses,
  1143. 59:01>> but they basically have two addresses.
  1144. 59:03Yeah.
  1145. 59:04>> And they use a pin on the micro or on
  1146. 59:07the accelerometer to choose between
  1147. 59:09those two addresses.
  1148. 59:12>> Okay. So, they decided that because I
  1149. 59:15might want to put two of these on a PCB
  1150. 59:17for some reason, I'm going to give the
  1151. 59:20user the option to have two addresses.
  1152. 59:23And the way that they can choose between
  1153. 59:25those two is they can use this extra pin
  1154. 59:28that we added to the device that you can
  1155. 59:30set either high or low. And that will
  1156. 59:31change the address of the device.
  1157. 59:34>> So we we would write to the like GPIO
  1158. 59:37pin connected to, right? Not to the SA.
  1159. 59:40>> Uh do we
  1160. 59:42>> Well, you you don't even have to connect
  1161. 59:43that to a Are you asking if you connect
  1162. 59:46SA to a GPI open?
  1163. 59:48>> Yeah. Is that how
  1164. 59:49>> you could, but or you could just connect
  1165. 59:51it to ground or VCC? You don't even have
  1166. 59:53to connect it to your microcontroller.
  1167. 59:55>> I you probably are just going to keep it
  1168. 59:57at one value, right? So just connect it
  1169. 59:59to either ground or VCC.
  1170. 1:00:01>> Oh, then wait what would drive the data
  1171. 1:00:03line then?
  1172. 1:00:04>> The data line is your other those are
  1173. 1:00:06different uh wires. Those are your SCCL
  1174. 1:00:09which is your clock and your SDA.
  1175. 1:00:11>> So those two wires are where what the
  1176. 1:00:13data is actually going to be. This is
  1177. 1:00:15just like an input into the chip to to
  1178. 1:00:17tell the chip which address it should
  1179. 1:00:19have.
  1180. 1:00:21Like I could get rid of that completely,
  1181. 1:00:23that pin, and just design the chip to
  1182. 1:00:27not have it, and just have a fixed
  1183. 1:00:28address, one address, and then I
  1184. 1:00:31wouldn't even need a pin like that. But
  1185. 1:00:32they decided they want two addresses.
  1186. 1:00:35>> And so they gave you a pin to select
  1187. 1:00:37which address you actually want.
  1188. 1:00:41>> But
  1189. 1:00:43to actually like address the registry,
  1190. 1:00:45we use the sub address. So why do we
  1191. 1:00:48need this address? No, no. There's the I
  1192. 1:00:51squared C address and then there's the
  1193. 1:00:53sub addresses. The I squared C addresses
  1194. 1:00:55if I have multiple sensors on I squared
  1195. 1:00:57C bus. They all have different
  1196. 1:00:59addresses. Okay, so I need to first send
  1197. 1:01:02that address to let the bus know who am
  1198. 1:01:04I actually talking to. Maybe I have 10
  1199. 1:01:06different sensors on this bus. They all
  1200. 1:01:08have different addresses. I first need
  1201. 1:01:10to send that address to be like, hey, I
  1202. 1:01:11want to talk to the accelerometer. Then
  1203. 1:01:13once I'm actually talking to the
  1204. 1:01:15accelerometer, that's where I start
  1205. 1:01:16sending the sub address, which is the
  1206. 1:01:19address of the registers inside of the
  1207. 1:01:21accelerometer.
  1208. 1:01:23>> Okay.
  1209. 1:01:24>> So it's two separate addresses.
  1210. 1:01:27>> Oh, so I send the
  1211. 1:01:30like S0 connected ground.
  1212. 1:01:37>> Yeah, makes sense.
  1213. 1:01:40>> I might have to
  1214. 1:01:41>> Oh, yeah. We we can talk after lecture
  1215. 1:01:43here. Okay.
  1216. 1:01:56>> All right, let's go through these
  1217. 1:01:59answers.
  1218. 1:02:02Um, I got to find the slide.
  1219. 1:02:13Okay, let's start with the first one.
  1220. 1:02:15What is the minimum step size of this
  1221. 1:02:17ADC? Who's got the answer? Yeah.
  1222. 1:02:29>> Is [clears throat] that what you got?
  1223. 1:02:31>> Okay. So, it should be pretty intuitive.
  1224. 1:02:33I have a voltage range. We told you that
  1225. 1:02:36the voltage range is between 0 and 3.3.
  1226. 1:02:40We need to divi to to divide it by the
  1227. 1:02:42number of like steps we have in our ADC.
  1228. 1:02:45So it would be 3.3 divided by 2 to the
  1229. 1:02:4910. That's how each how big each step
  1230. 1:02:52is.
  1231. 1:02:53Okay, this is one of those things that
  1232. 1:02:56you should just you should just be able
  1233. 1:02:57to intuitively know without knowing the
  1234. 1:03:00equation. Technically, we should have
  1235. 1:03:02put that minus one there, but we didn't.
  1236. 1:03:06All right.
  1237. 1:03:08Oh, before I go through that answer. All
  1238. 1:03:10right. What is the answer to this one?
  1239. 1:03:12Well, I guess was that the answer?
  1240. 1:03:15I think that No, no, that was not the
  1241. 1:03:17answer. What's the answer to this one?
  1242. 1:03:20There should be an equation that's going
  1243. 1:03:21to take basically a ADC value. So, a
  1244. 1:03:25value between 0 and 4,95.
  1245. 1:03:30It's going to take that value and
  1246. 1:03:32convert it into a temperature. Yeah.
  1247. 1:03:43>> USUS 0.96
  1248. 1:03:48>> maybe. [laughter]
  1249. 1:03:51Let's go through it and you can tell me
  1250. 1:03:52after we go through the whole thing if
  1251. 1:03:54this is what you had. All right. So,
  1252. 1:03:56let's kind of do it step by step.
  1253. 1:03:58Um,
  1254. 1:04:00I don't have the answer in front of me.
  1255. 1:04:01That's why I can't tell you whether that
  1256. 1:04:03was I don't even know why I asked you
  1257. 1:04:04because I can't even verify it. But
  1258. 1:04:06we'll find out if that you were right.
  1259. 1:04:08You already told everyone what it is. So
  1260. 1:04:10hopefully you were right. Okay. So first
  1261. 1:04:12we have this equation here. This is what
  1262. 1:04:15we were just given right here. This is
  1263. 1:04:18what that is. So we have a temperature
  1264. 1:04:20and then we plug it into this equation
  1265. 1:04:22and we get a temperature or sorry we
  1266. 1:04:23have a temperature. We plug in this
  1267. 1:04:25equation. We get a voltage. Okay? That's
  1268. 1:04:27what's being outputed by our sensor.
  1269. 1:04:30Okay. And then here is the equation to
  1270. 1:04:33figure out what that what a voltage
  1271. 1:04:36would be converted into as an ADC. So
  1272. 1:04:39these are two separate equations. Okay,
  1273. 1:04:42does this kind of make sense? This is
  1274. 1:04:46the voltage that we're measuring and
  1275. 1:04:48then the range that we're measuring
  1276. 1:04:51over. So we're measuring between 0 and
  1277. 1:04:533.3 volts. If we we're getting basically
  1278. 1:04:57a ratio there, right? If I have a low
  1279. 1:04:59number here, I'm going to get a low ADC
  1280. 1:05:02value. If I have a high voltage, I'm
  1281. 1:05:04going to get a high ADC value. So, we're
  1282. 1:05:06going to take that ratio and then we're
  1283. 1:05:08going to multiply it by 2 to the n.
  1284. 1:05:10That's how many steps we actually have.
  1285. 1:05:11And so, then that will give us that
  1286. 1:05:13integer value that we that our ADC will
  1287. 1:05:17will output.
  1288. 1:05:19Okay. So, we have those two equations.
  1289. 1:05:21We basically just need to combine those
  1290. 1:05:22together. So, we'll take this voltage
  1291. 1:05:25that we're actually getting from the
  1292. 1:05:27temperature sensor and plug it into this
  1293. 1:05:29equation right here. And so, then we got
  1294. 1:05:31this.
  1295. 1:05:33And then because we don't actually want
  1296. 1:05:38um temperature or we actually don't want
  1297. 1:05:40ADC counts. We want the temperature
  1298. 1:05:43based on the number of ADC counts we
  1299. 1:05:45have because that's what our software is
  1300. 1:05:47actually going to have access to. Our
  1301. 1:05:49software is going to see the number of
  1302. 1:05:51ADC counts and it's going to convert
  1303. 1:05:54that into a temperature. That's the goal
  1304. 1:05:56of what we're doing here. And so this is
  1305. 1:05:58the equation that we actually need. And
  1306. 1:06:00if we plug in more numbers into here, so
  1307. 1:06:03VREF, that's going to be 3.3, right?
  1308. 1:06:06That's our range of voltages that our
  1309. 1:06:09ADC is set up to measure. And then 2 to
  1310. 1:06:12the N, that's how many steps we have.
  1311. 1:06:15Okay? And then you do some algebra here
  1312. 1:06:17to figure this all out.
  1313. 1:06:20I'm glad it's already done for me
  1314. 1:06:21because I would struggle. And this is
  1315. 1:06:24the final equation.
  1316. 1:06:26If we do this division stuff here, this
  1317. 1:06:28is what we actually get. So this is the
  1318. 1:06:30actual answer here. We take these ADC
  1319. 1:06:33counts, we multiply it by this number,
  1320. 1:06:35and then subtract this number, and that
  1321. 1:06:36will give us the actual temperature that
  1322. 1:06:38we're trying to measure. Did anyone
  1323. 1:06:40actually get that? Did you get it? No.
  1324. 1:06:42[laughter]
  1325. 1:06:43Okay. Does it make sense how we got
  1326. 1:06:45there though? Do you think you could do
  1327. 1:06:47this on an exam where we could give you
  1328. 1:06:49a temperature sensor? We often do that.
  1329. 1:06:51We always pick temperature sensors for
  1330. 1:06:53some reason. We could give you that
  1331. 1:06:54temperature sensor and then you'd have
  1332. 1:06:56to write CC code that would take that
  1333. 1:06:58ADC value and convert it into a
  1334. 1:07:01temperature
  1335. 1:07:03think so is it do all of these steps
  1336. 1:07:05kind of make intuitive sense why we did
  1337. 1:07:08it? Yeah.
  1338. 1:07:18Yeah, it's like the measured voltage.
  1339. 1:07:20It's the voltage of the sensor. Voltage
  1340. 1:07:23T is for the temperature sensor.
  1341. 1:07:29>> Say again.
  1342. 1:07:34>> Well, no. It's just like we're we're
  1343. 1:07:36going to take a measurement. It's going
  1344. 1:07:38to be one just measurement. It could be
  1345. 1:07:39anything between
  1346. 1:07:41Well, it could be anything between this
  1347. 1:07:44range right here. So, 8 volts to 1.3
  1348. 1:07:48volts.
  1349. 1:07:49Anywhere in between that. If we plug
  1350. 1:07:52that into our equation, the resulting
  1351. 1:07:55uh after plugging in this equation, we
  1352. 1:07:58should get the temperature down here.
  1353. 1:08:00Does that make sense?
  1354. 1:08:03>> Yeah.
  1355. 1:08:08Um
  1356. 1:08:09technically yeah but we are um
  1357. 1:08:16I don't think it really matters in this
  1358. 1:08:17scenario. Do we actually have to do
  1359. 1:08:19that? Do we need to floor it anywhere?
  1360. 1:08:23Because we're dealing with such a high
  1361. 1:08:25resolution. I don't really think it
  1362. 1:08:26matters. Okay. the the error that you're
  1363. 1:08:29going to get between flooring it and not
  1364. 1:08:30flooring it is like point something 01
  1365. 1:08:35temperature or whatever something like
  1366. 1:08:36that. Okay,
  1367. 1:08:39any other questions?
  1368. 1:08:44Okay, let's go on to the third question.
  1369. 1:08:48Okay, so what is the ADC value for
  1370. 1:08:51temperature of 50° Celsius?
  1371. 1:08:55Did anyone get it?
  1372. 1:08:58Yeah,
  1373. 1:08:59>> I got 361.
  1374. 1:09:00>> 361. Let's see if you're right.
  1375. 1:09:04I'm just going to skip ahead. Let's see.
  1376. 1:09:06361. You got it right. All right, cool.
  1377. 1:09:09All right, let's think about how this
  1378. 1:09:11works. And I already kind of forgot, so
  1379. 1:09:13I got to think about it more. All right,
  1380. 1:09:15so here's our equation that gives us the
  1381. 1:09:19uh voltage and temperature, right? Okay,
  1382. 1:09:22that's this equation here. And then we
  1383. 1:09:24divide it by the reference. So for our
  1384. 1:09:26our reference is 0 to 3.3 volts. So we
  1385. 1:09:29would have 3.3 here. That's giving us
  1386. 1:09:31that ratio again. Okay. Then we multiply
  1387. 1:09:34it by the number of steps. And then
  1388. 1:09:37that's our ADC. So we got 3.3. We got
  1389. 1:09:4050. That's our temperature.
  1390. 1:09:43361 is the value that our ADC is going
  1391. 1:09:47to output. Okay. Does that make sense?
  1392. 1:09:50Let's kind of think about it.
  1393. 1:09:52Um, so if we plug
  1394. 1:09:56uh that temperature into here, we're
  1395. 1:09:58going to get a voltage of 16.
  1396. 1:10:02And if we look at the graph, yep, that
  1397. 1:10:05makes sense. Okay, so that's always a
  1398. 1:10:08good way to kind of check things like
  1399. 1:10:10plug in all plug it just pick some
  1400. 1:10:11random numbers, plug them in there, look
  1401. 1:10:13at the graph, does it actually work?
  1402. 1:10:16Okay, yeah, we're probably doing
  1403. 1:10:17something right here. Okay. And then the
  1404. 1:10:19last question, what sampling frequency
  1405. 1:10:22should we use
  1406. 1:10:24for this? Does anyone have an what would
  1407. 1:10:27you use? There's really no correct
  1408. 1:10:29answer.
  1409. 1:10:31>> Does anyone have have a guess? You can't
  1410. 1:10:34be wrong. Well, maybe. I guess you could
  1411. 1:10:36be a little bit wrong.
  1412. 1:10:38>> Yeah.
  1413. 1:10:44>> Yeah.
  1414. 1:10:47>> Yeah. That really depends on your
  1415. 1:10:48application. If I have a thermostat,
  1416. 1:10:51maybe I want to just sample it at one
  1417. 1:10:53hertz, so once a second. Okay, we might
  1418. 1:10:56want to be careful about our filtering,
  1419. 1:10:58right? We're really we're sampling
  1420. 1:11:01really slow. So maybe we want to take
  1421. 1:11:04multiple samples and average them
  1422. 1:11:05together. Maybe we want to put some kind
  1423. 1:11:07of filter in there. Although a filter at
  1424. 1:11:10one hertz is pretty crazy. Um, so yeah,
  1425. 1:11:13it could really be anything. What if I
  1426. 1:11:14had a temperature sensor though inside a
  1427. 1:11:18GPU die? Right? You they actually have
  1428. 1:11:21temperature sensors in there. I don't
  1429. 1:11:22know if you've ever looked at if you've
  1430. 1:11:24ever done some gaming and you're looking
  1431. 1:11:26at your GPU and what temperature it's
  1432. 1:11:28at. It'll tell you what it is, right?
  1433. 1:11:30And it's got a bunch of fans on there.
  1434. 1:11:32Well, that thing has to be sampled
  1435. 1:11:34really quickly because that thing that
  1436. 1:11:36temperature sensor is making sure that
  1437. 1:11:38your GPU isn't going to catch fire and
  1438. 1:11:41um and just melt, right? So it's going
  1439. 1:11:44to actually throttle down the frequency
  1440. 1:11:46of the GPU in order to not go above a
  1441. 1:11:49certain temperature. So that might be an
  1442. 1:11:51example where we need to sample at a
  1443. 1:11:53much higher rate. Okay, with a
  1444. 1:11:55temperature sensor.
  1445. 1:11:58All right, so one last thing I kind of
  1446. 1:12:00added this slide because I think it's
  1447. 1:12:02kind of important and it's about
  1448. 1:12:04measuring resistance and measuring
  1449. 1:12:06current.
  1450. 1:12:08So my question to you is how could So
  1451. 1:12:11we've been talking about ADCs and it
  1452. 1:12:14seems like the only thing that they can
  1453. 1:12:15actually measure is voltage and that's
  1454. 1:12:17true. Just by themselves they can only
  1455. 1:12:20measure voltage the way that they're
  1456. 1:12:21designed.
  1457. 1:12:23What could we do to measure resistance?
  1458. 1:12:25A lot of sensors out there and a lot of
  1459. 1:12:27transducers,
  1460. 1:12:29they actually output a resistance
  1461. 1:12:32instead of a voltage. Okay? Like
  1462. 1:12:34temperature sensors, a lot of them,
  1463. 1:12:35that's how they work. It's basically a
  1464. 1:12:37resistor. As it gets hotter, the
  1465. 1:12:39resistance goes up. Or if it gets
  1466. 1:12:41colder, the resistance goes down. How
  1467. 1:12:44could we measure resistance with an ADC?
  1468. 1:12:47Yeah.
  1469. 1:12:57like that.
  1470. 1:13:00You have the right idea. Yeah.
  1471. 1:13:08>> Yeah. But draw the circuit out for me.
  1472. 1:13:11How do I How does the vol where am I
  1473. 1:13:13actually putting volt? You're not in
  1474. 1:13:14this class, but I'll let you answer.
  1475. 1:13:24>> Yeah. Does everyone know what a voltage
  1476. 1:13:26divider is? Yeah, you're going to
  1477. 1:13:28definitely need it for next lecture.
  1478. 1:13:30Okay, it's really important that you
  1479. 1:13:32understand what a voltage divider is.
  1480. 1:13:34There's a very simple equation for a
  1481. 1:13:36voltage divider. That's what it is. And
  1482. 1:13:38basically what it is, you take two
  1483. 1:13:39resistors and you have a voltage at the
  1484. 1:13:42top, you have a voltage at the bottom.
  1485. 1:13:44Usually, it's ground. And then there's a
  1486. 1:13:46voltage in the middle and you can plug
  1487. 1:13:48in your resistance values. Actually, I
  1488. 1:13:51think it's this one right here. You can
  1489. 1:13:52plug in those resistance values,
  1490. 1:13:55multiply it by the voltage that you're
  1491. 1:13:57supplying to this whole circuit, and it
  1492. 1:14:00will output a voltage here. Okay? And so
  1493. 1:14:02this, if I know the resistance of one of
  1494. 1:14:06these, then I can just use this equation
  1495. 1:14:08to solve the resistance of this if I
  1496. 1:14:12know what this voltage is. Does that
  1497. 1:14:14make sense? You're going to be doing
  1498. 1:14:16this in lab, but it's really important
  1499. 1:14:17that you understand that for ADCs
  1500. 1:14:20because there's a lot of voltage uh
  1501. 1:14:22dividers in ADCs and DAXs.
  1502. 1:14:27All right, one more question. How can we
  1503. 1:14:29measure current? It's kind of a similar
  1504. 1:14:31idea. How do we typically measure
  1505. 1:14:33current in circuits? Does anyone know
  1506. 1:14:35like what the go-to method is? Yeah.
  1507. 1:14:45Yeah. Why do we want it to be really
  1508. 1:14:46small?
  1509. 1:14:51>> Exactly. Yeah. We want it to be really
  1510. 1:14:52small because uh we don't want to
  1511. 1:14:55basically dissipate a bunch of heat out
  1512. 1:14:56of this resistor and we don't want to
  1513. 1:14:58impact whatever else is using that
  1514. 1:15:00current. And so what we could use is
  1515. 1:15:02something called a shunt resistor.
  1516. 1:15:04And um
  1517. 1:15:07how that works is you take a really
  1518. 1:15:09small it's actually physically big
  1519. 1:15:11because it's usually putting a lot of
  1520. 1:15:13current through it but it's a small
  1521. 1:15:15value and if we know that value it's
  1522. 1:15:18usually very precise we can measure the
  1523. 1:15:20voltage drop across it as the current
  1524. 1:15:23flows through it and then we can measure
  1525. 1:15:24that voltage drop plug it into our ADC
  1526. 1:15:27and that's how we measure current.
  1527. 1:15:30Cool.
  1528. 1:15:31All right. One thing, I didn't do this.
  1529. 1:15:33This is all professor sample. I'm going
  1530. 1:15:35to kind of ex try to explain what he was
  1531. 1:15:37doing. It was kind of cool, actually.
  1532. 1:15:39Um, I hadn't watched this lecture
  1533. 1:15:41before, so this is all new to me. But
  1534. 1:15:43what he did is at Disney, he created
  1535. 1:15:46this this watch that could detect what
  1536. 1:15:49you were touching, which was kind of
  1537. 1:15:51crazy. It's kind of magical. Um,
  1538. 1:15:55so how does it work? So, we kind of have
  1539. 1:15:58to understand what EMI is. So every
  1540. 1:16:00electro mechanical device has something
  1541. 1:16:02called EMI. Electroch or electromagnetic
  1542. 1:16:07interference that it outputs. Okay? So
  1543. 1:16:10your phone has some EMI. Um anything
  1544. 1:16:13that's really electronic is going to
  1545. 1:16:15have some kind of EMI that it outputs.
  1546. 1:16:17Okay? And when you're designing a phone
  1547. 1:16:20for instance, you have to make sure that
  1548. 1:16:21the EMI that this thing outputs is not
  1549. 1:16:24out of spec. there's something called
  1550. 1:16:26the FCC and they really don't want
  1551. 1:16:29random uh radio frequencies getting
  1552. 1:16:32outputed out into the air. So, they have
  1553. 1:16:34requirements on what this thing can
  1554. 1:16:36actually output as far as EMI. And so,
  1555. 1:16:39in order to uh make sure that your
  1556. 1:16:41device isn't outputting those
  1557. 1:16:43frequencies, you would take it to one of
  1558. 1:16:44these chambers. It's kind of similar to
  1559. 1:16:46those chambers for audio where you do
  1560. 1:16:48audio recording. This is for radio uh
  1561. 1:16:51frequency stuff. And those walls will
  1562. 1:16:54actually absorb reflections,
  1563. 1:16:56uh, radio frequency reflections, and
  1564. 1:16:58they have this really fancy yaggy
  1565. 1:17:00antenna, and you point it at your
  1566. 1:17:02device, and you get the plot that looks
  1567. 1:17:04like this. And you need to make sure
  1568. 1:17:06that all of those frequencies are below
  1569. 1:17:08the required uh uh requirement from the
  1570. 1:17:11FCC.
  1571. 1:17:14Okay. And so this is what the watch that
  1572. 1:17:16they kind of made, this wristband. And
  1573. 1:17:18so you would wear this thing, and it
  1574. 1:17:20basically has an ADC on there. So, we
  1575. 1:17:22got a Cortex M4 just like what you guys
  1576. 1:17:24are using. Has an ADC on the the thing
  1577. 1:17:28and as I touch something, that EMI is
  1578. 1:17:31going to travel through my body and then
  1579. 1:17:32go to this watch and this watch is going
  1580. 1:17:35to actually measure that EMI. Okay? And
  1581. 1:17:38what they found is that every device has
  1582. 1:17:41its own kind of unique EMI signature.
  1583. 1:17:44Okay? So, if I'm touching my my laptop
  1584. 1:17:47and touching my phone, they have
  1585. 1:17:48different signatures. Okay? Okay. And
  1586. 1:17:51this is what they kind of found. They
  1587. 1:17:52found all of these different devices.
  1588. 1:17:54They actually classified all of these
  1589. 1:17:56and they looked at, okay, well, this is
  1590. 1:17:58like for for that ADC, this is what a
  1591. 1:18:01power drill looks like. This is what a
  1592. 1:18:02motorcycle look looks like. You see the
  1593. 1:18:04motorcycle is really noisy. Probably the
  1594. 1:18:07spark plugs or something.
  1595. 1:18:09Um, and so how it works is a bunch of
  1596. 1:18:14filtering that I don't really
  1597. 1:18:16understand. They take some
  1598. 1:18:18environmental. So they take b like
  1599. 1:18:20basically a base reading and then once
  1600. 1:18:24you start touching something they kind
  1601. 1:18:26of subtract all that environmental EMI
  1602. 1:18:29from the signal just that's kind of like
  1603. 1:18:31the background noise. We need to get rid
  1604. 1:18:33of that first and then they plug it into
  1605. 1:18:36all kinds of crazy stuff and then they
  1606. 1:18:37do some machine learning where they
  1607. 1:18:39actually take that that signature and
  1608. 1:18:42they figure out what it actually is. And
  1609. 1:18:45so here's a video of them demoing this.
  1610. 1:18:48So, he did this with some students
  1611. 1:18:51and you can see it's really it's pretty
  1612. 1:18:53quick. Like the second you touch
  1613. 1:18:55something, it just immediately knows
  1614. 1:18:56what you're touching. And I think the
  1615. 1:18:58use case was I don't know like let's say
  1616. 1:19:01you lost your phone. Maybe it would be
  1617. 1:19:02useful to know when was the last time I
  1618. 1:19:05was touching my phone.
  1619. 1:19:07And so we got a sander, a 3D printer,
  1620. 1:19:13drill,
  1621. 1:19:15and then the the one unique story he
  1622. 1:19:17told is um so at the end of this they
  1623. 1:19:21touched a ladder. Why would a ladder
  1624. 1:19:24have EMI? Does anyone have a guess?
  1625. 1:19:27Yeah,
  1626. 1:19:29>> because it's an antenna. So, it the
  1627. 1:19:31ladder actually had some kind of uh some
  1628. 1:19:34country station radio signals on it, and
  1629. 1:19:37that's what they were actually picking
  1630. 1:19:38up because it's this ginormous piece of
  1631. 1:19:39metal picking up as an antenna.
  1632. 1:19:44All right, I'm going to just skip
  1633. 1:19:46through that, but you can look through
  1634. 1:19:47that if you're curious. Maybe ask him
  1635. 1:19:48some questions. But just to summarize,
  1636. 1:19:51we did some we talked about sampling
  1637. 1:19:53today. We talked about quantization.
  1638. 1:19:55That's where we're converting digital or
  1639. 1:19:58analog into digital.

About this transcript

This page contains the full transcript of EECS 373 - Fall 2026 - Lecture 13: "Overview: Analog Signals" by Interactive Sensing and Computing Lab , generated from the public captions YouTube serves with the video. The transcript has 10,670 words across 1,639 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.