Web Simulation 

 

 

 

 

Singular Value Decomposition (SVD) for MIMO Precoding Tutorial 

This interactive tutorial demonstrates Singular Value Decomposition (SVD) in the context of a 2×2 MIMO (Multiple-Input Multiple-Output) Communication System. SVD decomposes a channel matrix H into three matrices (U, S, V), allowing us to transform a "coupled" channel with interference into parallel, independent data streams (eigenmodes) through precoding (multiplying by V) and combining (multiplying by U^T), which is fundamental to modern wireless communication systems and MIMO precoding techniques. The tutorial visualizes a simplified 2×2 MIMO system with real-valued channel matrices (for clarity), making it easy to understand how SVD works at a fundamental level and how it enables spatial multiplexing.

The visualization displays three main components: (1) Mathematical Dashboard (top) - shows the channel matrix H, SVD decomposition (U, S, V), precoding matrix P, and singular values dynamically updating, with the singular values highlighted to show channel strength. The channel matrix H can be edited directly using spin boxes within the matrix display, (2) Control Panel (left sidebar) - contains a toggle switch between "Raw Transmission" (sending raw data) and "SVD Precoding" (sending precoded data), a dropdown menu for selecting preset channel matrices H, and a statistics display showing input, transmitted, received, and recovered vectors along with singular values, (3) Visualization Canvas (main area) - shows a flow diagram from Transmitter to Receiver with four stages: Input Vector s (unit circle with input vector, draggable with mouse), Precoded x = P×s (precoding step in SVD mode), Received y = H×x (channel transformation), and Output r = U^T×y (combining step in SVD mode). The visualization uses vector graphics to show how signals transform through each stage, with unit circles displayed in all plots for reference, with special emphasis on how SVD mode creates parallel independent streams versus raw mode which shows interference.

The simulator implements the standard SVD decomposition: H = U × S × V^T, where H is the 2×2 channel matrix, U is the left singular vectors matrix (combining matrix), S is the diagonal matrix of singular values (channel gains), and V is the right singular vectors matrix. The precoding matrix P = V is applied at the transmitter. For raw transmission: y = H × s (interference present). For SVD precoding: x = P × s (precoding, where P = V), y = H × x (channel), r = U^T × y (combining), resulting in r = S × s (parallel streams). You can adjust the channel matrix elements using spin boxes in the matrix display, select from preset channel matrices using the dropdown menu, toggle between raw and SVD modes to compare interference vs. parallel streams, and control the input vector by dragging it directly on the visualization canvas. The mathematical dashboard displays all matrices (H, U, S, V, P, U^T) in real-time, and the visualization canvas shows vector transformations with unit circles in all plots for reference.

NOTE : This simulation demonstrates SVD in a "glass box" architecture where every matrix, vector transformation, and calculation is visible. The simplified 2×2 MIMO system (real-valued matrices for clarity) is structured enough to visualize the complete SVD decomposition and understand how precoding and combining transform a coupled channel into parallel eigenmodes, yet complex enough to demonstrate the fundamental concepts of SVD-based MIMO precoding. The key insight is the diagonalization: SVD decomposes the channel matrix into orthogonal directions (singular vectors) with independent gains (singular values), allowing simultaneous transmission of multiple data streams without interference. This demonstrates how SVD enables spatial multiplexing in modern wireless communication systems.

Mathematical Model

Singular Value Decomposition (SVD) is a fundamental matrix factorization technique that decomposes any m×n matrix H into three matrices: H = U × S × V^T, where U is an m×m orthogonal matrix (left singular vectors), S is an m×n diagonal matrix (singular values), and V is an n×n orthogonal matrix (right singular vectors). In the context of MIMO communication, H represents the channel matrix describing how signals propagate between transmit and receive antennas, U represents the combining matrix at the receiver, S contains the channel gains (singular values), and V represents the precoding matrix at the transmitter.

SVD Decomposition:

H = U × S × V^T (SVD Decomposition)
Raw Transmission: y = H × s (Interference present)
SVD Precoding: x = P × s (Precoding step, where P = V)
SVD Channel: y = H × x (Channel step)
SVD Combining: r = U^T × y (Combining step)
Result: r = S × s (Parallel independent streams)

