Music is stored as a sequence of digital samples.
Each digital sample is a denary value in the range 0 to 99999999 (8 digits).
The samples are to be stored in a text file. Each sample is converted to a numeric string and 32 samples are concatenated (joined) to form a single line of the text file.
Each numeric string is 8 characters in length; leading ‘0’ characters are added as required.
Example:
Sample | Denary value | String |
|---|
1 | 456
| "00000456"
|
2 | 48
| "00000048"
|
3 | 37652
| "00037652"
|
| | |
32 | 673
| "00000673"
|
The example samples will be stored in the text file as a single line:
"000004560000004800037652...00000673"
(i) Identify one drawback of adding leading ‘0’ characters to each numeric string.
(1)
(ii) Suggest an alternative method of storing the samples which does not involve adding leading ‘0’ characters but which would still allow each individual sample to be extracted.
(1)
(iii) State one drawback of the alternative method given in part (b)(ii).
(1)