0.5 Magnitude (Normalized Gain) Magnitude (Normalized Gain) Magnitude (Gain in dB) -10 -20 -30 0.5 0 101 102 102 Low-pass Filter Magnitude Response (Normalized) Sutoff: 159.15 Hz 103 Frequency (Hz) High-pass Filter Magnitude Response (Normalized) Cutoff: 159.15 Hz 103 Frequency (Hz) Band-pass Filter Magnitude Response (dB) T Lower Cutoff: 1591.55 Hz 101 102 103 104 Frequency (Hz) 104 104 Up Low-pass Filter Cutoff 159.15 Hz High-pass Filter -Cutoff 159.15 Hz Band-pass Filter -Lower Cutoff = 1591.55 Hz Upper Cutoff 15915.49 Hz 105 105 105

Introductory Circuit Analysis (13th Edition)
13th Edition
ISBN:9780133923605
Author:Robert L. Boylestad
Publisher:Robert L. Boylestad
Chapter1: Introduction
Section: Chapter Questions
Problem 1P: Visit your local library (at school or home) and describe the extent to which it provides literature...
icon
Related questions
Question

I decided to focus on the magnitude where I do the normalization on low and high pass and have the bandpass as dB(dB(decibel), with frequency cutoff, I manage to get accurate but have trouble controlling the frequency cutoff accurately and the bandbass isn't working properly. As such I need help.
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
R = 1e3; % Resistance in ohms (1 kΩ)
C = 1e-6; % Capacitance in farads (1 μF)
L = 10e-3; % Inductance in henries (10 mH)
 
% Transfer functions
H_low = 1 ./ (1 + 1i * w * R * C); % Low-pass filter
H_high = (1i * w * R * C) ./ (1 + 1i * w * R * C); % High-pass filter
H_band = (1i * w * R * C) ./ (1 + 1i * w * L / R + 1i * w * R * C); % Band-pass filter
 
% Cutoff frequency for RC filters (Low-pass and High-pass)
f_cutoff_RC = 1 / (2 * pi * R * C);
 
% Band-pass filter cutoff frequencies
f_lower_cutoff = 1 / (2 * pi * sqrt(L * C)); % Lower cutoff frequency
f_upper_cutoff = R / (2 * pi * L); % Upper cutoff frequency (corrected formula)
 
% 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));
 
% Plot Magnitude Responses
figure;
 
% 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, 1], 'Color', 'r', 'LineStyle', '--'); % Mark cutoff
text(f_cutoff_RC, 0.7, 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));
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, 1], 'Color', 'r', 'LineStyle', '--'); % Mark cutoff
text(f_cutoff_RC, 0.7, 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));
hold off;
 
% Band-pass Filter
subplot(3,1,3);
semilogx(f, 20 * log10(abs(H_band)), 'g', 'LineWidth', 1.5); hold on;
line([f_lower_cutoff f_lower_cutoff], ylim, 'Color', 'r', 'LineStyle', '--'); % Mark lower cutoff
line([f_upper_cutoff f_upper_cutoff], ylim, 'Color', 'g', 'LineStyle', '--'); % Mark upper cutoff
text(f_lower_cutoff, max(20*log10(abs(H_band)))-3, sprintf('Lower Cutoff: %.2f Hz', f_lower_cutoff), 'HorizontalAlignment', 'left');
text(f_upper_cutoff, max(20*log10(abs(H_band)))-3, 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));
hold off;
 
0.5
Magnitude (Normalized Gain)
Magnitude (Normalized Gain)
Magnitude (Gain in dB)
-10
-20
-30
0.5
0
101
102
102
Low-pass Filter Magnitude Response (Normalized)
Sutoff: 159.15 Hz
103
Frequency (Hz)
High-pass Filter Magnitude Response (Normalized)
Cutoff: 159.15 Hz
103
Frequency (Hz)
Band-pass Filter Magnitude Response (dB)
T
Lower Cutoff: 1591.55 Hz
101
102
103
104
Frequency (Hz)
104
104
Up
Low-pass Filter
Cutoff 159.15 Hz
High-pass Filter
-Cutoff 159.15 Hz
Band-pass Filter
-Lower Cutoff = 1591.55 Hz
Upper Cutoff 15915.49 Hz
105
105
105
Transcribed Image Text:0.5 Magnitude (Normalized Gain) Magnitude (Normalized Gain) Magnitude (Gain in dB) -10 -20 -30 0.5 0 101 102 102 Low-pass Filter Magnitude Response (Normalized) Sutoff: 159.15 Hz 103 Frequency (Hz) High-pass Filter Magnitude Response (Normalized) Cutoff: 159.15 Hz 103 Frequency (Hz) Band-pass Filter Magnitude Response (dB) T Lower Cutoff: 1591.55 Hz 101 102 103 104 Frequency (Hz) 104 104 Up Low-pass Filter Cutoff 159.15 Hz High-pass Filter -Cutoff 159.15 Hz Band-pass Filter -Lower Cutoff = 1591.55 Hz Upper Cutoff 15915.49 Hz 105 105 105
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Introductory Circuit Analysis (13th Edition)
Introductory Circuit Analysis (13th Edition)
Electrical Engineering
ISBN:
9780133923605
Author:
Robert L. Boylestad
Publisher:
PEARSON
Delmar's Standard Textbook Of Electricity
Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:
9781337900348
Author:
Stephen L. Herman
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Electrical Engineering
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education
Fundamentals of Electric Circuits
Fundamentals of Electric Circuits
Electrical Engineering
ISBN:
9780078028229
Author:
Charles K Alexander, Matthew Sadiku
Publisher:
McGraw-Hill Education
Electric Circuits. (11th Edition)
Electric Circuits. (11th Edition)
Electrical Engineering
ISBN:
9780134746968
Author:
James W. Nilsson, Susan Riedel
Publisher:
PEARSON
Engineering Electromagnetics
Engineering Electromagnetics
Electrical Engineering
ISBN:
9780078028151
Author:
Hayt, William H. (william Hart), Jr, BUCK, John A.
Publisher:
Mcgraw-hill Education,