This repository contains compact, verification-driven Digital Signal Processing projects focused on algorithm design, reference modeling, C/C++ implementation, numerical validation, and performance benchmarking.
The repository currently contains two active projects:
- FFT and Spectrum Analyzer
- FIR, IIR, and Fixed-Point Digital Filters
MATLAB and Python are used as reference models. C and C++ are used for efficient, embedded-oriented, and real-time-oriented implementations.
Ongoing portfolio- currently under active development
The repository structure and project documentation have been created. Source code, deterministic tests, reference vectors, benchmark results, plots, and technical reports will be added progressively.
No project should be considered complete until:
- the mathematical model is documented;
- the MATLAB or Python reference model is implemented;
- the C or C++ implementation is available;
- deterministic tests pass;
- numerical differences remain within defined tolerances;
- runtime and memory results are reported;
- limitations are documented.
| No. | Project | Main Technical Focus | Current Status |
|---|---|---|---|
| 01 | FFT and Spectrum Analyzer | Direct DFT, radix-2 FFT, bit-reversal, windowing, spectral analysis, PSD, peak detection, and benchmarking | Ongoing- design and documentation in progress |
| 02 | FIR, IIR, and Fixed-Point Filters | FIR/IIR design, biquads, circular buffers, Q15/Q31 arithmetic, quantization, saturation, stability, and benchmarking | Ongoing- design and documentation in progress |
Design, implement, and verify a radix-2 FFT and windowed spectrum analyzer using:
- MATLAB as the primary mathematical reference;
- Python as an independent numerical reference;
- C++ as the main implementation language.
- direct DFT reference implementation;
- radix-2 decimation-in-time FFT;
- iterative butterfly processing;
- bit-reversal permutation;
- forward FFT;
- inverse FFT;
- rectangular, Hann, Hamming, and Blackman windows;
- single-sided and double-sided spectra;
- magnitude and phase spectra;
- power spectrum;
- power spectral density;
- frequency-axis generation;
- peak-bin and peak-frequency detection;
- Parseval energy verification;
- runtime and memory benchmarking.
For an input sequence x[n] of length N:
X[k] = sum from n = 0 to N - 1 of:
x[n] * exp(-j * 2 * pi * k * n / N)
The inverse transform is:
x[n] = (1/N) * sum from k = 0 to N - 1 of:
X[k] * exp(j * 2 * pi * k * n / N)
The butterfly outputs are:
Y0 = A + W_N^k * B
Y1 = A - W_N^k * B
with:
W_N^k = exp(-j * 2 * pi * k / N)
For sampling frequency Fs and FFT length N:
Delta_f = Fs / N
- Project folder created
- Project scope defined
- Initial README created
- GitHub-compatible equation formatting defined
- MATLAB direct DFT implemented
- MATLAB radix-2 FFT implemented
- Python direct DFT implemented
- Python radix-2 FFT implemented
- C++ radix-2 FFT implemented
- Bit-reversal verification completed
- FFT/IFFT round-trip test completed
- Window functions implemented
- Spectrum analyzer implemented
- Peak detector implemented
- MATLAB comparison completed
- NumPy comparison completed
- Parseval test completed
- Runtime benchmarks completed
- Memory analysis completed
- Final figures and report completed
Design, implement, and verify floating-point and fixed-point FIR and IIR filters using:
- MATLAB for filter design and reference analysis;
- Python for independent verification;
- C for fixed-point and embedded-oriented implementation;
- C++ for reusable floating-point and fixed-point filter modules.
- FIR low-pass and high-pass filters;
- direct-form FIR;
- circular-buffer FIR;
- IIR biquad filters;
- Direct Form I;
- Direct Form II Transposed;
- cascaded second-order sections;
- Q15 arithmetic;
- optional Q31 arithmetic;
- coefficient quantization;
- accumulator-width analysis;
- rounding and truncation;
- saturation arithmetic;
- overflow monitoring;
- IIR pole-stability verification;
- limit-cycle analysis;
- runtime and memory benchmarking.
For an FIR filter of order M:
y[n] = sum from k = 0 to M of:
b[k] * x[n - k]
where:
x[n]is the input sample;y[n]is the output sample;b[k]is FIR coefficientk;M + 1is the number of taps.
A general IIR filter is:
y[n] =
sum from k = 0 to M of b[k] * x[n - k]
-
sum from r = 1 to N of a[r] * y[n - r]
A second-order IIR section is:
y[n] =
b0 * x[n]
+ b1 * x[n - 1]
+ b2 * x[n - 2]
- a1 * y[n - 1]
- a2 * y[n - 2]
A Q15 integer represents a real value as:
real_value = stored_integer / 2^15
The approximate range is:
-1.0 <= value <= 1.0 - 2^(-15)
The quantization step is:
Delta = 2^(-15)
Floating-point to Q15 conversion:
q15_integer = round(real_value * 2^15)
The integer is then saturated to:
-32768 to 32767
Q15 * Q15 -> Q30 intermediate result
The result is returned to Q15 using a right shift:
output_q15 = product_q30 >> 15
Rounding and saturation will be handled explicitly.
A stable causal IIR filter requires:
Magnitude of every pole < 1
The floating-point and quantized pole locations will both be checked.
- Project folder created
- Project scope defined
- Initial README created
- GitHub-compatible equation formatting defined
- MATLAB FIR design implemented
- MATLAB IIR design implemented
- Python FIR model implemented
- Python IIR model implemented
- C Q15 FIR implemented
- C Q15 biquad implemented
- C++ floating-point FIR implemented
- C++ circular-buffer FIR implemented
- C++ biquad implementation completed
- Coefficient quantization implemented
- Saturation arithmetic implemented
- Overflow monitoring implemented
- FIR impulse-response test completed
- FIR frequency-response test completed
- IIR impulse-response test completed
- Quantized-pole stability test completed
- Fixed-point accuracy test completed
- Limit-cycle test completed
- MATLAB cross-verification completed
- Python cross-verification completed
- Runtime benchmarks completed
- Memory analysis completed
- Final figures and report completed
Each project follows the same development workflow.
- Define the engineering problem.
- Write the mathematical model.
- Define dimensions, units, normalization, and numerical conventions.
- Implement a MATLAB reference model.
- Implement an independent Python model.
- Implement the main C or C++ version.
- Generate deterministic input vectors.
- Compare stage-by-stage outputs.
- Add unit and regression tests.
- Measure numerical error.
- Measure runtime and memory use.
- Generate result figures and benchmark tables.
- Document limitations and future improvements.
| Language | Main Role |
|---|---|
| MATLAB | Mathematical modeling, reference calculations, filter design, signal generation, and verification |
| Python | Independent reference implementation, automated analysis, plotting, and test support |
| C | Fixed-point and embedded-oriented DSP implementation |
| C++ | Main reusable DSP implementation, benchmarking, and software architecture |
The projects will not rely only on visually reasonable plots.
Verification will include:
- deterministic test vectors;
- fixed random seeds where random data are used;
- analytical test cases;
- sample-by-sample reference comparison;
- maximum absolute error;
- RMS error;
- relative error;
- frequency-response comparison;
- Parseval energy checking;
- FFT/IFFT round-trip checking;
- FIR impulse-response checking;
- IIR stability checking;
- saturation and overflow monitoring;
- fixed-point output-SNR analysis;
- runtime and memory benchmarking.
Maximum absolute error =
maximum of abs(output_implementation - output_reference)
RMS error =
sqrt(
sum((output_implementation - output_reference)^2)
/
number of samples
)
Relative error =
norm(output_implementation - output_reference)
/
norm(output_reference)
MSE =
sum(abs(reference[n] - estimate[n])^2)
/
number of samples
error[n] = fixed_output[n] - reference_output[n]
Output SNR in dB =
10 * log10(
sum(reference_output[n]^2)
/
sum(error[n]^2)
)
DSP-Algorithm-Design-and-Implementation/
├── README.md
├── 01_fft_and_spectrum_analyzer/
│ ├── README.md
│ ├── matlab/
│ ├── python/
│ ├── cpp/
│ ├── tests/
│ ├── benchmarks/
│ └── results/
└── 02_fir_iir_fixed_point_filters/
├── README.md
├── matlab/
├── python/
├── c/
├── cpp/
├── tests/
├── benchmarks/
└── results/
Only the two current project folders are shown because they are the projects presently created in this repository.
| Folder | Purpose |
|---|---|
matlab/ |
MATLAB reference models |
python/ |
Independent Python verification models |
c/ |
C fixed-point and embedded-oriented implementation |
cpp/ |
Main C++ implementation |
tests/ |
Unit, regression, and deterministic-vector tests |
benchmarks/ |
Runtime, memory, and complexity measurements |
results/ |
Figures, CSV files, logs, tables, and reports |
Planned use includes:
- signal generation;
- direct DFT and FFT reference;
- filter design;
- frequency-response analysis;
- impulse and step responses;
- pole-zero analysis;
- reference-vector generation;
- result plotting.
Expected packages include:
NumPy
SciPy
Matplotlib
pandas
pytest
Planned tools include:
C11 or later
C++17 or later
CMake
GCC
Clang
Microsoft Visual C++
CTest or another unit-test framework
The implementations will follow these principles:
- use clear input and output contracts;
- validate array and buffer sizes;
- avoid unnecessary allocation inside processing loops;
- separate reference code from optimized code;
- use deterministic tests;
- define numerical tolerances before accepting results;
- use fixed-width integer types for fixed-point processing;
- apply saturation intentionally;
- record overflow and saturation events;
- preserve exact source filenames after build and import dependencies are created;
- measure performance before optimization.
Each project will report relevant measurements such as:
- execution time;
- samples processed per second;
- operations per sample;
- memory consumption;
- temporary-buffer use;
- floating-point versus fixed-point error;
- direct versus optimized implementation speed;
- reference versus C/C++ implementation speed.
Benchmark conditions will be documented so the results can be reproduced.
- Repository created
- Root README prepared
- Project 01 folder created
- Project 01 README prepared
- Project 02 folder created
- Project 02 README prepared
- Root equation formatting converted to GitHub-compatible plain text
- Project status added for both active projects
- Project 01 source implementation completed
- Project 01 verification completed
- Project 01 benchmark results added
- Project 02 source implementation completed
- Project 02 verification completed
- Project 02 benchmark results added
- Automated test workflow added
- Stable release prepared
Additional projects may be added after the first two projects are implemented and verified.
Possible future projects include:
03_polyphase_sample_rate_converter
04_lms_nlms_adaptive_noise_canceller
05_timing_and_frequency_synchronization
06_streaming_iq_dsp_pipeline
These projects are planned ideas and are not currently presented as active repository contents.
After completion, this repository is expected to demonstrate:
- Digital Signal Processing;
- DFT and FFT implementation;
- spectrum analysis;
- FIR filter design;
- IIR filter design;
- fixed-point arithmetic;
- coefficient quantization;
- saturation and overflow handling;
- IIR stability analysis;
- MATLAB modeling;
- Python verification;
- C implementation;
- C++ implementation;
- CMake;
- unit and regression testing;
- numerical cross-verification;
- runtime profiling;
- memory-aware design;
- technical documentation.
Open the relevant project folder and read its README.md.
Each project README describes:
- project objective;
- mathematical model;
- planned algorithms;
- implementation structure;
- verification tests;
- benchmark plan;
- development status;
- limitations;
- build and execution instructions.
The projects are not yet complete executable releases. Final run instructions will be added after the corresponding source implementations are available and verified.
A repository license will be selected before the source code is released as a stable package.
Until a LICENSE file is added, this repository should be treated as:
All rights reserved
Md Moklesur Rahman
Wireless/RF/PHY and DSP System Engineer
Finland
This repository contains ongoing engineering projects.
Features marked as planned have not yet been presented as completed or verified. Source code, tests, benchmarks, figures, and documentation will be updated progressively as development continues.