You are here : matlabSignal Processingfreqs

freqs() - Signal Processing

freqs returns the complex frequency response H(jω)
(Laplace transform) of an analog filterH(s)=B(s)A(s)=b(1)sn+b(2)sn−1+⋯+b(n+1)a(1)sm+a(2)sm−1+⋯+a(m+1)given the numerator and denominator coefficients in vectors b and a. h = freqs(b,a,w) returns the
complex frequency response of the analog filter specified by coefficient
vectors b and a. freqs evaluates
the frequency response along the imaginary axis in the complex plane
at the angular frequencies in rad/s specified in real vector w,
where w is a vector containing more than one frequency.[h,w] = freqs(b,a,n) uses n frequency
points to compute the frequency response, h, where n is
a real, scalar value. The frequency vector w is
auto-generated and has length n. If you omit n as
an input, 200 frequency points are used. If you do not need the generated
frequency vector returned, you can use the form h = freqs(b,a,n) to
return only the frequency response, h.freqs with no output arguments
plots the magnitude and phase response versus frequency in the current
figure window.freqs works only for real input systems and
positive frequencies.


h = freqs(b,a,w)[h,w] = freqs(b,a,n)freqs


Frequency Response from the Transfer FunctionOpen This Example
Find and graph the frequency response of the transfer function

a = [1 0.4 1];
b = [0.2 0.3 1];
w = logspace(-1,1);

You can also compute the results and use them to generate the plots.h = freqs(b,a,w);
mag = abs(h);
phase = angle(h);
phasedeg = phase*180/pi;

subplot(2,1,1), loglog(w,mag), grid on
xlabel 'Frequency (rad/s)', ylabel Magnitude
subplot(2,1,2), semilogx(w,phasedeg), grid on
xlabel 'Frequency (rad/s)', ylabel 'Phase (degrees)'

Frequency Response of a Lowpass Analog Bessel FilterOpen This Example
Design a 5th-order analog lowpass Bessel filter with an approximately constant group delay up to 
 rad/s. Plot the frequency response of the filter using freqs.
[b,a] = besself(5,10000);   % Bessel analog filter design
freqs(b,a)                  % Plot frequency response

Output / Return Value


Alternatives / See Also