midterm 1 - code and data storage Flashcards

lect 5 - 6

1
Q

explain ascii (define + binary storage method + specific bit usages)

A

american standardized code, international exchange

standardized method for converting binary/numbers to characters

1 byte per character
7 bits to identify
8th bit used as redundancy for error detection in the stored data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

explain unicode

A

advanced ascii –> allows for emojis + more characters by combining preexisting unicodes to form new ones

due to expanded character complexity, data is stored as hex instead of binary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

UTF8

A

character encoding, a combination of ascii + unicode

uses variable length encoding –> allows simpler characters to take up less data storage

data storage per character
ascii = 1 byte
non-ascii unicode = 2+ bytes

utf8 uses up to 4 bytes for a single character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

explain RGB

A

red, green blue = primary digital colours

for a given pixel, each colour is value is stored as 1 - 255 –> max 8 bit per colour. combining colour values gives diff mixes

red-blue = purple
blue-green = cyan
red-green = yellow
all3 = white

therefore 1 pixel requires 24 bits of data (8 bits, 3 inputs) –> therefore 1 pixel can be 2^24 diff possible colours

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

storing colour values as hex code

A

RRGGBB

hex colour codes allows more presentable/easily interpretted colour encoding

note how 4 bits are encoded as 1 hex value. therefore if 8 bits per colour value, use 2 hex codes per colour value. a # prefix denotes a hex colour code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

how to interpret/approximate hex colours

A

check the first hex digit per colour
0 = nothing
F = max value

eg
#F2B732 = high red + high green + low blue –> yellow

translate to binary as
1111(F) 0010(2) R
1011(B) 0111(7) G
0011(3) 0010(2) B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

raster image construction

A

raster image encodes resolution + colour depth of image
colour depth = colour bits per pixel
In most cases, 24 bit colour depth –> 3 bytes per pixel

so the first portion of code describes dimensions. everything afterwards is used to encode RGB per pixel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

vector image construction

A

vector file encodes geometric math to determine edges/vertices, then fills in spaces with colours accordingly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

raster vs vector imaging

A

since raster hardcodes pixel colours –> zooming in only scales up each pixel therefore individual pixels become easily identifiable, degrading clarity

since vector images use geometry to draw the image, scaling up the vector image retains image clarity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

video files

A

comprised of series of images/frames
inherently limited by colour depth, resolution, frame rate

therefore inherent loss of details
–> see also: audio digitization
series of slightly changing frames –> move quickly –> illusion of video motion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

audio digitization

A

sampled several times per second –> Hz
higher hz = cleaner audio recording

recording resolution = bit depth –> sample amplitude value
more audio bits = more audio accuracy

less audio bit depth = poor audio quality
less hz = lose the higher audio freqs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

audio file to sound conversion

A

requires digital-audio converter (dac)
poor dac = poor audio regardless of recording quality

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

digitization aliasing –> audio files

A

aliasing = distortion/artifacting due to loss of detail during digitization

eg low audio file hz

audio recordings must be AT LEAST 2x the peak hz of the input audio to prevent aliasing

therefore if a signal peaks at 25 khz –> recording must be at least 50 khz

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

binary to file interpretation

A

initial portion of file binary encodes file format identifier –> denotes file type

programs read file ID –> determine if the code can be interpretted
based on the file type, the binary encoding differs

images –> resolution parameters + indiv pixel RGB values
audio –> sampling hz + audio depth/amplitude values per sample
videos –> resolution + colour depth + audio hz + audio depth

How well did you know this?
1
Not at all
2
3
4
5
Perfectly