Plotting FRF with imaginary and real numbers

T
Teagan · Dec 4, 2020 · 2K views
Question
Hello, I have a file of all the FRF functions of an experiment, and it is computed in complex numbers + real part. I would like to know if it is possible to plot the graphic of it (resulting in the natural frequencies and stuff) only having this data? it is like this: -0.0915237963199616 + 0.00000000000000i -0.0666214004158974 - 0.0629538968205452i -0.0647708997130394 - 0.0962110981345177i 0.000384484999813139 - 0.189506992697716i 0.104717001318932 - 0.171706005930901i 0.145686000585556 - 0.117163002490997i 0.148408994078636 - 0.0817890018224716i 0.150115996599197 - 0.0637563988566399i 0.149434000253677 - 0.0457847006618977i 0.151601999998093 - 0.0343611985445023i 0.144703000783920 - 0.0156481992453337i 0.134606003761292 - 0.00748514989390969i 0.119563996791840 - 0.00314980000257492i and so on
Expert Answer
Profile picture of John Williams
John Williams PhD Expert
Answered Sep 11, 2026

Yes, it is entirely possible to plot the Frequency Response Function (FRF) using the provided complex number data. The FRF can be visualized in various ways, depending on the physical properties you're interested in. Typically, the magnitude and phase of the complex FRF data are plotted against frequency.


Steps to Plot the FRF:

  1. Extract Real and Imaginary Components:

    • Parse the complex number data into real and imaginary parts.
  2. Compute Magnitude and Phase:

    • The magnitude can be computed as: Magnitude=Real2+Imaginary2\text{Magnitude} = \sqrt{\text{Real}^2 + \text{Imaginary}^2}
    • The phase (in radians or degrees) can be computed as: Phase=arctan?2(Imaginary,Real)\text{Phase} = \arctan2(\text{Imaginary}, \text{Real})
  3. Plot the Results:

    • Magnitude Plot: Plot the magnitude against frequency.
    • Phase Plot: Plot the phase against frequency.
    • If you have the frequency vector, use it as the x-axis. If not, assume the points are evenly spaced.

Example MATLAB Code:

 

% Example FRF data (complex numbers)
FRF_data = [
    -0.0915237963199616 + 0.00000000000000i;
    -0.0666214004158974 - 0.0629538968205452i;
    -0.0647708997130394 - 0.0962110981345177i;
    0.000384484999813139 - 0.189506992697716i;
    0.104717001318932 - 0.171706005930901i;
    0.145686000585556 - 0.117163002490997i;
    0.148408994078636 - 0.0817890018224716i;
    0.150115996599197 - 0.0637563988566399i;
    0.149434000253677 - 0.0457847006618977i;
    0.151601999998093 - 0.0343611985445023i;
    0.144703000783920 - 0.0156481992453337i;
    0.134606003761292 - 0.00748514989390969i;
    0.119563996791840 - 0.00314980000257492i
];

% Frequency vector (assume evenly spaced if not provided)
num_points = length(FRF_data);
frequencies = linspace(0, 100, num_points); % Example frequency range (0 to 100 Hz)

% Compute magnitude and phase
magnitude = abs(FRF_data); % Compute magnitude
phase = angle(FRF_data);   % Compute phase (in radians)

% Plot the results
figure;
subplot(2, 1, 1);
plot(frequencies, magnitude, 'b-', 'LineWidth', 1.5);
title('FRF Magnitude');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
grid on;

subplot(2, 1, 2);
plot(frequencies, phase, 'r-', 'LineWidth', 1.5);
title('FRF Phase');
xlabel('Frequency (Hz)');
ylabel('Phase (radians)');
grid on;

Notes:

  1. Frequency Vector:

    • If you have the corresponding frequency values for each data point, use them.
    • If not, assume evenly spaced frequency values.
  2. Additional Plots:

    • You can also plot the real and imaginary parts separately if needed:

 

real_part = real(FRF_data);
imag_part = imag(FRF_data);
plot(frequencies, real_part, 'g', frequencies, imag_part, 'm');
legend('Real Part', 'Imaginary Part');
  1. Interpretation:

    • Peaks in the magnitude plot often correspond to natural frequencies.
    • Phase changes provide insight into the system's behavior near these frequencies.
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!