If you have a data set and want to find an estimated experimental transfer function between two variables in the set, you can have MATLAB come up with a transfer function estimate using the tfestimate command. %% Circuit constants R = 10000 C = 22e-9 %% Set up transfer function % Create "s" as a transfer function for use later s = tf ( 's' ) % Use s to generate transfer function for circuit H = ( s * R * C ) / ( s * R * C + 1 ) % Generate list of frequencies must use angular frequencies in bode command F = logspace ( 1, 5, 1000 ) Omega = 2 * pi * F % Use bode command to analyze transfer function = bode ( H, Omega ) HMag = squeeze ( HMag ) HPhase = squeeze ( HPhase ) %% Make plot figure ( 1 ) clf % Magnitude plot on top subplot ( 2, 1, 1 ) semilogx ( HOmega, 20 * log10 ( HMag ), 'k-' ) xlabel ( '\omega, rad/s' ) ylabel ( '|H|, dB' ) % Phase plot on bottom subplot ( 2, 1, 2 ) semilogx ( HOmega, HPhase, 'k-' ) xlabel ( '\omega, rad/s' ) ylabel ( '\angle H, rad' ) Estimates from Time Series Data
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |