Past Exam Questions
Every question from the CBE412 papers: Mid Sem October 2025 and End Sem November 2025 (batch 2022), and Mid Sem September 2026 (batch 2023). Model answers sized to the marks, with full working for the numerical questions.
Each answer links to the lecture page that covers the topic. Open an answer only after you have tried the question.
| Paper | Marks | Time | Topics |
|---|---|---|---|
| Mid Sem, October 2025 (batch 2022) | 50 | 1 h 30 min | Transmission modes, source and tamper forensics, JPEG, audio, Huffman and LZ77 |
| End Sem, November 2025 (batch 2022) | 100 | 3 h | QoS, Nyquist, watermarking, GOP, steganography, forensics, resource management, LZSS, PNG filters |
| Mid Sem, September 2026 (batch 2023) | 50 | 1 h 30 min | Bit depth, shutter, PNG filters, MPEG and GOP, JPEG, Nyquist, LZ77 |
The numerical questions repeat the slide examples with new data: Huffman tree, LZ77 tokens, LZSS tokens with a size count, PNG filter tables, Nyquist rate and aliasing. Practise each one by hand until it takes under 15 minutes.
Mid Sem, October 2025 (batch 2022)Search on YouTube
Part A: 3 x 5 = 15 marks. Part B: 35 marks.
Q1. Transmission mode for live video conferencing (5 marks)Search on YouTube
In live video conferencing, audio and video streams need timely and synchronised transmission. Which mode is most appropriate: asynchronous, synchronous or isochronous? Justify.
Isochronous transmission.
| Mode | Timing guarantee | Fit for live conferencing |
|---|---|---|
| Asynchronous | No time restriction; packets arrive whenever the network delivers them | No. Delay and jitter are unbounded, so speech breaks up and lip sync is lost |
| Synchronous | A maximum end-to-end delay per packet; packets may arrive early | Partial. Early packets must be buffered, and the delay still varies |
| Isochronous | Both a maximum and a minimum end-to-end delay; the jitter is bounded | Yes. Every audio and video unit arrives within a fixed time window |
Justification:
- Audio and video are continuous media. Each unit must be played at a well-determined deadline.
- Conferencing is interactive, so large playout buffers are not acceptable.
- Isochronous delivery bounds both delay and jitter. Audio and video stay in step (lip sync) and play smoothly.
- Missing a deadline is barely visible for one video frame, but audible in audio. Bounded jitter protects the audio stream.
These transmission modes come from the QoS unit textbook, not from this year's slides. See L05 for deadlines, jitter and real-time requirements.
Q2. Verifying a "captured with my DSLR" claim (5 marks)Search on YouTube
A student claims a viral image was captured with their DSLR. Describe how forensic techniques can verify this claim, with their underlying principles.
- Metadata (EXIF) analysis. Read make, model, lens, serial number, date, time and GPS. They must match the student's DSLR and the claimed event. Principle: the camera writes EXIF at capture time. Caution: social media strips metadata, and metadata is easy to edit, so it is supporting evidence only.
- PRNU source identification. Take a set of reference images with the student's DSLR under uniform lighting. Average them to get the camera's noise reference. Extract the noise residual of the viral image and correlate it with the reference. Principle: Photo Response Non-Uniformity is a sensor noise pattern from microscopic pixel sensitivity differences. It is unique to each sensor, like a fingerprint. A strong match shows the image came from that camera.
- Error level analysis. Re-save at a known JPEG quality and subtract. Uniform error levels suggest one camera original. Patches with different error levels suggest editing or recompression.
- Statistical checks. Histograms, JPEG DCT block statistics and colour channel correlation should look like a camera original, not a downloaded or recompressed copy.
- Shadow analysis. Check the sun position for the claimed time and place against the shadows in the image.
Conclusion: the claim holds only if PRNU matches the DSLR and metadata and other checks are consistent. See L04.
Q3. Same content, different JPEG size (5 marks)Search on YouTube
Two JPEG images show identical visual content but differ in file size. Explain how the JPEG process produces different sizes for visually similar images.
JPEG has five stages: colour space conversion, chroma downsampling, DCT, quantisation, RLE plus Huffman coding. Size differences come from:
- Quantisation table (quality factor). This is the main cause. A low quality setting scales the table up, so more DCT coefficients round to zero. More zeros mean longer zero runs and a smaller file. At normal viewing size the difference may not be visible because the eye is less sensitive to high frequencies.
- Chroma downsampling. 4:2:0 (2 by 2 averaging, ) stores half the data of 4:4:4. The eye barely notices colour detail loss.
- Entropy coding. Optimised Huffman tables give a smaller file than the default tables, with identical pixels.
- Image content and noise. Fine texture or sensor noise leaves more non-zero high-frequency coefficients after quantisation, so the RLE and Huffman output is longer.
- Resolution and metadata. A larger pixel count, or embedded EXIF and thumbnails, adds bytes without changing the look.
See L02.
Q4. Sampling rate and bit depth (10 marks)Search on YouTube
In multimedia production, explain how sampling rate and bit depth influence both the quality and the file size of a digital audio recording.
Sampling rate (samples per second, ):
- Nyquist-Shannon: a band-limited signal is reconstructed correctly only if .
- Too low a rate causes aliasing: high frequencies fold back as false lower tones.
- Real low-pass (anti-aliasing) filters roll off gradually, so practical rates leave a guard band. 44.1 kHz gives Nyquist 22.05 kHz (guard band 2.05 kHz above 20 kHz); 48 kHz gives 4 kHz; 96 kHz gives 28 kHz.
- A higher sampling rate does not mean better audio once the audible band (20 Hz to 20 kHz) is covered. It only enlarges the file.
Bit depth (bits per sample, ):
- Gives quantisation levels: 16 bits give 65,536; 24 bits give 16,777,216.
- The quantisation step is and the error is at most . More bits mean less quantisation noise and a larger dynamic range (about 6 dB per bit).
- Sampling is lossless; choosing the resolution is the lossy step.
File size:
| Setting | Bit rate | Size for 1 minute |
|---|---|---|
| 44.1 kHz, 16-bit, stereo (CD) | Mbit/s | 10.58 MB |
| 48 kHz, 24-bit, stereo | Mbit/s | 17.28 MB |
| 96 kHz, 24-bit, stereo | 4.608 Mbit/s | 34.56 MB |
| 8 kHz, 8-bit, mono (telephone) | 64 kbit/s | 0.48 MB |
Both parameters scale the size linearly. Production picks the lowest rate and depth that cover the content: 44.1 or 48 kHz at 16 or 24 bits. Labs Exp 12 and 13 showed aliasing at low rates and audible noise at 4 and 8 bits. See L03.
Q5. Forensic procedure for an altered photograph (10 marks)Search on YouTube
A photograph in a property dispute may have been digitally altered. Describe the step-by-step investigation, the forgery detection techniques, the clues each method reveals, and how you interpret the results.
Step 1. Preserve the evidence. Work on a copy, record a hash of the original, document every tool and setting.
Step 2. Metadata analysis (EXIF, IPTC, XMP). Look for conflicting timestamps or GPS, missing or modified camera fields, and an editing program in the Software tag. Cross-check time and GPS with other sources.
Step 3. Error level analysis. Re-save at a known quality, subtract and normalise. Clue: pasted or cloned regions show a different error level from their surroundings. Caveat: rough surfaces and edges show high error naturally; ELA is weak on faces.
Step 4. Key point matching (SIFT or SURF). Detect key points, build descriptors and match them within the image. Clue: clusters of matches between two separate areas reveal copy-move forgery (for example, a duplicated wall hiding a structure).
Step 5. PRNU analysis. Compare the noise residual with the claimed camera's reference pattern. Clue: a region with no matching PRNU was pasted in (splicing) or synthesised.
Step 6. Statistical analysis. Histograms (gaps or comb patterns), mean and variance, JPEG DCT block inconsistency (double compression), colour channel correlation, Fourier or wavelet features. Clue: local disturbance of natural statistics.
Step 7. Shadow and lighting analysis. Shadow directions must agree with one light source; the sun position (for example from SunEarthTools) must match the claimed time and place.
Interpretation.
- No single test is proof. Look for agreement: an ELA hotspot, a PRNU gap and a shadow mismatch over the same region make a strong case.
- If all tests are consistent, report "no evidence of manipulation found", not "proven genuine".
- Record false-positive sources (texture, recompression, platform stripping) and report findings with confidence levels.
See L04.
Q6. Huffman versus LZ77 on a short sequence (15 marks)Search on YouTube
The sequence (faint in the scan) reads C D A B C A D B B C A D A C: 14 symbols.
(a) Construct the Huffman tree and write the encoded bitstream.
Step 1. Frequencies: A = 4, C = 4, B = 3, D = 3 (total 14).
Step 2. Merge the two smallest: B + D = 6. List: 4 (A), 4 (C), 6.
Step 3. Merge A + C = 8. List: 6, 8.
Step 4. Merge 6 + 8 = 14 (root).
Step 5. Label left 0, right 1: B = 00, D = 01, A = 10, C = 11.
14
0/ \1
6 8
0/ \1 0/ \1
B D A CStep 6. Encode C D A B C A D B B C A D A C:
11 01 10 00 11 10 01 00 00 11 10 01 10 11 = 28 bits.
Average: bits per symbol. The frequencies are almost equal, so Huffman cannot beat a 2-bit fixed code here.
(b) LZ77 with sliding window 5 and look-ahead buffer 4: token sequence.
Course convention: search buffer = window minus look-ahead . Only the previous single symbol is searchable.
| # | Search buffer | Look-ahead | Token |
|---|---|---|---|
| 1 | (empty) | C D A B | (0, 0, C) |
| 2 | C | D A B C | (0, 0, D) |
| 3 | D | A B C A | (0, 0, A) |
| 4 | A | B C A D | (0, 0, B) |
| 5 | B | C A D B | (0, 0, C) |
| 6 | C | A D B B | (0, 0, A) |
| 7 | A | D B B C | (0, 0, D) |
| 8 | D | B B C A | (0, 0, B) |
| 9 | B | B C A D | (1, 1, C) |
| 10 | C | A D A C | (0, 0, A) |
| 11 | A | D A C | (0, 0, D) |
| 12 | D | A C | (0, 0, A) |
| 13 | A | C | (0, 0, C) |
13 tokens for 14 symbols. The only match is the repeated B at step 9.
If the paper meant a search buffer of 5 (window 9): (0,0,C) (0,0,D) (0,0,A) (0,0,B) (4,1,A) (5,1,B) (5,3,D) (2,1,C), that is 8 tokens. Step 7 finds "BCA" 5 back. State your reading in the exam.
(c) Compare the efficiency of Huffman coding and LZ77 by compression ratio.
Original: bits (ASCII).
| Method | Encoded size | Compression ratio (original / encoded) |
|---|---|---|
| Huffman | 28 bits (+ code table) | |
| LZ77, search 1, 3 bytes per token | bits | (expansion) |
| LZ77, search 5, 3 bytes per token | bits | (expansion) |
- Huffman wins. Four symbols need only 2 bits each, against 8 for ASCII.
- LZ77 fails here: the sequence is short, has few long repeats and the search buffer is tiny. Every unmatched symbol costs a whole triplet.
- Against a 2-bit fixed-length code, Huffman's ratio is only 1 : 1, because the frequencies are nearly uniform.
- LZ77 pays off on long, repetitive data; Huffman pays off on skewed frequencies. PNG and DEFLATE use both.
See L01.
End Sem, November 2025 (batch 2022)Search on YouTube
Part A: 4 x 5 = 20. Part B: 5 x 10 = 50. Part C: 2 x 15 = 30. Total 100, 3 hours.
Q1. QoS specification for a mobile video-learning app (5 marks)Search on YouTube
Using the application-level QoS specification methods, analyse which QoS parameters a mobile video-learning app should specify and how they keep performance acceptable under varying network conditions.
Application QoS requirements:
| Group | Parameters for video learning | Why it helps |
|---|---|---|
| Media quality | Frame rate (for example 15 to 30 fps), resolution (for example 360p to 1080p), latency, jitter | Readable slides and smooth motion |
| Media relations | Audio-video (lip) synchronisation, slide and subtitle sync | The lecturer's voice matches the video |
| Adaptation rules | Actions when bandwidth is scarce: lower resolution or frame rate first, keep audio | Playback continues instead of stalling |
Range specification: a pair of values , for example 15 to 30 fps. Below is the unacceptable region.
Specification approaches (from the slides), and the fit here:
- Parameter-based: QoS values (max latency, min bandwidth) stored in data structures. The app sets its limits.
- Script-based: a script lowers the bit rate when bandwidth drops. This is adaptive bit rate streaming.
- Control-based logic: adaptive policies for jitter and loss, such as a bigger buffer or retransmission.
- Object-oriented: each stream object carries bit rate, resolution and buffering time.
- Process-oriented and aspect-based approaches are less natural for a single mobile client.
The app uses scaling and adaptation rather than reservation. It cannot reserve resources on a mobile network, so it adapts quality in real time, as Netflix and YouTube do. See L05.
Q2. Nyquist rate for 500 Hz and 750 Hz (5 marks)Search on YouTube
A signal contains 500 Hz and 750 Hz. Find the minimum sampling rate and analyse what happens below the Nyquist limit.
Step 1. Highest component: Hz.
Step 2. Nyquist rate: Hz. In practice choose a little more, for example 1600 Hz or more, so the filter has a guard band.
Step 3. Example below the limit, Hz: the Nyquist frequency is 500 Hz.
Step 4. 750 Hz aliases to Hz, a false tone that was not in the original.
Step 5. 500 Hz sits exactly at . It may be sampled at its zero crossings and vanish, or its amplitude may be wrong.
Effect: the reconstructed audio contains wrong frequencies and distortion. The error cannot be removed after sampling because the alias is indistinguishable from a real tone. Prevention: an anti-aliasing low-pass filter before the ADC and . See L03.
Q3. Communication-based models of watermarking (5 marks)Search on YouTube
Describe the different communication-based models of digital watermarking and how their differences influence practical use, with block diagrams.
Watermarking is viewed as communication: message, channel encoder, channel (the content), noise (editing, compression), channel decoder.
1. Basic model: cover work as noise.
m --> [Watermark encoder] --w--> (+) --> [Noise / attacks] --> [Detector] --> m'
^
cover work c0 (treated as noise)The encoder ignores the cover content. It supports blind detection and robust extraction. Use: copyright and transaction tracking.
2. Watermarking with side information.
c0 ----------------+
| v
m --> [Encoder that knows c0] --> (+) --> [Noise] --> [Detector] --> m'The encoder uses the original content. It embeds more strongly in dark or textured areas, where changes are hard to see, and more weakly in bright, flat areas. Better fidelity and robustness for the same strength.
3. Watermarking as multiplexed communication.
c0 (message for humans) --+
+--> [Embed] --> cw --> human sees c0, machine decodes m
m (message for machines) +The cover is a second message that must be preserved. This balances fidelity and robustness and may need informed detection. Use: authentication and quality-sensitive applications.
| Aspect | Cover as noise | Cover as message (multiplexed) |
|---|---|---|
| Focus | Robust extraction | Fidelity and robustness balanced |
| Detection | Blind | Informed detection may be needed |
| Use case | Copyright, transaction tracking | Authentication, quality-sensitive use |
See L06.
Q4. GOP design for a lecture video platform (5 marks)Search on YouTube
Design a GOP pattern for smooth playback and easy seeking in long recorded lectures. Justify how GOP length and the I, P, B arrangement affect compression and navigation.
Proposal: a medium GOP of about 1 second. For 30 fps: GOP 30 with pattern IBBPBBPBBP... (an I-frame every 30 frames, P every third frame, 2 B-frames between anchors). A shorter GOP of 12 to 15 (IBBPBBPBBPBBPBB) suits editing-style frequent seeking.
Justification:
- Compression: lecture video is mostly static (slides, a talking head). P- and B-frames code only small changes, so long runs of them save a lot of space. B-frames compress best.
- Seeking: decoding must start at an I-frame. With one every second, any seek lands within 1 s and needs at most 29 extra frames decoded. GOP 120 would mean up to 4 s of extra decoding per seek.
- Error resilience: a lost frame affects at most one GOP, so the picture recovers within a second.
- Smooth playback: B-frames need the next anchor, so a small decoder buffer of a few frames is enough at this GOP size.
- An extra I-frame at each slide change makes chapter jumps exact.
The slides list streaming (H.264) at 30 to 60 and editing at 12 to 15. A lecture platform needs both, so 15 to 30 is the balanced choice. See L03.
Q5. Steganography for journalists under surveillance (10 marks)Search on YouTube
Recommend a cover work, embedding method and selection rule for hiding text in phone photos so the data is visually and statistically hard to detect. Justify with invisibility, noise tolerance and detectability.
Cover work. Large, high-resolution, highly textured or noisy natural photos (landscapes, crowds, foliage) taken by the phone itself. Avoid flat or synthetic images (sky, screenshots), where any change shows. Use fresh photos never posted before, so no clean original exists for comparison. A complex image hides data better than a plain one.
Embedding method. Phone photos are JPEG, so embed in the DCT domain with a statistics-preserving method such as OutGuess:
- Phase 1: embed message bits in the LSBs of selected, less significant DCT coefficients. Leave some coefficients untouched.
- Phase 2: adjust the untouched coefficients so the DCT histogram matches the original.
- Alternatively, use model-based steganography: keep the probabilistic model of the cover unchanged.
- Encrypt and compress the text first, so the embedded bits look random.
Selection rule. Adaptive selection driven by a pseudo-random order from a shared stego key. Embed only in noisy, textured blocks. Never use sequential LSB from the top-left corner.
| Criterion | How the choice meets it |
|---|---|
| Invisibility | Changes of plus or minus 1 in mid-frequency coefficients of textured blocks are below perception |
| Noise tolerance | Embedding changes hide inside the natural sensor and texture noise |
| Detectability | Histogram restored; adaptive, keyed locations defeat sum-of-absolute-difference LSB tests; small payload keeps the stego distribution close to the cover, which is Cachin's security goal |
Limits: keep the payload small (OutGuess fails to preserve statistics when over-embedded), and send images in a way that does not recompress them, since platform recompression may destroy the data. See L06.
Q6. Detecting copy-move, splicing and inpainting (10 marks)Search on YouTube
For copy-move forgery, image splicing and inpainting-based object removal, identify the most appropriate detection technique and justify it.
| Forgery | What happens | Best technique | Why it works |
|---|---|---|---|
| Copy-move | A region is copied and pasted elsewhere in the same image | Key point matching with SIFT or SURF | Source and copy share the same features. Descriptors match each other even after scaling, rotation or lighting change. Clusters of matches between two areas reveal the clone. |
| Splicing | Regions from different images are combined | PRNU analysis, supported by ELA and shadow analysis | The pasted region carries another camera's sensor noise, so local PRNU correlation drops. It often has a different compression level (ELA) and inconsistent lighting (shadows). |
| Inpainting (object removal) | An area is filled with synthesised texture | ELA plus statistical and noise analysis | The filled area has smooth, artificial texture with no real sensor noise and different compression and DCT statistics from the rest. |
Practical notes:
- SIFT is more accurate; SURF is faster.
- PRNU needs reference images from the source camera.
- ELA gives false positives on rough surfaces and faces, so confirm with a second method.
- Inpainting from the same image's patches can also produce key point matches, so run SIFT on suspected object-removal areas too.
See L04.
Q7. Resource management on a campus media server (10 marks)Search on YouTube
The server must carry many simultaneous class video streams plus file uploads and maintenance. Using resource management concepts, analyse how it should allocate CPU, memory and network bandwidth to keep QoS guarantees.
Resource types.
| Resource | Class | Management |
|---|---|---|
| CPU (and GPU) | Active, shared, multiple cores | Real-time scheduling for stream tasks with deadlines; background tasks at low priority |
| Memory (RAM) | Passive, shared | Reserved buffer per stream to absorb jitter; caching of popular lectures |
| Network bandwidth | Active (adapter), shared | Reserved share per admitted stream; uploads use what is left |
| Disk | Passive, shared | Sequential reads for streams; uploads and maintenance scheduled around them |
Two phases.
- Establishment (admission control): before a new stream starts, check that enough CPU, bandwidth and buffer remain without degrading streams already running. Reject or downgrade the request if not.
- Runtime: monitor and reallocate. If an upload burst competes, throttle the upload, not the live class.
Service classes.
- Live class streams: guaranteed service with resource reservation. Use a deterministic pair of values such as 25 to 30 fps and a minimum bit rate.
- Recorded lectures: predictable service based on measured history (for example the average of the last L bandwidth samples).
- File uploads and maintenance: best effort. Run maintenance in off-peak hours.
Requirements to protect: throughput (bit rate per stream), delay (local and end-to-end), jitter (buffering, periodic scheduling) and reliability (error correction).
Delivery model: live classes use the push model (server sends to all clients). Recorded lectures use the pull model (client requests). Media servers rely on sequential access, large buffers and real-time scheduling, unlike a normal file server.
See L05.
Q8. Five forensic indicators in an image's metadata (10 marks)Search on YouTube
The metadata: IMG_20230722_092145.jpg, 1.8 MB, 4032 x 3024, colour profile DCI-P3. Date created 2023:07:22 09:21:45, modified 09:24:10. Samsung Galaxy S21. Software: Lightroom Mobile 8.1 (Android). Exposure 1/1200 s, f/1.8, ISO 40, focal length 26 mm, flash off, white balance auto. GPS 34.052235 N, 118.243683 W, altitude 98 m, GPS timestamp 2023:07:22 16:21:40Z, speed 0.0 m/s. Orientation normal, HDR enabled, scene type standard, lens info 1.8-2.4 mm. Claim: taken on a weekend trip to San Francisco with the user's phone.
Identify five forensic indicators to verify the time, place and device, and explain what to look for and how to detect inconsistencies.
1. GPS location (the strongest red flag). 34.0522 N, 118.2437 W is downtown Los Angeles, not San Francisco (about 37.77 N, 122.42 W, roughly 560 km away). Check: plot the coordinates on a map. Either the claim is false, the GPS was spoofed, or the metadata came from another photo.
2. Date and time consistency.
- 2023-07-22 was a Saturday, consistent with "weekend".
- Created 09:21:45 local; GPS 16:21:40 UTC. California in July is UTC-7 (PDT), so 16:21 UTC is 09:21 local. The clocks agree within 5 s. The file name
IMG_20230722_092145matches the creation time. - Check: compare all time fields, time zone and file system times. Watch for time zone settings on the camera.
3. Editing software and modification time. Software: Lightroom Mobile 8.1 and a modification 2.5 minutes after capture show the file was edited, not straight from the camera. The DCI-P3 profile and the 1.8 MB size (small for a 12 MP phone JPEG) are consistent with re-export. Check: ELA and JPEG double-compression statistics; ask for the original from the phone's DCIM folder.
4. Device and camera parameters. 4032 x 3024 (12 MP), f/1.8 and 26 mm (35 mm equivalent) fit the S21 main camera. But "lens info 1.8-2.4 mm" looks like an aperture range written as a focal length, which is suspicious. Check: compare all EXIF fields with genuine S21 images, and run PRNU matching against reference shots from the user's own phone. That is the decisive device test.
5. Scene and environment (shadow analysis). 1/1200 s, ISO 40, flash off and HDR on mean bright sunlight around 09:21. Check: use SunEarthTools to compute the sun's azimuth and elevation for that time at both LA and SF, then compare with the shadow directions in the image. Also check landmarks and weather records for 22 July 2023.
Verdict: time fields are consistent. Location contradicts the claim and the file was edited, so the claim is not supported. Confirm with PRNU and shadow analysis before concluding. Metadata alone can be forged, so report it with the other evidence. See L04.
Q9. Wardens and steganalysis strategy (10 marks)Search on YouTube
(a) Explain how you would apply passive, active and malicious warden strategies to detect or disrupt hidden messages in social-media images.
| Warden | Powers | Actions in this investigation | Effect on hidden data |
|---|---|---|---|
| Passive | Intercepts and inspects only; passes clean messages, drops suspected ones | Run steganalysis classifiers on every image; flag or block suspected stego images; log senders | Detects the presence; the content stays unknown |
| Active | Can modify the message before passing it on | Recompress, resize, slightly blur, or re-randomise LSBs of all images | Destroys fragile hidden data even when detection fails |
| Malicious | Knows the stego algorithm; can impersonate Alice or Bob | Identify the tool, extract messages, inject false messages, pose as a member of the group | Reads and manipulates the channel; needs knowledge of the algorithm |
Start passive (no alert to the group), add active sanitisation for high-risk accounts, and move to malicious once the algorithm is identified.
(b) Blind or targeted steganalysis: which suits this scenario?
Blind steganalysis, because the algorithm is unknown.
- Targeted steganalysis needs the embedding algorithm. For LSB embedding, for example, it uses the sum of absolute differences between neighbours as a feature. The agency does not know the algorithm, so it cannot pick such features.
- Blind steganalysis detects hidden data without knowing the algorithm. Two ways to train the classifier:
- on stego images from many known algorithms (risk: misses a new algorithm);
- on cover images only (one-class learning); anything far from the normal distribution is flagged.
- A universal blind classifier works across spatial and JPEG domains. That fits social-media images, which are recompressed JPEGs.
- Features: noise patterns, pixel correlation, transform-domain (DCT, Fourier) features.
Plan: blind steganalysis to screen, then targeted steganalysis on flagged images once the tool is suspected (for example a Steghide or OutGuess signature). See L06.
Q10. LZSS on MISSISSIPPIMISSISSI (15 marks)Search on YouTube
String (19 characters, positions 0 to 18): M I S S I S S I P P I M I S S I S S I. Window 18, search buffer 12, so look-ahead .
(a) Perform the complete LZSS encoding step by step.
Rules: find the longest match of the look-ahead in the search buffer (it may overlap into the look-ahead). On a tie take the smallest offset. Output a pointer (offset, length) for a match, otherwise a literal. A pointer has no next-symbol field. The deck uses a pointer even for a one-character match; that rule is followed here.
| Step | Position | Encoded so far (search side) | Look-ahead | Longest match | Output |
|---|---|---|---|---|---|
| 1 | 0 | (empty) | MISSIS | none | literal M |
| 2 | 1 | M | ISSISS | none | literal I |
| 3 | 2 | MI | SSISSI | none | literal S |
| 4 | 3 | MIS | SISSIP | "S" 1 back | (1, 1) |
| 5 | 4 | MISS | ISSIPP | "ISSI" 3 back (overlaps) | (3, 4) |
| 6 | 8 | MISSISSI | PPIMIS | none | literal P |
| 7 | 9 | MISSISSIP | PIMISS | "P" 1 back | (1, 1) |
| 8 | 10 | MISSISSIPP | IMISSI | "I" 3 back (also 6, 9 back) | (3, 1) |
| 9 | 11 | MISSISSIPPI | MISSIS | "MISSIS" 11 back | (11, 6) |
| 10 | 17 | SSIPPIMISSIS (last 12) | SI | "SI" 3 back | (3, 2) |
Encoded output:
M I S (1,1) (3,4) P (1,1) (3,1) (11,6) (3,2)
Notes: at step 5, "ISS" starts 3 back and the copy continues with the newly copied I, giving "ISSI". At step 9 the match fills the whole look-ahead (6). At step 10 "SI" also occurs 11 back, but 3 is nearer.
(b) Decode your output step by step.
| Token | Action | Output so far |
|---|---|---|
| M | write M | M |
| I | write I | MI |
| S | write S | MIS |
| (1,1) | go back 1, copy 1: S | MISS |
| (3,4) | go back 3 (I), copy I, S, S, then the new I | MISSISSI |
| P | write P | MISSISSIP |
| (1,1) | copy P | MISSISSIPP |
| (3,1) | go back 3: I | MISSISSIPPI |
| (11,6) | go back 11 (start, M): copy M, I, S, S, I, S | MISSISSIPPIMISSIS |
| (3,2) | go back 3 (S): copy S, I | MISSISSIPPIMISSISSI |
19 characters rebuilt exactly, so the method is lossless. A flag bit (0 = literal, 1 = pointer) tells the decoder which kind each token is.
(c) Count literal and pointer tokens, the compressed size (literal 1 byte, pointer 2 bytes) and the compression ratio.
Step 1. Literals: M, I, S, P = 4. Pointers: (1,1), (3,4), (1,1), (3,1), (11,6), (3,2) = 6.
Step 2. Compressed size: bytes.
Step 3. Original: 19 bytes. Ratio: . Saving: .
Step 4. Improvement: a 2-byte pointer for a 1-character match wastes a byte. With a minimum match length of 2, steps 4, 7 and 8 become literals: M I S S (3,4) P P I (11,6) (3,2). That is 7 literals and 3 pointers: bytes, ratio , saving 31.6%.
Comment: the string is short, so the gain is modest. The long repeat "MISSIS" (6 bytes into 2) does most of the work. Offsets up to 12 fit in 4 bits and lengths up to 6 in 3 bits, so a pointer fits in 2 bytes with room for the flag. See L01.
Q11. Five PNG filters on an 8 x 4 image (15 marks)Search on YouTube
Input (4 rows, 8 columns):
| c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8 | |
|---|---|---|---|---|---|---|---|---|
| r1 | 12 | 19 | 27 | 33 | 41 | 48 | 56 | 62 |
| r2 | 18 | 24 | 31 | 39 | 46 | 52 | 59 | 66 |
| r3 | 22 | 29 | 36 | 44 | 51 | 58 | 65 | 72 |
| r4 | 20 | 26 | 34 | 40 | 49 | 55 | 63 | 70 |
Apply None, Sub, Up, Average and Paeth independently and give the five filtered tables.
Convention: a missing neighbour (left of column 1, above row 1) is 0. All results are mod 256. Average uses .
None (unchanged): same as the input.
Sub ():
| r1 | 12 | 7 | 8 | 6 | 8 | 7 | 8 | 6 |
|---|---|---|---|---|---|---|---|---|
| r2 | 18 | 6 | 7 | 8 | 7 | 6 | 7 | 7 |
| r3 | 22 | 7 | 7 | 8 | 7 | 7 | 7 | 7 |
| r4 | 20 | 6 | 8 | 6 | 9 | 6 | 8 | 7 |
Up ():
| r1 | 12 | 19 | 27 | 33 | 41 | 48 | 56 | 62 |
|---|---|---|---|---|---|---|---|---|
| r2 | 6 | 5 | 4 | 6 | 5 | 4 | 3 | 4 |
| r3 | 4 | 5 | 5 | 5 | 5 | 6 | 6 | 6 |
| r4 | 254 | 253 | 254 | 252 | 254 | 253 | 254 | 254 |
Row 4 is below row 3, so the differences are negative: .
Average ():
| r1 | 12 | 13 | 18 | 20 | 25 | 28 | 32 | 34 |
|---|---|---|---|---|---|---|---|---|
| r2 | 12 | 6 | 6 | 7 | 6 | 5 | 5 | 6 |
| r3 | 13 | 6 | 6 | 7 | 6 | 7 | 7 | 7 |
| r4 | 9 | 2 | 3 | 1 | 4 | 2 | 3 | 3 |
Example: r2 c2: , , , .
Paeth (, predict with the nearest of L, U, UL):
| r1 | 12 | 7 | 8 | 6 | 8 | 7 | 8 | 6 |
|---|---|---|---|---|---|---|---|---|
| r2 | 6 | 5 | 4 | 6 | 5 | 4 | 3 | 4 |
| r3 | 4 | 5 | 5 | 5 | 5 | 6 | 6 | 6 |
| r4 | 254 | 253 | 254 | 252 | 5 | 253 | 254 | 254 |
Worked Paeth cells:
Step 1. r2 c2: L = 18, U = 19, UL = 12. . Distances: 7, 6, 13. Predict U = 19: .
Step 2. r4 c5: L = 40, U = 51, UL = 44. . Distances: 7, 4, 3. Predict UL = 44: .
Step 3. r4 c4: L = 34, U = 44, UL = 36. . Distances: 8, 2, 6. Predict U = 44: .
Step 4. Row 1 has U = UL = 0, so Paeth picks L (same as Sub). Column 1 has L = UL = 0, so it picks U (same as Up).
Comparison: None keeps large, all-different values. Sub and Average give small residuals (1 to 9) in every row, with Average the smallest in row 4. Up and Paeth give small values in rows 2 and 3 but wrap to about 253 in row 4. The 254s still repeat, which DEFLATE can use. The gradient runs mostly horizontally (+6 to +8 per column), so Sub and Average suit this image best for the next stages (LZSS and Huffman). See L02.
Mid Sem, September 2026 (batch 2023)Search on YouTube
Part A: 10 marks. Part B: 4 x 10 = 40 marks. The model answers in the student's solutions file were checked against the slides; the token and filter results below agree with it.
Q1. 8-bit to 12-bit quantisation (3 marks)Search on YouTube
An 8-bit system has audible distortion in quiet passages. Will 12-bit quantisation help? Justify with levels and quantisation error.
Yes.
| 8-bit | 12-bit | |
|---|---|---|
| Levels | 256 | 4096 (16 times more) |
| Step for range | ||
| Max error | ||
| SQNR | 49.9 dB | 74 dB |
The step size is fixed, so a quiet passage spans only a few of the 256 levels. The error is then large relative to the signal and sounds like distortion. 12 bits gives 16 times finer steps and about 24 dB less noise. Cost: 50% more bits per sample. See L03.
Q2. Motion blur of a fast athlete (3 marks)Search on YouTube
Which camera setting reduces motion blur, and how does it affect exposure time?
Shutter speed. It sets how long the sensor is exposed to light. A faster shutter (for example 1/1000 s instead of 1/60 s) gives a shorter exposure time. The athlete moves less while the shutter is open and appears frozen. The slide: higher shutter speeds suit fast-moving objects and prevent motion blur.
Side effect: less light reaches the sensor, so the image is darker. Compensate with a wider aperture or a higher ISO. See L02.
Q3. Sub and Up filters on a 2 x 6 block (4 marks)Search on YouTube
Apply Sub and Up (mod 256) to rows 240 244 248 252 0 4 and 100 106 112 118 124 130. Which suits compression better?
Missing neighbours count as 0.
| Filter | Row 1 | Row 2 |
|---|---|---|
| Original | 240 244 248 252 0 4 | 100 106 112 118 124 130 |
| Sub | 240 4 4 4 4 4 | 100 6 6 6 6 6 |
| Up | 240 244 248 252 0 4 | 116 118 120 122 124 126 |
Working:
Step 1. Sub, row 1, fifth value: .
Step 2. Up, row 2: ; ; ...; ; .
Sub is better. Values rise steadily along each row (+4 and +6), so Sub leaves runs of identical small residuals. Even the wrap 252 to 0 becomes 4. Up leaves row 1 unchanged and gives all-different values in row 2, because the rows are not similar vertically. See L02.
Q4. Surveillance video of a fixed corridor (10 marks)Search on YouTube
(a) How can the video be compressed efficiently? Why is encoding every frame independently less efficient? (2 marks)
Use MPEG-style coding, which removes spatial and temporal redundancy. Store a full reference frame, then code later frames as motion vectors plus small residuals per 16 x 16 macroblock (best match by SAD). The static background costs almost nothing; only blocks with the moving person need data.
Coding every frame independently (like JPEG on each frame) removes only spatial redundancy. The unchanged background would be re-encoded in every frame.
(b) Which frame type represents the complete image independently, and which represents information relative to other frames? (5 marks)
| Frame | How it is coded | Role in the corridor video |
|---|---|---|
| I (intra-coded) | Complete image, compressed alone with DCT, quantisation and entropy coding; largest | Anchor; holds the full corridor; decoding and seeking start here; stops error spread |
| P (predicted) | From the previous I- or P-frame using motion vectors and residuals | Background blocks cost almost nothing; only the person is coded |
| B (bi-directional) | From both previous and future I- or P-frames; most compressed | Smallest; background revealed after the person passes is predicted from the future frame |
So the I-frame stands alone; P- and B-frames are relative (inter-frame). They are arranged in a GOP such as IBBPBBPBBPBB (12 frames).
(c) System A (GOP 12) versus System B (GOP 48): compression and random access. Which suits surveillance? (3 marks)
| System A, GOP 12 | System B, GOP 48 | |
|---|---|---|
| I-frames per 48 frames | 4 | 1 |
| Compression | Lower | Higher (frames are very similar) |
| Worst-case seek at 25 fps | 11 frames, 0.44 s | 47 frames, 1.88 s |
| Error spread | At most 12 frames | Up to 48 frames |
Prefer System A. The system must support playback and access to recordings. Investigators need fast, exact jumps to the moment a person appears, and evidence should not lose long stretches to one damaged frame. P- and B-frames still remove most of the static background. Choose B only if storage is the single overriding limit. See L03.
Q5. 40 MB photo to a 4 MB upload limit (10 marks)Search on YouTube
(a) Explain the main stages of JPEG and how each reduces data. (7 marks)
- Colour space conversion (RGB to YCbCr). Separates luminance Y from chrominance Cb, Cr. The eye is more sensitive to brightness, so colour can be treated more aggressively. Reversible; no data removed yet.
- Chroma downsampling. Y stays at full resolution; Cb and Cr are averaged per 2 by 2 block, ratio . Data falls from 3 to 1.5 values per pixel, a 50% cut with little visible change.
- Block splitting, level shift, DCT. 8 by 8 blocks, subtract 128 (range -128 to 127), 2-D DCT to the frequency domain. Energy gathers in a few low-frequency coefficients (DC at top left). The DCT itself discards nothing.
- Quantisation (the lossy step). Divide each coefficient by the quantisation table and round. Small table values at low frequencies, large at high frequencies, because the eye is less sensitive to fine detail. Most high-frequency coefficients become 0.
- Entropy coding. Zigzag scan (low to high frequency) puts the zeros together; RLE codes the runs; Huffman gives short codes to frequent symbols. Lossless.
Together these routinely give 10 : 1 or more with good quality, so 40 MB to 4 MB is achievable. The slide shows exactly this example.
(b) Which stage gives JPEG its flexibility, and how do its settings affect ratio and quality? (3 marks)
Quantisation. The quality setting scales the quantisation table (Lab Exp 5 used 0.5, 1 and 4 times the standard table).
- Larger table values (lower quality): more coefficients round to 0, longer zero runs, higher compression ratio, smaller file. Quality drops: blur, 8 by 8 blocking, ringing at edges. In the lab block, non-zero coefficients fell from 20 (x1) to 8 (x4).
- Smaller table values (higher quality): more coefficients survive, better reconstruction, lower ratio, bigger file (24 non-zero at x0.5).
Pick the highest quality that brings the file under 4 MB. See L02.
Q6. Sampling audio up to 18 kHz at 30 kHz (10 marks)Search on YouTube
(a) Is 30 kHz sufficient for the highest-frequency component? (2 marks)
No. Nyquist requires kHz. At 30 kHz the Nyquist frequency is kHz, so content from 15 to 18 kHz cannot be represented.
(b) What distortion occurs at 30 kHz, why, and what is the minimum theoretical rate? (5 marks)
Aliasing.
Step 1. Components above kHz get fewer than two samples per cycle. The samples also fit a lower-frequency wave, so the wave shape is misread.
Step 2. An 18 kHz tone folds about 15 kHz: alias kHz. A 16 kHz tone appears at kHz.
Step 3. The aliases fall in the audible band and look like real content, so they cannot be removed after sampling.
Step 4. Minimum theoretical rate: kHz. The slides suggest strictly more than twice (1 Hz needs more than 2 samples per second).
The deck's extreme case: sampling 4 kHz at 8 kHz puts every sample at 0, so no wave is recovered.
(c) Why is 44.1 kHz chosen instead of the theoretical minimum? (3 marks)
- Real anti-aliasing filters are not ideal. They roll off gradually. At 44.1 kHz the Nyquist frequency is 22.05 kHz, leaving a guard band above the 18 to 20 kHz audio for the filter to cut.
- Safer reconstruction. More samples per cycle near the top of the band reduce misreading of the waveform and ease the DAC's reconstruction filter.
- Standard compatibility. 44.1 kHz, 16-bit PCM is the CD standard and covers the full hearing range to 20 kHz.
A higher rate is not automatically better audio; it only needs to stay safely above twice the highest frequency. See L03.
Q7. LZ77 on "THE CAT CHASES THE CAT CHASES THE CAT CHASES THE CAT" (10 marks)Search on YouTube
Search buffer 15, window 30, so look-ahead . The message has 52 characters (␣ = space).
(a) Apply LZ77 and give the token sequence. (7 marks)
| # | Search buffer (last up to 15) | Encodes | Token |
|---|---|---|---|
| 1 | (empty) | T | (0, 0, T) |
| 2 | T | H | (0, 0, H) |
| 3 | TH | E | (0, 0, E) |
| 4 | THE | ␣ | (0, 0, ␣) |
| 5 | THE␣ | C | (0, 0, C) |
| 6 | THE␣C | A | (0, 0, A) |
| 7 | THE␣CA | T␣ | (6, 1, ␣) |
| 8 | THE␣CAT␣ | CH | (4, 1, H) |
| 9 | THE␣CAT␣CH | AS | (5, 1, S) |
| 10 | THE␣CAT␣CHAS | ES | (10, 1, S) |
| 11 | THE␣CAT␣CHASES | ␣T | (7, 1, T) |
| 12 | HE␣CAT␣CHASES␣T | HE␣CAT␣CHASES␣T | (15, 14, T) |
| 13 | HE␣CAT␣CHASES␣T | HE␣CAT␣CHASES␣T | (15, 14, T) |
| 14 | HE␣CAT␣CHASES␣T | HE␣CAT | (15, 5, T) |
Key steps:
Step 1. Token 7: T was seen 6 back; the next character is a space, so (6, 1, ␣).
Step 2. Token 11: a space occurs 7 and 11 back; both give length 1; take the nearer, 7.
Step 3. Token 12: the search buffer holds exactly "HE␣CAT␣CHASES␣T". The look-ahead matches 14 characters from 15 back; the 15th character, T, is the next symbol.
Step 4. Token 14: only "HE␣CAT" remains: 5 characters match and T ends the message.
Check: characters. 14 tokens.
(b) Compression efficiency and comment. (3 marks)
Step 1. Original: bits.
Step 2. Token size: offset 0 to 15 needs 4 bits, length 0 to 14 needs 4 bits, symbol 8 bits: 16 bits per token.
Step 3. Encoded: bits.
Step 4. Ratio . Saving .
Comment: effective overall, because the 15-character phrase repeats and each repeat costs one 16-bit token instead of 120 bits. The start expands: the first 11 tokens cover 16 characters but cost 176 bits against 128. LZ77 suits long repetitive data. LZSS would send the early characters as cheap literals. See L01.
Topic frequencySearch on YouTube
| Topic | Oct 2025 | Nov 2025 | Sep 2026 | Page |
|---|---|---|---|---|
| Huffman, LZ77, LZSS numericals | Q6 | Q10 | Q7 | L01 |
| JPEG stages and quantisation | Q3 | Q5 | L02 | |
| PNG filters | Q11 | Q3 | L02 | |
| Camera pipeline (shutter) | Q2 | L02 | ||
| Sampling, Nyquist, bit depth | Q4 | Q2 | Q1, Q6 | L03 |
| MPEG frames and GOP | Q4 | Q4 | L03 | |
| Image forensics | Q2, Q5 | Q6, Q8 | L04 | |
| QoS and resource management | Q1 | Q1, Q7 | L05 | |
| Steganography, steganalysis, watermarking | Q3, Q5, Q9 | L06 |