where:

  • H: Channel matrix (2×2 in this tutorial) - describes the physical channel between transmit and receive antennas, with off-diagonal elements representing interference
  • U: Left singular vectors matrix (2×2) - orthogonal matrix containing the output directions (eigenmodes at receiver), used for combining
  • S: Singular values matrix (2×2 diagonal) - diagonal matrix containing the channel gains (singular values σ₁, σ₂) for each eigenmode
  • V: Right singular vectors matrix (2×2) - orthogonal matrix containing the input directions (eigenmodes at transmitter) from SVD decomposition
  • P: Precoding matrix (2×2) - the precoding matrix applied at the transmitter (P = V from SVD)
  • s: Input signal vector (2×1) - the data streams to be transmitted (s₁, s₂)
  • x: Precoded signal vector (2×1) - the transmitted signal after precoding (x = P × s)
  • y: Received signal vector (2×1) - the signal after passing through the channel (y = H × x)
  • r: Recovered signal vector (2×1) - the signal after combining (r = U^T × y = S × s)
  • σ₁, σ₂: Singular values - the channel gains for each eigenmode, representing the strength of each parallel stream

Understanding the Terms:

Channel Matrix (H): The channel matrix H represents the physical channel between transmit and receive antennas in a MIMO system. Each element H[i,j] represents the complex gain from transmit antenna j to receive antenna i. In a real wireless scenario, these would be complex numbers representing amplitude and phase. For this tutorial, we use real numbers for simplicity. A non-diagonal matrix means that signals interfere with each other (antenna 1's signal affects antenna 2's receiver, and vice versa). The goal of SVD precoding is to transform this coupled channel into independent parallel streams.

Singular Value Decomposition (SVD): SVD decomposes any matrix H into three matrices: H = U × S × V^T. The columns of U are the left singular vectors (output directions), the columns of V are the right singular vectors (input directions), and the diagonal of S contains the singular values (channel gains). The singular values are always non-negative and are typically ordered from largest to smallest. In the context of MIMO, the singular vectors represent the "eigenmodes" of the channel - the orthogonal directions along which data can be transmitted independently.

Precoding Matrix (P): The precoding matrix P (which equals V from the SVD decomposition) is applied at the transmitter. It rotates the input signal vector s to align with the input eigenmodes (columns of V). When we transmit x = P × s, we are sending data along the directions that the channel naturally "wants" to see. This precoding step is what enables the channel to appear diagonal when viewed from the right coordinate system.

Combining Matrix (U^T): The combining matrix U^T (transpose of U) is applied at the receiver. It rotates the received signal vector y to align with the output eigenmodes (columns of U). When we combine r = U^T × y, we are receiving data along the directions that the channel naturally produces. Together with precoding, this creates the diagonal channel: r = U^T × H × V × s = S × s.

Singular Values (σ₁, σ₂): The singular values are the diagonal elements of S, representing the channel gains for each eigenmode. The largest singular value (σ₁) represents the strongest channel direction, while the smallest singular value (σ₂) represents the weakest channel direction. In MIMO systems, the capacity is determined by these singular values - more uniform singular values mean higher capacity (more independent streams), while highly imbalanced singular values mean lower capacity (one dominant stream).

Eigenmodes (Parallel Streams): The eigenmodes are the orthogonal directions along which data can be transmitted independently. There are two eigenmodes for a 2×2 system (corresponding to the two singular values). When SVD precoding is used, data stream 1 (s₁) is sent along eigenmode 1 and received as σ₁ × s₁ (scaled by the first singular value), while data stream 2 (s₂) is sent along eigenmode 2 and received as σ₂ × s₂ (scaled by the second singular value). These streams do not interfere with each other because they are orthogonal.

Input Signal Vector (s): The input signal vector s = [s₁, s₂]^T represents the two data streams to be transmitted. In raw transmission mode, this vector is sent directly through the channel, resulting in interference. In SVD precoding mode, this vector is first rotated by P (precoding, where P = V) before transmission, then rotated back by U^T (combining) after reception, resulting in parallel independent streams.

Raw Transmission vs. SVD Precoding: In raw transmission, we send s directly through the channel: y = H × s. This results in interference because the off-diagonal elements of H cause stream 1 to affect receiver 2, and stream 2 to affect receiver 1. The output is a rotated and scaled version of the input, making it difficult to recover the original data streams. In SVD precoding, we apply precoding at the transmitter (x = P × s, where P = V), send through the channel (y = H × x), and apply combining at the receiver (r = U^T × y). The key insight is that U^T × H × V = S (diagonal), so r = S × s. This means the output is just a scaled version of the input (no rotation, no interference), making it easy to recover the original data streams by simply dividing by the singular values.

