Main Content


Frequency response of rational object and rationalfit function object



[response, outputfreq] = freqresp(fit,inputfreq) calculates the frequency response, response of the fit of a rationalfit function object or a rational object at the specified input frequencies, inputfreq.


collapse all

Create a sparameters object from a file and use rfparam to extract the S21parameters.

S = sparameters('passive.s2p');
S21 = rfparam(S,2,1);

Fit a rational function to the data by using rationalfit.

freq = S.Frequencies;
fit_data = rationalfit(freq,S21);

Compute the frequency response by using the freqresp method and plot the magnitude and angle of the frequency response.

[resp,freq] = freqresp(fit_data,freq);


Input Arguments

collapse all

N-by-N array, specified as a a rfmodel.rational objects returned by rationalfit or a rational object.

Input frequencies, specified as a vector of positive frequencies in Hz.

Data Types: double

Output Arguments

collapse all

Frequency response values, returned as a vector.

Frequency values same as input frequencies, returned as a vector.

Introduced before R2006a