How to calculate the norm of the transfer function in frequency domain?

To calculate the norm of the transfer function by substituting s=jω is troublesome, especially for some complicated transfer functions. Is there a way to calculate the norm directly? Thanks!
For example, transfer funciton:
Substituting s=jω,
then,
Thus we can plot the figure in frequency domain,
Matlab code:
omega=0:0.01:10;
G1_N=0.25e-2 .* omega .^ 2 + 0.1e1;
G1_D=((2 .* omega) - 0.15e0 .* (omega .^ 3)) .^ 2 + (0.1e1 + 0.5e-2 .* (omega .^ 4) - (omega .^ 2)) .^ 2;
G1=sqrt(G1_N ./ G1_D);
plot(omega,G1)

 Accepted Answer

You don't need to multiply the function by its complex conjugate to get a purely real denominator. Just divide complex numerator by the complex denominator, to get a new complex number, and take the abs() of it.

3 Comments

@Cola, in this case you have
Therefore I can write matlab code (without doing any more algebraic manipulaitons):
omega=0:0.01:10;
s=1i*omega;
G1=(-0.05*s-1)./(.005*s.^4+.15*s.^3+s.^2+2*s+1);
semilogx(omega,abs(G1),'-bx'); grid on
Try it.
@William Rose Thank you so much.
@Cola, you're welcome, and good luck with your work.

Sign in to comment.

More Answers (1)

Check out
doc tf
to learn how to create a transfer function (tf) object. Once you have G(s) defined as a tf object use bode() to compute its magnitude (and phase if desired)
doc bode

3 Comments

@Paul is right that bode() and other functions in the system identification toolbox have great capabilities.
Iy you want a quick phase plot without using the toolbox, you can use the same simple approach that I mentioned for the magnitude plot:
omega=0.01:0.01:100;
s=1i*omega;
G=(-0.05*s-1)./(.005*s.^4+.15*s.^3+s.^2+2*s+1); %transfer function
subplot(211), semilogx(omega,abs(G),'-bx'); grid on
ylabel('Magnitude |G(\omega)|');
subplot(212), semilogx(omega,angle(G),'-bx'); grid on
xlabel('Frequency \omega'); ylabel('Phase \Phi(G(\omega)) (radians)');
Actually, I was thinking of the Control System Toolbox. I'm not famiiar with the System ID toolbox.
If just wanting to use base Matlab, I'd probably use polyval().
@Paul @William Rose Thanks to you. And we also can use the order 'freqs' to calculate the norm.

Sign in to comment.

Asked:

on 13 Mar 2022

Commented:

on 14 Mar 2022

Community Treasure Hunt

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

Start Hunting!