• API
• FAQ
• Tools
• Archive
Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

# Untitled

a guest Mar 13th, 2018 57 Never
ENDING IN00days00hours00mins00secs

1. clc
2. clear
3. %Part 1B
4. f1b= [5 10 20 40 60 70 80 90 100 200];
5. f1b= transpose(f1b);
6. f1b= f1b.*1000;
7.
8. vin1b= [];
9. vin1b= transpose(vin1b);
10.
11. vout1b= [];
12. vout1b= transpose(vout1b);
13.
14. p1b= [];
15. p1b= transpose(p1b);
16.
17. mag1b= 20.*log10(abs(vout1b./vin1b));
18.
19. figure(1)
20. plot(f1b, mag1b)
21. title('Magnitude vs. Frequency Bode Plot for Passive Low Pass Filter')
22. xlabel('Frequency (Hz)')
23. ylabel('Magnitude (dB)')
24.
25. figure(2)
26. plot(f1b, p1b)
27. title('Phase vs. Frequency Bode Plot for Passive Low Pass Filter')
28. xlabel('Frequency (Hz)')
29. ylabel('Phase (deg)')
30. %%
31. %Part 1D
32. f1d= [5 10 20 40 60 70 80 90 100 200];
33. f1d= transpose(f1d);
34. f1d= f1d.*1000;
35.
36. vin1d= [];
37. vin1d= transpose(vin1d);
38.
39. vout1d= [];
40. vout1d= transpose(vout1d);
41.
42. p1d= [];
43. p1d= transpose(p1d);
44.
45. mag1d= 20.*log10(abs(vout1d./vin1d));
46.
47. figure(3)
48. plot(f1d, mag1d)
49. title('Magnitude vs. Frequency Bode Plot for Passive High Pass Filter')
50. xlabel('Frequency (Hz)')
51. ylabel('Magnitude (dB)')
52.
53. figure(4)
54. plot(f1d, p1d)
55. title('Phase vs. Frequency Bode Plot for Passive High Pass Filter')
56. xlabel('Frequency (Hz)')
57. ylabel('Phase (deg)')
58. %%
59. %Part 2B
60. f2b= [100 200 400 600 800 1e3 2e3 4e3 6e3 8e3 10e3 20e3 40e3 60e3];
61. f2b= transpose(f2b);
62.
63. vin2b= [];
64. vin2b= transpose(vin2b);
65.
66. vout2b= [];
67. vout2b= transpose(vout2b);
68.
69. p2b= [];
70. p2b= transpose(p2b);
71.
72. mag2b= 20.*log10(abs(vout2b./vin2b));
73.
74. figure(5)
75. plot(f2b, mag2b)
76. title('Magnitude vs. Frequency Bode Plot for Active Low Pass Filter')
77. xlabel('Frequency (Hz)')
78. ylabel('Magnitude (dB)')
79.
80. figure(6)
81. plot(f2b, p2b)
82. title('Phase vs. Frequency Bode Plot for Active Low Pass Filter')
83. xlabel('Frequency (Hz)')
84. ylabel('Phase (deg)')
85. %%
86. %Part 2C
87. %300 mV
88. f2c300= [400 600 800 1e3 2e3 4e3 6e3 8e3 10e3 20e3 40e3 60e3];
89. f2c300= transpose(f2c300);
90.
91. vin2c300= [];
92. vin2c300= transpose(vin2c300);
93.
94. vout2c300= [];
95. vout2c300= transpose(vout2c300);
96.
97. p2c300= [];
98. p2c300= transpose(p2c300);
99.
100. mag2c300= 20.*log10(abs(vout2c300./vin2c300));
101.
102. figure(7)
103. plot(f2c300, mag2c300)
104. title('Magnitude vs. Frequency Bode Plot for Active High Pass Filter at 300 mV')
105. xlabel('Frequency (Hz)')
106. ylabel('Magnitude (dB)')
107.
108. figure(8)
109. plot(f2c300, p2c300)
110. title('Phase vs. Frequency Bode Plot for Active High Pass Filter at 300 mV')
111. xlabel('Frequency (Hz)')
112. ylabel('Phase (deg)')
113. %%
114. %Part 2C
115. %1 V
116. f2c1= [400 600 800 1e3 2e3 4e3 6e3 8e3 10e3 20e3 40e3 60e3];
117. f2c1= transpose(f2c1);
118.
119. vin2c1= [];
120. vin2c1= transpose(vin2c1);
121.
122. vout2c1= [];
123. vout2c1= transpose(vout2c1);
124.
125. p2c1= [];
126. p2c1= transpose(p2c1);
127.
128. mag2c1= 20.*log10(abs(vout2c1./vin2c1));
129.
130. figure(9)
131. plot(f2c1, mag2c1)
132. title('Magnitude vs. Frequency Bode Plot for Active High Pass Filter at 1 V')
133. xlabel('Frequency (Hz)')
134. ylabel('Magnitude (dB)')
135.
136. figure(10)
137. plot(f2c1, p2c1)
138. title('Phase vs. Frequency Bode Plot for Active High Pass Filter at 1 V')
139. xlabel('Frequency (Hz)')
140. ylabel('Phase (deg)')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top