Frequency Response Analysis in MATLAB

MATLAB Illustration

Frequency Response Plots in MATLAB

Frequency response analysis shows how a system (LTI system, filter, amplifier, etc.) responds to different input frequencies. Key plots: Bode plot (magnitude & phase vs. frequency), Nyquist plot (complex plane), Nichols plot.

Key Functions

  • bode(): Bode plot (mag/phase in dB/degrees vs. log frequency).
  • nyquist(): Polar plot of G(jω) in complex plane.
  • nichols(): Nichols chart (mag in dB vs. phase).
  • freqz(): For digital filters (discrete-time).
  • margin(): Stability margins (gain/phase margins).

Basic Steps

  1. Define System: Transfer function sys = tf([1 2], [1 3 2]) or state-space.
  2. Plot: bode(sys); grid on;.
  3. Customize: Set frequency range, labels, limits.
  4. Analyze: Read bandwidth, resonance peaks, phase margins.

Example Code

% Define a second-order system (low-pass filter)  num = [1]; den = [1 2 50]; % ω_n = 7.07 rad/s, ζ = 0.141  sys = tf(num, den);    % Bode plot  figure; bode(sys); grid on;  title('Frequency Response: Bode Plot');  xlabel('Frequency (rad/s)');    % Or manual control  [mag, phase, w] = bode(sys);  figure;   subplot(2,1,1); semilogx(w, 20*log10(squeeze(mag))); grid on;   ylabel('Magnitude (dB)'); title('Bode Plot');  subplot(2,1,2); semilogx(w, squeeze(phase)); grid on;   ylabel('Phase (deg)'); xlabel('Frequency (rad/s)');

For Digital Filters

% FIR/IIR filter  b = fir1(30, 0.3); a = 1; % 30-tap FIR low-pass  [h, f] = freqz(b, a, 512, 1000); % fs = 1kHz  figure; plot(f, 20*log10(abs(h))); grid on;  title('Digital Filter Frequency Response');  xlabel('Frequency (Hz)'); ylabel('Magnitude (dB)');
 
 

Applications

  • Control systems: Stability, bandwidth analysis.
  • Filters: Cutoff frequency, roll-off verification.
  • Amplifiers: Gain flatness, phase shift.
  • Power electronics: Converter transfer functions.

Pro Tips: Use bodemag(), bodephase() for separate plots. Add rlocus() for root locus comparison. Always check units (rad/s vs Hz).

What Our Students Say

★★★★★

“I got full marks on my MATLAB assignment! The solution was perfect and delivered well before the deadline. Highly recommended!”

Aditi Sharma, Mumbai
★★★★☆

“Quick delivery and excellent communication. The team really understood the problem and provided a great solution. Will use again.”

John M., Australia

Latest Blogs

Explore how MATLAB Solutions has helped clients achieve their academic and research goals through practical, tailored assistance.

Most Trending Topics in MATLAB Simulation in 2026

MATLAB and Simulink continue to be powerful tools for modeling, simulation, and system design across engineering domains. From electric vehicles to smart grids and AI-driven automation, MATLAB simulation is playing a critical role in modern research and industry ap

Multimodal AI Breakthroughs: Implementing Text + Image + Audio Models with MATLAB

Multimodal AI is one of the most exciting frontiers in artificial intelligence research today. In early 2026, multimodal models-systems that process and reason across text, images, audio, and eve