Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

VHDL + MATLAB: I/Q Signal Reader/Writer Testbench

This repository provides a practical testbench setup to simulate I/Q (In-phase and Quadrature) signal handling between VHDL and MATLAB.
It includes:

  • πŸ“‚ VHDL: File-based I/Q signal reader and writer with generic configurability.
  • πŸ“‚ Matlab: Scripts to load and save I/Q data as complex arrays compatible with the VHDL format.

πŸ“ Folder Structure

/VHDL
β”œβ”€β”€ file_reader.vhd -- Reads I/Q from text (I0, Q0, I1, Q1...)
β”œβ”€β”€ file_writer.vhd -- Writes I/Q to text (one value per line)
└── tb_reader_writer.vhd -- Testbench connecting reader & writer

/Matlab
β”œβ”€β”€ read_complex_from_txt.m -- Load text file into complex array
└── write_complex_to_txt.m -- Save complex array to text file


πŸ”„ Workflow Overview

  1. Write I/Q data in MATLAB using write_complex_to_txt.m
  2. Read it in VHDL with file_reader.vhd
  3. Process it or loop it through your DUT
  4. Write back in VHDL using file_writer.vhd
  5. Read results in MATLAB using read_complex_from_txt.m

βš™οΈ Features

  • Generic DATA_WIDTH and file paths in VHDL
  • Fully synthesizable VHDL (suitable for simulation)
  • Interval-based reading (e.g., read every N clock cycles)
  • MATLAB-compatible text format (I followed by Q line-by-line)

πŸ“Œ Example Format (text file)

100
-50
200
-25

β†’ Represents:

[100 - 50i, 200 - 25i]  

πŸ“¬ Contact

Questions, improvements, or contributions are welcome! This setup is ideal for DSP testbenches, RF simulations, or I/Q streaming verification.

Let me know if you want to add:

  • License
  • Screenshots (e.g., waveform or MATLAB plots)
  • A badge for simulator/tool support

This version keeps it simple but highly useful for engineers and students alike πŸš€.


πŸ‘€ Authors

  • Milad Mohammadi.B – VHDL and MATLAB design, simulation setup
  • ChatGPT (OpenAI) – Assisted with code generation, explanation, and documentation

About

This repository provides a practical testbench setup to simulate I/Q (In-phase and Quadrature) signal handling between VHDL and MATLAB...

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages