How to create a FRF graph of the real and imaginary parts of a signal

64 views (last 30 days)
Hello,
I ran a hammer test on a structure that gave me acceleration and force data. I know MATLAB has an inbuilt function, modalfrf, that outputs a FRF in terms of magnitude and phase, but I'm trying to get FRF plots in terms of the real and imaginary parts of the data. Does anyone know how I would go about getting this?
As a bonus question, I know from the modalfrf plot that I can pick out natural frequencies. Is there a way for me to get matlab to calculate the damping ratio of the specific natural frequencies I want?
Thank you so much for your time!

Accepted Answer

Star Strider
Star Strider on 31 Oct 2023
It appears that is its default behaviour if you request outputs —
load modaldata
figure
subplot(2,1,1)
plot(thammer,Xhammer(:))
ylabel('Force (N)')
subplot(2,1,2)
plot(thammer,Yhammer(:))
ylabel('Displacement (m)')
xlabel('Time (s)')
winlen = size(Xhammer,1);
figure
modalfrf(Xhammer(:),Yhammer(:),fs,winlen,'Sensor','dis')
[frf,f] = modalfrf(Xhammer(:),Yhammer(:),fs,winlen,'Sensor','dis');
figure
semilogy(f, real(frf), 'DisplayName','Real')
hold on
plot(f, imag(frf), 'DisplayName','Imag')
plot(f, abs(frf), 'DisplayName','Magnitude')
hold off
grid
legend('Location','best')
Warning: Negative data ignored
  2 Comments
Otto Randolph
Otto Randolph on 1 Nov 2023
Awesome, thank you so much! I had to change the graphs to not be log scale since there were negative data points but it worked!
Star Strider
Star Strider on 1 Nov 2023
Thank you! As always, my pleasure!
I completely understand. I debated on that, and finally decided on a logarithmic axis because I used an example from the documentation, and the default modalfrf plot it produces uses a logarithmic magnitude scale. (I used the logarithmic y-axis here to demonstrate that it produced the same plot.)

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!