Sampling - Unit 1 Lesson 7 refers to sampling. I am very confused about this topic. Does anyone have an easy way to explain it? This must be a new topic for the curriculum this year and I need help.
I can give it a shot. My familiarity with sampling is from sound.
Take a sound, represented as a wave like the image below (upper left corner). Imagine looking at the wavy line from left to right, and at specific times you capture the height of the line at that time - in other words, take a “sample”. When we convert this original smooth wave to a digital form, we can choose to “sample” at different frequencies, capturing the height of the line very frequently or just occasionally.
(Image from https://labtronix.co.uk/drupal/content/about-oscilloscope-sample-rate)
If we sample very often, or at a high frequency (upper right corner), we get a relatively accurate reproduction of the original continuous wave.
If we don’t sample very often or at a low frequency (lower right corner), we get a jagged and inaccurate reproduction of the original wave.
We’d likely want to sample at a higher frequency for the sake of better quality, but you can see that increases the amount of information you would need to store.
Same concept for the code.org lesson, but each “sample” is a pixel. If you “sample” the image very frequently (or break it into many tiny samples), you get a more accurate, higher quality picture. Or sample very infrequently, breaking it into big chunky blocks, giving you a lower quality picture.
When you go to a store and you are offered a sample you get a small bite of some product they want you to buy. They don’t give you the whole thing. They give you a single sample.
In music, sampling is when you take a small section of a much larger song and reuse it.
In statistics, we decide who will win an election by sampling the vote. We ask 100 people how they will vote than assume the thousands of people will vote in the same percentage.
When we experience the world around us everything is sampled. Our eyes have a finite resolution. Our screens have a finite resolution. Our brains have limited storage. When we talk about computers and digitization we always have to take storage size into account.
The question is how many samples do we need? Sound, as Frank explained above, must be sampled to be stored. The more samples you take the greater the fidelity to the original waveform.
A music CD has a standard of sampling 44.1kHz. An MP3 can have a sampling rate from 8kHz to 48kHz. The highest sound a person can hear is 20kHz. Most people though can only hear about 14kHz. The highest note on a piano is 4.1kHz. As you can imagine 44.1kHz is enough samples for music reproduction.
Something I asked my students when we got to sampling in images was Why do I want do I want a phone with a 12MP camera when I get can cheaper one with 2MP?." They all said the picture would be better. Then we got into that the 12MP camera samples 6 times the rate of the 2MP. 12,000,000 pixels vs 2,000,000 for the same image.