freqresp - Calculate frequency response of model object

Syntax

[resp,outfreq] = freqresp(h,infreq)

Description

[resp,outfreq] = freqresp(h,infreq) computes the frequency response, resp, of the rfmodel object, h, at the frequencies specified by freq.

The input h is the handle of a model object, and infreq is a positive vector of frequencies, in Hz, over which the frequency response is calculated.

The output argument outfreq is a vector that contains the same frequencies as the input frequency vector, in order of increasing frequency. The frequency response, resp, is a vector of frequency response values corresponding to these frequencies. It is computed using the analytical form of the rational function

where A, C, D, and Delay are properties of the rfmodel object, h.

Examples

The following example shows you how to compute the frequency response of the data stored in the file default.s2p by reading it into an rfdata object, fitting a rational function model to the data, and using the freqresp method to compute the frequency response of the model.

orig_data=read(rfdata.data,'default.s2p')
freq=orig_data.Freq;
data=orig_data.S_Parameters(2,1,:);
fit_data=rationalfit(freq,data)

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

plot(freq/1e9,db(resp));
figure
plot(freq/1e9,unwrap(angle(resp)));

See Also

rationalfit
rfmodel.rational
timeresp
writeva

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS