Effacer les filtres
Effacer les filtres

Frequency response from a transfer function?

162 vues (au cours des 30 derniers jours)
Ali Almakhmari
Ali Almakhmari le 18 Sep 2023
Commenté : Ali Almakhmari le 18 Sep 2023
I have the following transfer function:
And I want to plot its frequency response but I am not sure how to do it. I hope someone can help

Réponses (2)

Star Strider
Star Strider le 18 Sep 2023
I assume you intend a bode or bodeplot plot —
s = tf('s');
G = exp(-s)/(2*s+1)
G = 1 exp(-1*s) * ------- 2 s + 1 Continuous-time transfer function.
figure
bodeplot(G)
grid
See the documentation I linked to, as well as the tf function, for details.
.

Dyuman Joshi
Dyuman Joshi le 18 Sep 2023
Use freqs. Note - Requires the Signal Processing Toolbox.
Refer to the documentation page linked above for more info.
help freqs
FREQS Laplace-transform (s-domain) frequency response. H = FREQS(B,A,W) returns the complex frequency response vector H of the filter B/A: nb-1 nb-2 B(s) b(1)s + b(2)s + ... + b(nb) H(s) = ---- = ------------------------------------- na-1 na-2 A(s) a(1)s + a(2)s + ... + a(na) given the numerator and denominator coefficients in vectors B and A. The frequency response is evaluated at the points specified in vector W (in rad/s). The magnitude and phase can be graphed by calling FREQS(B,A,W) with no output arguments. [H,W] = FREQS(B,A) automatically picks a set of 200 frequencies W on which the frequency response is computed. FREQS(B,A,N) picks N frequencies. % Example 1: % Find and graph the frequency response of the transfer function % given by % H(s) = ( 0.2*s^2 + 0.3*s + 1 )/( s^2 + 0.4s + 1 ) a = [1 0.4 1]; % Numerator coefficients b = [0.2 0.3 1]; % Denominator coefficients w = logspace(-1,1); % Frequency vector freqs(b,a,w) % Example 2: % Design a fifth-order analog lowpass Bessel filter with an % approximate constant group delay up to 10,000 rad/s and plot % the frequency response of the filter using freqs. [b,a] = besself(5,10000); % Bessel analog filter design freqs(b,a) % Plot frequency response See also LOGSPACE, POLYVAL, INVFREQS, and FREQZ. Documentation for freqs doc freqs
  1 commentaire
Ali Almakhmari
Ali Almakhmari le 18 Sep 2023
I think this is exactly what I am looking for. But I am not sure if I can use this command with e^-s in my numerator of the transfer function.

Connectez-vous pour commenter.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by