Magnitude (Normalized Gain) Magnitude (Normalized Gain) Magnitude (Gain in dB) 101 10² ་ ཨཱུ ྴ ་ སྦ་ 0.6 0.4 0.2 101 。 ོ ༅ བླླ ོ ྴ ོ༔ -10 -20 -30 -40 101 Low-pass Filter Magnitude Response (Normalized) X 159.155 Y 0.707 Cutoff: 159.15 Hz 103 Frequency (Hz) High-pass Filter Magnitude Response (Normalized) X 159.155 Y 0.707 Cutoff: 159.15 Hz 102 Lower Cutoff: 145.80 Hz 103 Frequency (Hz) Band-pass Filter Magnitude Response (dB) 102 103 Frequency (Hz) off: 1737.35 Hz X 1788.57 Y-3.16137 104 104 104 Low-pass Filter -Cutoff 159.15 Hz High-pass Filter -Cutoff 159.15 Hz Band-pass Filter - Lower Cutoff = 145.80 Hz - Upper Cutoff 1737.35 Hz 105 105 105

Principles of Information Systems (MindTap Course List)
12th Edition
ISBN:9781285867168
Author:Ralph Stair, George Reynolds
Publisher:Ralph Stair, George Reynolds
Chapter6: Telecommunications And Networks
Section: Chapter Questions
Problem 5SAT
icon
Related questions
Question

I need help fixing the minor issue where the text isn't in the proper place, and to ensure that the frequency cutoff is at the right place.

My code:

% Define frequency range for the plot
f = logspace(1, 5, 500); % Frequency range from 10 Hz to 100 kHz
w = 2 * pi * f; % Angular frequency
 
% Parameters for the filters - let's adjust these to get more reasonable cutoffs
R = 1e3; % Resistance in ohms (1 kΩ)
C = 1e-6; % Capacitance in farads (1 μF)
 
% For bandpass, we need appropriate L value for desired cutoffs
L = 0.1; % Inductance in henries - adjusted for better bandpass response
 
% Calculate cutoff frequencies first to verify they're in desired range
f_cutoff_RC = 1 / (2 * pi * R * C);
f_resonance = 1 / (2 * pi * sqrt(L * C));
Q_factor = (1/R) * sqrt(L/C);
f_lower_cutoff = f_resonance / (sqrt(1 + 1/(4*Q_factor^2)) + 1/(2*Q_factor));
f_upper_cutoff = f_resonance / (sqrt(1 + 1/(4*Q_factor^2)) - 1/(2*Q_factor));
 
% Transfer functions
% Low-pass filter (RC)
H_low = 1 ./ (1 + 1i * w * R * C);
 
% High-pass filter (RC)
H_high = (1i * w * R * C) ./ (1 + 1i * w * R * C);
 
% Band-pass filter (RLC series)
% Corrected bandpass transfer function for series RLC
H_band = (R ./ (R + 1i*w*L + 1./(1i*w*C)));
 
% Normalize the gain for Low-pass and High-pass filters
H_low_normalized = abs(H_low) / max(abs(H_low));
H_high_normalized = abs(H_high) / max(abs(H_high));
H_band_dB = 20 * log10(abs(H_band) / max(abs(H_band)));
 
% Plot Magnitude Responses
figure('Position', [100, 100, 800, 600]);
 
% Low-pass Filter
subplot(3,1,1);
semilogx(f, H_low_normalized, 'b', 'LineWidth', 1.5);
hold on;
line([f_cutoff_RC f_cutoff_RC], [0, 0.707], 'Color', 'r', 'LineStyle', '--'); % Mark cutoff at -3dB
text(f_cutoff_RC*1.2, 0.6, sprintf('Cutoff: %.2f Hz', f_cutoff_RC), 'HorizontalAlignment', 'left');
title('Low-pass Filter Magnitude Response (Normalized)');
xlabel('Frequency (Hz)');
ylabel('Magnitude (Normalized Gain)');
grid on;
legend('Low-pass Filter', sprintf('Cutoff = %.2f Hz', f_cutoff_RC));
ylim([0 1.05]);
hold off;
 