Visualization Flow: The visualization canvas shows the complete signal flow from transmitter to receiver in four stages, each displaying a unit circle for reference: (1) Input Vector s - shows the unit circle and the input vector s (default: magnitude 1, angle 45 degrees), representing the data to be transmitted. The input vector can be dragged directly on the canvas using the mouse, (2) Precoded x = P×s (or "x = s (No Precoding)" in raw mode) - shows the rotation applied by P (only in SVD mode, where P = V), transforming s into x = P × s, (3) Received y = H×x - shows the transformation by H, which stretches and rotates the vector based on the channel matrix values, (4) Output r = U^T×y (or "Output r = y" in raw mode) - shows the received vector y, and in SVD mode, shows the final combining step (U^T) which rotates the signal back to align with the axes, resulting in r = S × s (parallel streams). The crucial visual difference is that in SVD mode, the final vector aligns perfectly with the original input (just scaled), while in raw mode, it is rotated/distorted (interference).

 

Usage Example

Follow these steps to explore how SVD transforms a coupled MIMO channel into parallel independent streams:

  1. Initial State: When you first load the simulation, you'll see: (1) Mathematical Dashboard (top) - displays the channel matrix H (editable with spin boxes), SVD decomposition matrices (U, S, V), precoding matrix P, combiner U^T, and singular values σ₁, σ₂, (2) Control Panel (left sidebar) - contains the SVD Precoding toggle checkbox, H Preset dropdown menu, and statistics display showing input s, transmitted x, received y, recovered r vectors, and singular values, (3) Visualization Canvas (main area) - shows four stages of signal flow with unit circles and vectors. The default channel matrix H is [[1.5, 0.5], [0.5, 1.2]] (Asymmetric preset), and the default input vector s is [0.707, 0.707] (magnitude 1, angle 45 degrees on the unit circle). SVD Precoding mode is ON by default.
  2. Understand the Signal Flow: Observe the four stages in the visualization canvas: (1) Input Vector s (leftmost, green) - shows the input data streams on the unit circle, (2) Precoded x = P×s (second, cyan) - shows the precoded signal after applying the precoding matrix P (only in SVD mode), (3) Received y = H×x (third, orange) - shows the signal after passing through the channel matrix H, (4) Output r = U^T×y (rightmost, magenta) - shows the recovered signal after applying the combining matrix U^T (only in SVD mode). In SVD mode, notice how the output vector aligns with the input vector (just scaled by singular values), indicating parallel independent streams. In raw mode, notice the rotation/distortion indicating interference.
  3. Toggle SVD Precoding: Click the "SVD Precoding" checkbox to toggle between SVD Precoding mode (ON) and Raw Transmission mode (OFF). In SVD mode, observe how the precoding step (x = P×s) rotates the input, and the combining step (r = U^T×y) rotates it back, resulting in parallel streams. In raw mode, notice the absence of precoding and combining, and how interference causes rotation/distortion. Toggle back and forth to compare the difference - SVD mode eliminates interference, raw mode shows interference.
  4. Adjust Channel Matrix H: Edit the channel matrix H elements directly using the spin boxes in the matrix display. Try different values to see how the channel affects the signal transformation. Watch how changing H updates the SVD decomposition (U, S, V) in real-time, and observe how the singular values change. Notice that when H is diagonal (off-diagonal elements are 0), there is no interference, and when off-diagonal elements are non-zero, interference occurs in raw mode but is eliminated in SVD mode.
  5. Use H Preset Dropdown: Select different preset channel matrices from the "H Preset" dropdown menu to quickly explore common channel configurations. Try: Identity (no transformation), Diagonal Strong (strong channel gains, no interference), Coupled (significant interference), Singular (channel is singular, one eigenmode is zero), Rotation (pure rotation). Each preset demonstrates different channel characteristics. Notice how the singular values change with each preset - more uniform singular values mean better capacity (two strong streams), while imbalanced singular values mean reduced capacity (one dominant stream).
  6. Drag Input Vector: Click and drag the input vector s directly on the visualization canvas (in the "Input Vector s" stage, leftmost plot). The vector is constrained to stay within reasonable bounds. As you drag, observe how all subsequent stages update in real-time - the precoded vector x, the received vector y, and the recovered vector r all respond immediately. Try dragging to different positions on the unit circle to see how the signal transforms through each stage. Notice how in SVD mode, the output vector direction matches the input direction (just scaled), while in raw mode, the output direction is rotated.
  7. Observe Singular Values: Watch the singular values σ₁ and σ₂ displayed in both the matrix dashboard (in matrix S) and the statistics display. These values represent the channel gains for each eigenmode. Notice that σ₁ ≥ σ₂ (they are ordered from largest to smallest). More uniform singular values (σ₁ ≈ σ₂) indicate good capacity (two independent streams), while highly imbalanced singular values (σ₁ >> σ₂) indicate reduced capacity (one dominant stream). Try different H presets to see how singular values vary.
  8. Understand the Matrices: Examine the six matrices displayed in the mathematical dashboard: (1) H (Channel Matrix) - the physical channel, editable, (2) U (Left Singular Vectors) - output directions, used for combining, (3) S (Singular Values) - channel gains, diagonal matrix, (4) V (Right Singular Vectors) - input directions, used for precoding, (5) P (Precoding Matrix) - equals V, applied at transmitter, (6) U^T (Combiner) - transpose of U, applied at receiver. Notice that P = V, and understand how U^T × H × V = S (diagonal) eliminates interference.
  9. Compare Raw vs SVD Mode: Set up a non-diagonal channel matrix H (e.g., use the "Coupled" preset). Toggle between Raw Transmission mode (SVD Precoding OFF) and SVD Precoding mode (SVD Precoding ON). In raw mode: observe interference - the output vector is rotated and distorted compared to the input. In SVD mode: observe parallel streams - the output vector aligns with the input (just scaled). This demonstrates the key benefit of SVD precoding: it transforms a coupled channel into parallel independent streams, eliminating interference.
  10. Explore Different Scenarios: Experiment with different combinations: (1) Try various H presets with SVD mode ON to see how different channels are diagonalized, (2) Try dragging the input vector to different positions and observe the transformations, (3) Edit H manually using spin boxes to create custom channel matrices, (4) Compare singular values across different H matrices - notice how channel characteristics affect capacity. The key insight is that SVD decomposes any channel matrix into orthogonal directions (singular vectors) with independent gains (singular values), enabling spatial multiplexing.

