{"id":31922894,"url":"https://github.com/albertomarquillas/block-codes-ber-matlab","last_synced_at":"2025-10-13T23:26:56.336Z","repository":{"id":313576655,"uuid":"1051904942","full_name":"AlbertoMarquillas/block-codes-ber-matlab","owner":"AlbertoMarquillas","description":"MATLAB simulation of Hamming (7,4) and general (5,2) block codes over a Binary Symmetric Channel, analyzing BER performance.","archived":false,"fork":false,"pushed_at":"2025-09-07T01:17:31.000Z","size":799,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-07T03:11:40.267Z","etag":null,"topics":["ber-simulation","block-codes","bsc-channel","communications","digital-communications","error-correcting-codes","hamming-code","matlab"],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlbertoMarquillas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-07T01:06:31.000Z","updated_at":"2025-09-07T01:19:38.000Z","dependencies_parsed_at":"2025-09-07T03:11:44.246Z","dependency_job_id":"5c28b4e6-60f5-4496-984d-c0f33a70f914","html_url":"https://github.com/AlbertoMarquillas/block-codes-ber-matlab","commit_stats":null,"previous_names":["albertomarquillas/block-codes-ber-matlab"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/AlbertoMarquillas/block-codes-ber-matlab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertoMarquillas%2Fblock-codes-ber-matlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertoMarquillas%2Fblock-codes-ber-matlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertoMarquillas%2Fblock-codes-ber-matlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertoMarquillas%2Fblock-codes-ber-matlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlbertoMarquillas","download_url":"https://codeload.github.com/AlbertoMarquillas/block-codes-ber-matlab/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertoMarquillas%2Fblock-codes-ber-matlab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017241,"owners_count":26086015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ber-simulation","block-codes","bsc-channel","communications","digital-communications","error-correcting-codes","hamming-code","matlab"],"created_at":"2025-10-13T23:26:52.245Z","updated_at":"2025-10-13T23:26:56.327Z","avatar_url":"https://github.com/AlbertoMarquillas.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Block Codes BER Simulation (MATLAB)\n\n![Language](https://img.shields.io/badge/language-MATLAB-orange)\n![License](https://img.shields.io/badge/license-MIT-green)\n![Release](https://img.shields.io/github/v/release/AlbertoMarquillas/block-codes-ber-matlab)\n![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-orange)\n\n---\n\n## 📌 Overview\n\nThis project implements a **MATLAB simulation** of block codes over a **Binary Symmetric Channel (BSC)** to analyze the **Bit Error Rate (BER)** performance. The goal is to compare two families of linear block codes:\n\n* **Hamming (7,4) code**\n* **General linear (5,2) code**\n\nThe simulation encodes random bit sequences, transmits them through a BSC with varying error probabilities, decodes the received sequences, and computes the resulting BER. The results are plotted and discussed in relation to redundancy, minimum distance, and error correction capabilities.\n\nThis repository is part of the **Digital Communications coursework (2024–2025)**.\n\n---\n\n## 📂 Repository Structure\n\n```\n\u003crepo\u003e/\n├─ src/                     # MATLAB source code\n│  └─ simulate_block_codes.m\n├─ test/                    # Placeholder for future test scripts\n├─ docs/                    # Reports and written documentation\n│  ├─ Memoria_AC2.pdf       # Project report (Catalan)\n│  ├─ Activitat pràctica AC2.pdf  # Original assignment statement\n│  └─ assets/               # Figures and simulation results\n│     └─ grafica_BER_AC2.png\n├─ build/                   # Temporary outputs (ignored)\n└─ README.md                # Project documentation\n```\n\n---\n\n## ⚙️ How to Run\n\nRun the MATLAB simulation script from the repository root:\n\n```powershell\n# Run in MATLAB headless mode\ntmatlab -batch \"run('src/simulate_block_codes.m')\"\n```\n\nThis will:\n\n1. Generate random bit sequences.\n2. Encode them using Hamming (7,4) and linear (5,2) codes.\n3. Transmit them through a BSC with 9 logarithmically spaced error probabilities (0.01 → 0.1).\n4. Decode the received words.\n5. Compute and display BER for both codes.\n6. Save the resulting BER plot to `docs/assets/grafica_BER_AC2.png`.\n\n---\n\n## 📊 Results\n\nThe script produces a **log-log BER curve** comparing the two codes:\n\n* **Hamming (7,4)** → blue line\n* **Linear (5,2)** → red line\n\nThe plot visually shows how each code performs as channel error probability increases.\n\n![BER Results](docs/assets/grafica_BER_AC2.png)\n\n---\n\n## 📖 Theoretical Background\n\n### Hamming (7,4) Code\n\n* Parameters: (n=7, k=4)\n* Minimum distance: d\\_min = 3\n* Error detection: up to 2 errors per word\n* Error correction: up to 1 error per word\n\n### General Linear (5,2) Code\n\n* Parameters: (n=5, k=2)\n* Minimum distance: d\\_min = 3\n* Error detection: up to 2 errors per word\n* Error correction: up to 1 error per word\n\nDespite both having the same theoretical minimum distance, their performance differs due to structure and redundancy.\n\n---\n\n## 🔍 Discussion\n\n* The **linear (5,2) code** showed slightly better BER performance than Hamming (7,4) in this simulation.\n* This suggests that efficiency depends not only on minimum distance, but also on code structure and redundancy.\n* Hamming codes remain widely used in hardware implementations due to their standardization and ease of decoding.\n\n---\n\n## 📚 What I Learned\n\nThrough this project I gained experience in:\n\n* MATLAB programming for digital communications.\n* Simulation of linear block codes and error correction.\n* Working with the Communications Toolbox functions (`encode`, `decode`, `syndtable`, `bsc`, `biterr`).\n* Evaluating coding efficiency in terms of redundancy and BER.\n* Structuring academic code into a professional repository format.\n\n---\n\n## 📜 License\n\nThis project is released under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertomarquillas%2Fblock-codes-ber-matlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbertomarquillas%2Fblock-codes-ber-matlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertomarquillas%2Fblock-codes-ber-matlab/lists"}