File Exchange

image thumbnail

Frequency Response Measurement with Matlab

version (29.6 KB) by Hristo Zhivomirov
Frequency response measurement of a two-port circuit with NI USB-6211.


Updated 07 Apr 2019

View Version History

View License

The code presented here concerns the frequency response measurement of a two-port circuit with DAQ-system NI USB-6211. The measurement is based on the Discrete Fourier Transform (DFT) and Maximum Likelihood estimation (MLE) of the amplitude and phase of the input and output voltage the two-port circuit, respectively. Then the frequency response modulus and phase is calculated. The excitation of the device under test is performed via single-tone sine wave signal with stepwise increasing frequency. The code provides:
1) a plot of the frequency response (modulus and phase) of the two-port circuit;
2) data.txt file with the measurement results (for post-processing).

The code is based on the theory described in:

[1] H. Zhivomirov, I. Iliev. Impedance Frequency Response Measurement with Matlab Implementation. Journal of the Technical University of Gabrovo, ISSN: 1310-6686, Vol. 52, pp. 61-65, 2016. (

[2] NI USB-621x Specifications.pdf. Austin, National Instruments, Corp., 2009.

Cite As

Hristo Zhivomirov (2020). Frequency Response Measurement with Matlab (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!