Tip: The key insight to look for is how SVD diagonalizes the channel matrix. In raw transmission mode, interference occurs because off-diagonal elements of H cause cross-talk between streams. In SVD precoding mode, the precoding matrix P (which equals V) rotates the input to align with the channel's input eigenmodes, and the combining matrix U^T rotates the output to align with the output eigenmodes, creating a diagonal effective channel (S). This means each stream is scaled independently by its singular value (σ₁ or σ₂) without interference. Try the "Coupled" preset with SVD mode ON - notice how the output vector direction matches the input direction (just scaled), demonstrating that interference is eliminated. The unit circles in all plots help you visualize the transformations geometrically.

Parameters

Followings are short descriptions on each parameter
  • Channel Matrix H: A 2×2 real-valued matrix describing the physical channel between transmit and receive antennas in a MIMO system. Each element H[i,j] represents the gain from transmit antenna j to receive antenna i. Range: -3.0 to 3.0 per element (adjustable using spin boxes). Default: [[1.5, 0.5], [0.5, 1.2]] (Asymmetric preset). Off-diagonal elements represent interference (cross-talk between antennas). The channel matrix can be edited directly using spin boxes in the matrix display, or selected from preset options using the H Preset dropdown. The matrix is automatically decomposed using SVD to compute U, S, and V matrices.
  • H Preset: A dropdown menu for selecting common preset channel matrices. Options include: Custom (no change), Identity [[1,0],[0,1]] (no transformation), Diagonal Strong [[2,0],[0,1.5]] (strong channel gains, no interference), Diagonal Weak [[0.5,0],[0,1]] (weak channel gains, no interference), Coupled [[1,0.8],[0.8,1]] (significant interference), Strong Coupling [[1.5,1],[1,1.2]] (strong interference), Asymmetric [[1.5,0.5],[0.5,1.2]] (default, moderate interference), Singular [[1,1],[1,1]] (singular matrix, one eigenmode is zero), Rotation [[0.707,-0.707],[0.707,0.707]] (pure rotation). Selecting a preset updates the channel matrix H and recomputes the SVD decomposition.
  • SVD Precoding Toggle: A checkbox that toggles between SVD Precoding mode (ON) and Raw Transmission mode (OFF). When ON (SVD mode): precoding matrix P is applied at the transmitter (x = P × s), and combining matrix U^T is applied at the receiver (r = U^T × y), resulting in parallel independent streams (r = S × s). When OFF (Raw mode): no precoding or combining is applied, resulting in interference (y = H × s, r = y). Default: ON. Toggle this to compare interference in raw mode versus parallel streams in SVD mode.
  • Input Vector s: A 2×1 vector representing the two data streams to be transmitted [s₁, s₂]^T. Default: [0.707, 0.707] (magnitude 1, angle 45 degrees on the unit circle). The input vector can be controlled by dragging it directly on the visualization canvas (in the "Input Vector s" stage, leftmost plot). The vector is constrained to stay within reasonable bounds (magnitude ≤ 2). When you drag the input vector, all subsequent stages (precoded x, received y, recovered r) update in real-time.
  • Left Singular Vectors Matrix U: A 2×2 orthogonal matrix containing the output directions (eigenmodes at receiver), used for combining. The columns of U are the left singular vectors (output directions). U is computed automatically from the SVD decomposition of H. The transpose of U (U^T) is used as the combining matrix at the receiver. U is displayed in the mathematical dashboard and is read-only (computed from H).
  • Singular Values Matrix S: A 2×2 diagonal matrix containing the channel gains (singular values σ₁, σ₂) for each eigenmode. The diagonal elements are the singular values: S[0,0] = σ₁ (first singular value, largest), S[1,1] = σ₂ (second singular value, smallest), with S[0,1] = S[1,0] = 0. The singular values are always non-negative and are ordered from largest to smallest (σ₁ ≥ σ₂). S is computed automatically from the SVD decomposition of H. More uniform singular values (σ₁ ≈ σ₂) indicate better capacity (two strong independent streams), while imbalanced singular values (σ₁ >> σ₂) indicate reduced capacity (one dominant stream). S is displayed in the mathematical dashboard and statistics display, with singular values highlighted in green.
  • Right Singular Vectors Matrix V: A 2×2 orthogonal matrix containing the input directions (eigenmodes at transmitter) from SVD decomposition. The columns of V are the right singular vectors (input directions). V is computed automatically from the SVD decomposition of H. V is used as the precoding matrix P at the transmitter (P = V). V is displayed in the mathematical dashboard and is read-only (computed from H).
  • Precoding Matrix P: A 2×2 matrix applied at the transmitter for SVD precoding. P equals V from the SVD decomposition (P = V). When SVD Precoding mode is ON, the precoding matrix P is applied to rotate the input signal vector s to align with the input eigenmodes: x = P × s. This precoding step enables the channel to appear diagonal when viewed from the right coordinate system. P is displayed in the mathematical dashboard and is read-only (computed from V).
  • Combiner Matrix U^T: A 2×2 matrix (transpose of U) applied at the receiver for SVD combining. When SVD Precoding mode is ON, the combining matrix U^T is applied to rotate the received signal vector y to align with the output eigenmodes: r = U^T × y. Together with precoding, this creates the diagonal effective channel: r = U^T × H × V × s = S × s. U^T is displayed in the mathematical dashboard and is read-only (computed from U).
  • Precoded Signal Vector x: A 2×1 vector representing the transmitted signal after precoding. In SVD mode: x = P × s (where P = V). In raw mode: x = s (no precoding). The precoded vector x is displayed in the visualization canvas (second stage, "Precoded x = P×s" or "x = s (No Precoding)") and in the statistics display. In SVD mode, x shows the rotation applied by the precoding matrix P.
  • Received Signal Vector y: A 2×1 vector representing the signal after passing through the channel matrix H. y = H × x (or y = H × s in raw mode). The received vector y is displayed in the visualization canvas (third stage, "Received y = H×x") and in the statistics display. The received vector shows the transformation applied by the channel matrix H (stretching and rotation).
  • Recovered Signal Vector r: A 2×1 vector representing the signal after combining (in SVD mode) or after reception (in raw mode). In SVD mode: r = U^T × y = S × s (parallel independent streams, just scaled by singular values). In raw mode: r = y (no combining, interference present). The recovered vector r is displayed in the visualization canvas (fourth stage, "Output r = U^T×y" or "Output r = y") and in the statistics display. In SVD mode, r aligns with the input s (just scaled), demonstrating that interference is eliminated.
  • Singular Value σ₁: The first (largest) singular value, representing the channel gain for the first eigenmode. Range: ≥ 0 (non-negative). σ₁ is the diagonal element S[0,0] of the singular values matrix S. A larger σ₁ indicates a stronger channel direction. σ₁ is displayed in both the matrix dashboard (in matrix S) and the statistics display (highlighted in green). More uniform singular values (σ₁ ≈ σ₂) indicate better capacity.
  • Singular Value σ₂: The second (smallest) singular value, representing the channel gain for the second eigenmode. Range: ≥ 0 (non-negative), with σ₂ ≤ σ₁. σ₂ is the diagonal element S[1,1] of the singular values matrix S. A larger σ₂ indicates a stronger second channel direction. σ₂ is displayed in both the matrix dashboard (in matrix S) and the statistics display (highlighted in green). When σ₂ is very small compared to σ₁, the channel has reduced capacity (one dominant stream).

