# 程序代写案例-ECE 626

ECE 626 Project
Rishi Gupta
School of Electrical Engineering and
Computer Science
Oregon State University
Matlab
Fs=10MHz
DC ga
in=0db
Fp=0~1MHz
1. Declare and analog filter. I set the cutoff to 5MHz (random choice).
[num,den]=butter(2,5e6,'low','s');
H=tf(num,den)
bode(H);
2. Transfrom to z-domain using impulse invariance method.
[numz,denz]=impinvar(num,den,10e6);
Hz=tf(numz,denz,100e-9)
3. Observe the discrete time charecteristics. Fvtool plots everything, I’ve olny
shown magnitude response and pole zero plot.
hz=fvtool(numz,denz);
Magnitude Response
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
-26.4637
-23.7631
-21.0624
-18.3618
-15.6612
-12.9606
-10.26
-7.5594
-4.8588
-2.1581
0.5425
M
a
g
n
it
u
d
e
(
d
B
)
Magnitude Response (dB) Normalized Frequency: 0
Magnitude (dB): -0.182093
Pole-Zero Plot
-1.5 -1 -0.5 0 0.5 1 1.5 2
-1.0997
-0.8798
-0.6598
-0.4399
-0.2199
0
0.2199
0.4399
0.6598
0.8798
1.0997
Real Part
Pole/Zero Plot
Im
a
g
in
a
ry
P
a
rt
Converting TF to circuit.
Transfer function:
0.1719 z
Hz= ---------------------------
z^2 - 1.318 z + 0.4931
Sampling time: 1e-007
* Refer to page 418 of Johns Martin on how to do this, DO NOT BLINDLY
GET THE COIFICENTS. Work it out yourself to make sure.
The Fully Differential Circuit
Making an Ideal Switch
• analogLib-> switch (relay line)
• Set a threshold of VDD/2
• Bypass cap added to aid with
convergence.
Making an Ideal OPAMP
• analogLib-> dependant sources -> vcvs
Simulating the Frequency Response
• Click on the vsource and set all
the options.
Simulating the Frequency Response
• Go to the Analog enviorment.
Simulating the Frequency Response
• Set the PAC analysis like the following.
• Make sure the stop frequency is Fs/2
Simulating the Frequency Response
• From the Analog Enviorment click on
AC TRAN DC Button, and pick PSS
and phi2 show up. The will be at your
sampling frequency.
• Always select conservative for most
accurate results.
Simulating the Frequency Response
• Make sure your PSS window looks like this.
Simulating the Frequency Response
• Change to the PAC option.
• Under select make sure you change it to differential
Simulating the Frequency Response
Simulating the Frequency Response

Email:51zuoyejun

@gmail.com