close

Вход

Забыли?

вход по аккаунту

?

ко второй лабе

код для вставкиСкачать
ω=22∙3,14∙2=138,16 Візьмем C1* = C3 = 6 nF
С1 = С2 = 3 nF
R1 = R3
R1=R3=1/(138.16∙6∙〖10〗^(-9) F)=1/828.96∙〖10〗^9=1.2∙〖10〗^6 Ω k=C_1/(C_1^* )∙(1+R_5/R_4 )=1/2∙(1+60kΩ/100kΩ)=0.8 q=√((R_3 C_1^*)/(R_1 C_3 ))/(1+(C_1^*)/C_3 -(R_3 R_5)/(R_1 R_4 ))=1/(1+1-0.6)=0.71 poly
определение полинома
Последовательность вызова
p=poly(a,vname, ["flag"])
Аргументы
a
матрица или вещественной число
vname
Строка, имя символьной переменной. Если строка больше 4 символов, то из них учитываются только 4 первых.
"flag"
строка ("roots", "coeff"), значение по умолчанию "roots".
Описание
Если a -- матрица, то
p является характеристическим полиномом, то есть determinant(x*eye()-a), где x является символьной переменной.
Если v -- вектор, то
poly(v,"x",["roots"]) является полиномом с корнями roots, элементами v и "x" в качестве формальной переменной. (В этом случаеroots и poly являются обратными функциями). Заметьте, что бесконечные корни дают нулевые коэффициенты наивысшей степени.
poly(v,"x","coeff") создаёт полином с символом "x" и с коэффициентами, хранящимися в элементах v (v(1) -- постоянный член полинома). Здесь poly и coeff являются обратными функциями.
s=poly(0,"s") является семенем для определения полиномов с символом "s".
syslin
определение линейной системы
Последовательность вызова
[sl]=syslin(dom,A,B,C [,D [,x0] ])
[sl]=syslin(dom,N,D)
[sl]=syslin(dom,H)
Аргументы
dom
символьная строка ('c', 'd') или [] для скаляра.
A,B,C,D
матрицы в виде пространства состояний (D не обязательная матрица, по умолчанию - нулевая). Для сингулярных систем D является матрицей многочленов.
x0
вектор (исходное состояние; значение по умолчанию 0)
N, D
матрицы многочленов
H
матрица рациональных дробей или в виде линейного пространства состояний
sl
типизированный список (tlist) ("syslin" список), представляющий линейную систему
Описание
syslin определяет линейную систему в виде списка и проверяет правильность данных.
dom определяет временную область системы и может иметь следующие значения:
dom='c' для систем с непрерывным временем, dom='d' для систем с дискретным временем, n для дискретных систем с периодом дискретизации n (в секундах).
dom=[], если временная область не определена.
Repfreq - частотная хар-ка
frequency response
Calling Sequence
[ [frq,] repf]=repfreq(sys,fmin,fmax [,step])
[ [frq,] repf]=repfreq(sys [,frq])
[ frq,repf,splitf]=repfreq(sys,fmin,fmax [,step])
[ frq,repf,splitf]=repfreq(sys [,frq])
Arguments
sys
syslin list : SIMO linear system
fmin,fmax
two real numbers (lower and upper frequency bounds)
frq
real vector of frequencies (Hz)
step logarithmic discretization step
splitf vector of indexes of critical frequencies.
Repf vector of the complex frequency response
Description
repfreq returns the frequency response calculation of a linear system. If sys(s) is the transfer function of Sys, repf(k) equals sys(s) evaluated at s= %i*frq(k)*2*%pi for continuous time systems and at exp(2*%i*%pi*dt*frq(k)) for discrete time systems (dt is the sampling period).
db(k) is the magnitude of repf(k) expressed in dB i.e. db(k)=20*log10(abs(repf(k))) and phi(k) is the phase of repf(k) expressed in degrees.
If fmin,fmax,step are input parameters, the response is calculated for the vector of frequencies frq given by: frq=[10.^((log10(fmin)):step:(log10(fmax))) fmax];
If step is not given, the output parameter frq is calculated by frq=calfrq(sys,fmin,fmax).
Vector frq is split into regular parts with the split vector. frq(splitf(k):splitf(k+1)-1) has no critical frequency. sys has a pole in the range[frq(splitf(k)),frq(splitf(k)+1)] and no poles outside.
Bode - ЛАФЧХ
Bode plot
Calling Sequence
bode(sl,[fmin,fmax] [,step] [,comments] )
bode(sl,frq [,comments] )
bode(frq,db,phi [,comments])
bode(frq, repf [,comments])
Arguments
sl
syslin list (SISO or SIMO linear system) in continuous or discrete time.
fmin,fmax
real (frequency bounds (in Hz))
step
real (logarithmic step.)
comments
vector of character strings (captions).
frq
row vector or matrix (frequencies (in Hz) ) (one row for each SISO subsystem).
db
row vector or matrix ( magnitudes (in Db)). (one row for each SISO subsystem).
phi
row vector or matrix ( phases (in degree)) (one row for each SISO subsystem).
repf
row vector or matrix of complex numbers (complex frequency response).
Description
Bode plot, i.e magnitude and phase of the frequency response of sl.
sl can be a continuous-time or discrete-time SIMO system (see syslin). In case of multi-output the outputs are plotted with different symbols.
The frequencies are given by the bounds fmin,fmax (in Hz) or by a row-vector (or a matrix for multi-output) frq.
step is the ( logarithmic ) discretization step. (see calfrq for the choice of default value).
comments is a vector of character strings (captions).
db,phi are the matrices of modulus (in Db) and phases (in degrees). (One row for each response).
repf matrix of complex numbers. One row for each response.
Default values for fmin and fmax are 1.d-3, 1.d+3 if sl is continuous-time or 1.d-3, 0.5/sl.dt (nyquist frequency) if sl is discrete-time. Automatic discretization of frequencies is made by calfrq.
The
 datatipstool may be used to display data along the phase and modulus curves.