Controls and Visualizations

Followings are short descriptions on each control
  • Channel Matrix H Spin Boxes: Four spin box input fields (H[0,0], H[0,1], H[1,0], H[1,1]) located within the "Channel Matrix H" box in the mathematical dashboard. Each spin box allows you to edit the corresponding channel matrix element directly. Range: -3.0 to 3.0 per element (adjustable using spin box arrows or by typing values). Step: 0.1. Default: [[1.5, 0.5], [0.5, 1.2]] (Asymmetric preset). When you change a matrix element, the SVD decomposition (U, S, V) is automatically recomputed, and all matrices (U, S, V, P, U^T) and vectors (x, y, r) are updated in real-time. The spin boxes use right-aligned text with spin buttons on the right edge for Excel-like data entry.
  • H Preset Dropdown: A dropdown menu located in the control panel (on the same line as the SVD Precoding toggle) for selecting common preset channel matrices H. Options include: Custom (no change), Identity [[1,0],[0,1]], Diagonal Strong [[2,0],[0,1.5]], Diagonal Weak [[0.5,0],[0,1]], Coupled [[1,0.8],[0.8,1]], Strong Coupling [[1.5,1],[1,1.2]], Asymmetric [[1.5,0.5],[0.5,1.2]] (default), Singular [[1,1],[1,1]], and Rotation [[0.707,-0.707],[0.707,0.707]]. When you select a preset, the channel matrix H is updated, the SVD decomposition is recomputed, and all displays are updated in real-time. This allows you to quickly explore different channel configurations.
  • SVD Precoding Toggle Checkbox: A checkbox located in the control panel for toggling between SVD Precoding mode (ON) and Raw Transmission mode (OFF). When checked (ON, default): precoding matrix P is applied at the transmitter (x = P × s), and combining matrix U^T is applied at the receiver (r = U^T × y), resulting in parallel independent streams (r = S × s). When unchecked (OFF): no precoding or combining is applied, resulting in interference (y = H × s, r = y). The checkbox is labeled "SVD Precoding:" with an "ON"/"OFF" text display next to it. Toggle this to compare interference in raw mode versus parallel streams in SVD mode.
  • Mouse Drag on Visualization Canvas: Interactive mouse dragging on the visualization canvas to control the input vector s. Click and drag the input vector s directly on the canvas in the "Input Vector s" stage (leftmost plot). The input vector is constrained to stay within reasonable bounds (magnitude ≤ 2). As you drag, all subsequent stages (precoded x, received y, recovered r) update in real-time. The visualization canvas uses mouse event listeners (mousedown, mousemove, mouseup, mouseleave) to detect dragging within the Input Vector s stage area. This allows intuitive control of the input vector by directly manipulating it on the visualization.
  • Mathematical Dashboard: A display panel at the top of the simulation showing all matrices in a grid layout. Displays six matrices: (1) Channel Matrix H - editable with spin boxes, (2) Left Singular Vectors U - computed from SVD, read-only, (3) Singular Values S - diagonal matrix with singular values σ₁ and σ₂ highlighted in green, (4) Right Singular Vectors V - computed from SVD, read-only, (5) Precoding Matrix P - equals V, read-only, (6) Combiner U^T - transpose of U, read-only. All matrices are displayed in a responsive grid layout with centered text. The matrices update in real-time when the channel matrix H is changed. The singular values are highlighted in green to emphasize channel strength.
  • Visualization Canvas: Canvas displaying the signal flow from transmitter to receiver in four stages, each showing a unit circle for reference. The four stages are: (1) Input Vector s (leftmost, green vector) - shows the input data streams on the unit circle, draggable with mouse, (2) Precoded x = P×s (or "x = s (No Precoding)" in raw mode, second, cyan vector) - shows the precoded signal after applying precoding matrix P (only in SVD mode), (3) Received y = H×x (third, orange vector) - shows the signal after passing through the channel matrix H, (4) Output r = U^T×y (or "Output r = y" in raw mode, rightmost, magenta vector) - shows the recovered signal after applying combining matrix U^T (only in SVD mode). Each stage displays: unit circle (gray), coordinate axes (dashed lines), vector (colored arrow), vector endpoint (filled circle), and stage label (text). The crucial visual difference is that in SVD mode, the output vector aligns with the input vector (just scaled), while in raw mode, it is rotated/distorted (interference).
  • Statistics Display: Text display panel in the control panel showing current vector values and singular values in real-time. Displays: (1) Input s: [s₁, s₂] - the input vector, (2) Transmitted x: [x₁, x₂] - the precoded/transmitted vector, (3) Received y: [y₁, y₂] - the received vector, (4) Recovered r: [r₁, r₂] - the recovered vector, (5) Singular Value σ₁: (value, highlighted in green) - the first (largest) singular value, (6) Singular Value σ₂: (value, highlighted in green) - the second (smallest) singular value. The statistics update continuously as you change the channel matrix H, toggle SVD mode, or drag the input vector s. Uses Courier New font with bright text on dark background for visibility. The singular values are highlighted in green to emphasize channel strength.