% High-pass Filter
subplot(3,1,2);
semilogx(f, H_high_normalized, 'r', 'LineWidth', 1.5);
hold on;
line([f_cutoff_RC f_cutoff_RC], [0, 0.707], 'Color', 'r', 'LineStyle', '--'); % Mark cutoff at -3dB
text(f_cutoff_RC*1.2, 0.6, sprintf('Cutoff: %.2f Hz', f_cutoff_RC), 'HorizontalAlignment', 'left');
title('High-pass Filter Magnitude Response (Normalized)');
xlabel('Frequency (Hz)');
ylabel('Magnitude (Normalized Gain)');
grid on;
legend('High-pass Filter', sprintf('Cutoff = %.2f Hz', f_cutoff_RC));
ylim([0 1.05]);
hold off;
 
% Band-pass Filter
subplot(3,1,3);
semilogx(f, H_band_dB, 'g', 'LineWidth', 1.5);
hold on;
% Mark -3dB points (half power points)
yline(-3, 'k--');
line([f_lower_cutoff f_lower_cutoff], [-40, 0], 'Color', 'r', 'LineStyle', '--'); % Mark lower cutoff
line([f_upper_cutoff f_upper_cutoff], [-40, 0], 'Color', 'g', 'LineStyle', '--'); % Mark upper cutoff
text(f_lower_cutoff*0.7, -5, sprintf('Lower Cutoff: %.2f Hz', f_lower_cutoff), 'HorizontalAlignment', 'right');
text(f_upper_cutoff*1.2, -5, sprintf('Upper Cutoff: %.2f Hz', f_upper_cutoff), 'HorizontalAlignment', 'left');
title('Band-pass Filter Magnitude Response (dB)');
xlabel('Frequency (Hz)');
ylabel('Magnitude (Gain in dB)');
grid on;
legend('Band-pass Filter', sprintf('Lower Cutoff = %.2f Hz', f_lower_cutoff), sprintf('Upper Cutoff = %.2f Hz', f_upper_cutoff));
ylim([-40 5]);
hold off;
 
Magnitude (Normalized Gain)
Magnitude (Normalized Gain)
Magnitude (Gain in dB)
101
10²
་ ཨཱུ  ྴ ་ སྦ་
0.6
0.4
0.2
101
。 ོ ༅ བླླ ོ  ྴ ོ༔
-10
-20
-30
-40
101
Low-pass Filter Magnitude Response (Normalized)
X 159.155
Y 0.707
Cutoff: 159.15 Hz
103
Frequency (Hz)
High-pass Filter Magnitude Response (Normalized)
X 159.155
Y 0.707
Cutoff: 159.15 Hz
102
Lower Cutoff: 145.80 Hz
103
Frequency (Hz)
Band-pass Filter Magnitude Response (dB)
102
103
Frequency (Hz)
off: 1737.35 Hz
X 1788.57
Y-3.16137
104
104
104
Low-pass Filter
-Cutoff 159.15 Hz
High-pass Filter
-Cutoff 159.15 Hz
Band-pass Filter
- Lower Cutoff = 145.80 Hz
-
Upper Cutoff 1737.35 Hz
105
105
105
Transcribed Image Text:Magnitude (Normalized Gain) Magnitude (Normalized Gain) Magnitude (Gain in dB) 101 10² ་ ཨཱུ ྴ ་ སྦ་ 0.6 0.4 0.2 101 。 ོ ༅ བླླ ོ ྴ ོ༔ -10 -20 -30 -40 101 Low-pass Filter Magnitude Response (Normalized) X 159.155 Y 0.707 Cutoff: 159.15 Hz 103 Frequency (Hz) High-pass Filter Magnitude Response (Normalized) X 159.155 Y 0.707 Cutoff: 159.15 Hz 102 Lower Cutoff: 145.80 Hz 103 Frequency (Hz) Band-pass Filter Magnitude Response (dB) 102 103 Frequency (Hz) off: 1737.35 Hz X 1788.57 Y-3.16137 104 104 104 Low-pass Filter -Cutoff 159.15 Hz High-pass Filter -Cutoff 159.15 Hz Band-pass Filter - Lower Cutoff = 145.80 Hz - Upper Cutoff 1737.35 Hz 105 105 105
Expert Solution
steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Recommended textbooks for you
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Enhanced Discovering Computers 2017 (Shelly Cashm…
Enhanced Discovering Computers 2017 (Shelly Cashm…
Computer Science
ISBN:
9781305657458
Author:
Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:
Cengage Learning
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage
MIS
MIS
Computer Science
ISBN:
9781337681919
Author:
BIDGOLI
Publisher:
Cengage
A+ Guide to Hardware (Standalone Book) (MindTap C…
A+ Guide to Hardware (Standalone Book) (MindTap C…
Computer Science
ISBN:
9781305266452
Author:
Jean Andrews
Publisher:
Cengage Learning