Examples
s=poly(0,'s')
h=syslin('c',(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01))
clf();bode(h,0.01,100);
s=poly(0,'s')
h1=syslin('c',(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01))
num=22801+4406.18*s+382.37*s^2+21.02*s^3+s^4;
den=22952.25+4117.77*s+490.63*s^2+33.06*s^3+s^4
h2=syslin('c',num/den);
clf();bode([h1;h2],0.01,100,['h1';'h2'])
Analpf - создание аналога фильтра
create analog low-pass filter
Calling Sequence
[hs,pols,zers,gain]=analpf(n,fdesign,rp,omega)
hs=analpf(n,fdesign,rp,omega)
Arguments
n
positive integer : filter order
fdesign
a string : that indicated the filter design method:
"butt" is for Butterworth filter.
"cheb1" is for Chebyshev type I filter.
"cheb2" is for Chebyshev type II filter (also called inverse Chebyshev filter).
"ellip" is for elliptic filter.
rp
a 2-vector of ripples values for "cheb1", "cheb2" and "ellip" filters. It's elements value must respect 0<rp(1),rp(2)<1.
For "cheb1" filters only rp(1) is used. The passband ripple is between 1-rp(1) and 1.
For "cheb2" filters only rp(2) is used. The stopband ripple is between 0 and rp(2).
For "ellip" filters rp(1) and rp(2) are both used. The passband ripple is between 1-rp(1) and 1 while the stopband ripple is between 0 and rp(2).
omega
cut-off frequency of low-pass filter in rd/s
hs
the rational polynomial transfer function (see syslin). Is is hs=gain*syslin("c",real(poly(zers,"s")), real(poly(pols,"s")))
pols
a row vector: the poles of transfer function
zers
a row vector: zeros of transfer function
gain
a scalar: the gain of transfer function
Description
This Creates analog low-pass filter with cut-off pulsation at omega. It is a driver over the zpbutt, zpch1, zpch2 and zpell functions.
The Butterworth filter has no ripples in the passband and slowly rolls off towards zero in the stopband. Butterworth filters have a monotonically changing magnitude function with omega, unlike other filter types that have non-monotonic ripple in the passband and/or the stopband. Butterworth filters have a more linear phase response in the pass-band than the others.
Chebyshev filters have a steeper roll-off and more passband ripple (type I) or stopband ripple (type II) than Butterworth filters. Chebyshev filters have the property that they minimize the error between the idealized and the actual filter characteristic over the range of the filter, but with ripples in the passband.
Elliptic filter have equalized ripple behavior in both the passband and the stopband. The amount of ripple in each band is independently adjustable, and no other filter of equal order can have a faster transition in gain between the passband and the stopband, for the given values of ripple.
Examples
//Evaluate magnitude response of the filter
fcut=5; //hz
n=7;//filter order
hc1=analpf(n,'cheb1',[0.1 0],fcut*2*%pi);
hc2=analpf(n,'cheb2',[0 0.1],fcut*2*%pi);
he=analpf(n,'ellip',[0.1 0.1],fcut*2*%pi);
hb=analpf(n,'butt',[0 0],fcut*2*%pi);
hc1.dt='c';hc2.dt='c';he.dt='c';hb.dt='c';
clf();
[fr, hf]=repfreq(hc1,0,15);
plot(fr,abs(hf),'b')
[fr, hf]=repfreq(hc2,0,15);
plot(fr,abs(hf),'y')
[fr, hf]=repfreq(he,0,15);
plot(fr,abs(hf),'r')
[fr, hf]=repfreq(hb,0,15);
plot(fr,abs(hf),'c')
legend(["Chebyshev I","Chebyshev II","Elliptic","Butterworth"]);
xgrid()
xlabel("Frequency (Hz)")
ylabel("Gain")
title("Analog filters of order 7")
dbphi
frequency response to phase and magnitude representation
Calling Sequence
[db,phi] =dbphi(repf)
Arguments
db,phi
vector of gains (db) and phases (degrees)
repf
vector of complex frequency response
Description
db(k) is the magnitude of repf(k) expressed in dB i.e. db(k)=20*log(abs(repf(k)))/log(10) and phi(k) is the phase of repf(k) expressed in degrees.
Документ
Категория
Рефераты
Просмотров
30
Размер файла
80 Кб
Теги
второй, лабе
1/--страниц
Пожаловаться на содержимое документа