Key Concepts

  • Singular Value Decomposition (SVD): A fundamental matrix factorization technique that decomposes any m×n matrix H into three matrices: H = U × S × V^T, where U is an m×m orthogonal matrix (left singular vectors), S is an m×n diagonal matrix (singular values), and V is an n×n orthogonal matrix (right singular vectors). In the context of MIMO communication, SVD decomposes the channel matrix H into orthogonal directions (singular vectors) with independent gains (singular values), allowing simultaneous transmission of multiple data streams without interference. SVD is the mathematical foundation for spatial multiplexing in MIMO systems, enabling precoding and combining to transform a coupled channel into parallel independent streams.
  • MIMO (Multiple-Input Multiple-Output): A communication system architecture that uses multiple transmit antennas and multiple receive antennas to improve communication performance. In a 2×2 MIMO system (used in this tutorial), there are 2 transmit antennas and 2 receive antennas. The channel matrix H describes how signals propagate between all transmit-receive antenna pairs. MIMO systems can achieve higher capacity (more data streams) and better reliability compared to single-antenna systems. The key advantage is spatial multiplexing: transmitting multiple independent data streams simultaneously over the same frequency band by exploiting spatial diversity.
  • Channel Matrix (H): A 2×2 matrix describing the physical channel between transmit and receive antennas in a MIMO system. Each element H[i,j] represents the gain from transmit antenna j to receive antenna i. In real wireless scenarios, these would be complex numbers representing amplitude and phase. For this tutorial, we use real numbers for simplicity. A non-diagonal matrix (off-diagonal elements are non-zero) means that signals interfere with each other (cross-talk between antennas). The goal of SVD precoding is to transform this coupled channel into independent parallel streams.
  • Eigenmodes (Parallel Streams): The orthogonal directions along which data can be transmitted independently in a MIMO system. For a 2×2 system, there are two eigenmodes (corresponding to the two singular values). The eigenmodes are the columns of V (input directions) and the columns of U (output directions). When SVD precoding is used, data stream 1 (s₁) is sent along eigenmode 1 and received as σ₁ × s₁ (scaled by the first singular value), while data stream 2 (s₂) is sent along eigenmode 2 and received as σ₂ × s₂ (scaled by the second singular value). These streams do not interfere with each other because they are orthogonal.
  • Precoding: A technique applied at the transmitter in MIMO systems to align the input signal with the channel eigenmodes. The precoding matrix P (which equals V from the SVD decomposition) rotates the input signal vector s to align with the input eigenmodes (columns of V). When we transmit x = P × s, we are sending data along the directions that the channel naturally "wants" to see. This precoding step enables the channel to appear diagonal when viewed from the right coordinate system, eliminating interference.
  • Combining: A technique applied at the receiver in MIMO systems to align the received signal with the output eigenmodes. The combining matrix U^T (transpose of U) rotates the received signal vector y to align with the output eigenmodes (columns of U). When we combine r = U^T × y, we are receiving data along the directions that the channel naturally produces. Together with precoding, combining creates the diagonal effective channel: r = U^T × H × V × s = S × s, resulting in parallel independent streams.
  • Singular Values (σ₁, σ₂): The diagonal elements of the singular values matrix S, representing the channel gains for each eigenmode. The singular values are always non-negative and are ordered from largest to smallest (σ₁ ≥ σ₂). The largest singular value (σ₁) represents the strongest channel direction, while the smallest singular value (σ₂) represents the weakest channel direction. In MIMO systems, the capacity is determined by these singular values - more uniform singular values (σ₁ ≈ σ₂) mean higher capacity (two strong independent streams), while highly imbalanced singular values (σ₁ >> σ₂) mean lower capacity (one dominant stream).
  • Spatial Multiplexing: The ability of MIMO systems to transmit multiple independent data streams simultaneously over the same frequency band by exploiting spatial diversity (multiple antennas). SVD precoding and combining enable spatial multiplexing by transforming a coupled channel (with interference) into parallel independent streams (without interference). Each stream is scaled independently by its singular value (σ₁ or σ₂), allowing simultaneous transmission of multiple data streams. The number of independent streams is determined by the rank of the channel matrix (typically equal to the minimum of the number of transmit and receive antennas).
  • Interference vs. Parallel Streams: In raw transmission mode (no precoding/combining), signals interfere with each other because off-diagonal elements of H cause cross-talk between antennas. The output is a rotated and scaled version of the input, making it difficult to recover the original data streams. In SVD precoding mode, precoding and combining eliminate interference by transforming the channel into a diagonal matrix (S). The output is just a scaled version of the input (no rotation, no interference), making it easy to recover the original data streams by simply dividing by the singular values. This is the key benefit of SVD precoding.
  • Channel Capacity: The maximum achievable data rate (in bits per second) over a communication channel. In MIMO systems, the capacity is determined by the singular values of the channel matrix H. More uniform singular values (σ₁ ≈ σ₂) mean higher capacity (two strong independent streams can be transmitted), while highly imbalanced singular values (σ₁ >> σ₂) mean lower capacity (one dominant stream, the other stream is weak). The capacity scales with the number of antennas and the uniformity of the singular values. SVD precoding enables the system to achieve the maximum capacity by creating parallel independent streams.
  • What to Look For: When exploring the simulation, observe: (1) How the visualization canvas shows four stages of signal flow (Input s, Precoded x, Received y, Output r), each displaying a unit circle for reference, (2) How in SVD mode, the output vector aligns with the input vector (just scaled), while in raw mode, it is rotated/distorted (interference), (3) How the singular values change with different channel matrices H - more uniform values mean better capacity, (4) How the mathematical dashboard displays all matrices (H, U, S, V, P, U^T) in real-time, showing how SVD decomposes H, (5) How dragging the input vector on the canvas updates all stages in real-time, demonstrating the signal transformations. The key insight is the diagonalization: SVD transforms a coupled channel into parallel independent streams, enabling spatial multiplexing in MIMO systems.

NOTE : This simulation demonstrates SVD in a completely transparent "glass box" architecture where every matrix, vector transformation, and calculation is visible. The simplified 2×2 MIMO system (real-valued matrices for clarity) is structured enough to visualize the complete SVD decomposition and understand how precoding and combining transform a coupled channel into parallel eigenmodes, yet complex enough to demonstrate the fundamental concepts of SVD-based MIMO precoding. The key insight is the diagonalization: SVD decomposes the channel matrix H into orthogonal directions (singular vectors) with independent gains (singular values), allowing simultaneous transmission of multiple data streams without interference. This is visualized in the mathematical dashboard (all matrices H, U, S, V, P, U^T displayed in real-time) and in the visualization canvas (four stages showing signal flow: Input s, Precoded x, Received y, Output r, each with unit circles for reference). Try toggling between SVD Precoding mode (ON) and Raw Transmission mode (OFF) to compare interference versus parallel streams - in SVD mode, the output vector aligns with the input vector (just scaled), while in raw mode, it is rotated/distorted (interference). Try different H presets (e.g., "Coupled" preset) to see how different channel configurations affect the singular values and signal transformations. The mathematical dashboard shows all matrices updating in real-time as you change H, making the mathematical process transparent. This demonstrates the fundamental concept behind Singular Value Decomposition (SVD) used in modern MIMO communication systems: SVD decomposes any channel matrix into orthogonal directions with independent gains, enabling spatial multiplexing through precoding and combining. The system automatically transforms a coupled channel (with interference) into parallel independent streams (without interference) without any explicit programming - this is the power of SVD. In practice, real-world MIMO systems use larger channel matrices (with complex-valued entries representing amplitude and phase) and more sophisticated signal processing, but the core principle remains the same: SVD enables spatial multiplexing by diagonalizing the channel matrix through precoding and combining.