From 68529e7db83336f508592cd31bd862e21544ada7 Mon Sep 17 00:00:00 2001 From: Martin Kennedy Date: Mon, 5 May 2025 10:27:34 -0400 Subject: [PATCH] feat: finiiish --- Final.tex | 215 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 199 insertions(+), 16 deletions(-) diff --git a/Final.tex b/Final.tex index 08aa44f..107a0a1 100644 --- a/Final.tex +++ b/Final.tex @@ -2,6 +2,34 @@ % \IEEEoverridecommandlockouts % The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out. \usepackage{cite} +\usepackage{xcolor} +\definecolor{codegreen}{rgb}{0,0.6,0} +\definecolor{codegray}{rgb}{0.5,0.5,0.5} +\definecolor{codepurple}{rgb}{0.58,0,0.82} +\definecolor{backcolour}{rgb}{0.95,0.95,0.92} + +\usepackage{listings} +\lstdefinestyle{mystyle}{ + backgroundcolor=\color{backcolour}, + commentstyle=\color{codegreen}, + keywordstyle=\color{magenta}, + numberstyle=\tiny\color{codegray}, + stringstyle=\color{codepurple}, + basicstyle=\ttfamily\footnotesize, + breakatwhitespace=false, + breaklines=true, + captionpos=b, + keepspaces=true, + numbers=left, + numbersep=5pt, + showspaces=false, + showstringspaces=false, + showtabs=false, + tabsize=2 +} + +\lstset{style=mystyle} + \usepackage{amsmath,amssymb,amsfonts} \usepackage{algorithmic} \usepackage{graphicx} @@ -10,7 +38,7 @@ \usepackage{framed} \usepackage{longtable,booktabs,array} \usepackage{caption} -\usepackage{xcolor} + \usepackage{siunitx} \usepackage{circuitikz} \def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em @@ -54,7 +82,7 @@ the frequency response of the open-loop gain. One of the most well-known op-amps is the LM741. In no small part to demonstrate one weakness of the LM741, a cutoff frequency of -$\SI{40}{kHz}$ is selected for the high-pass filter design. To compare, +$\SI{400}{kHz}$ is selected for the high-pass filter design. To compare, three op-amps are selected beyond the LM741: \begin{enumerate} @@ -67,10 +95,11 @@ three op-amps are selected beyond the LM741: \end{enumerate} To focus on the real-world impact of the variations in performance of -these op-amps: imagine that the application for our high-pass filter -is as a pre-amplifier for a hobbyist kit, to be sold in the United -Kingdom, which can use the MSF signal ($\SI{60}{\kHz}$) \cite{b4} to -tell the current time. +these op-amps at higher frequencies: imagine that the application for +our high-pass filter is as a pre-amplifier for a hobbyist AM receiver +kit to receive emergency weather and traffic alerts in the Northeast +US. These alerts are broadcast between $\SI{530}{\kHz}$ AM and +$\SI{1650}{\kHz}$ \cite{b4}. \section{Design of a High-pass Active Filter} @@ -117,8 +146,8 @@ divider, and so This high-pass filter design is a common one, with a well-known cutoff frequency $\omega_c = \frac{1}{R_1 C}$ and gain $K = \frac{R_2}{R_1}$ \cite{b3}. To acquire a cutoff frequency of -$\omega_c = \SI{40}{\kHz} \approx \SI{2.51E5}{}$ rad/s, -$R_1 = \SI{100}{\ohm}$ and $C_1 = \SI{39}{\nano\farad}$ will +$\omega_c = \SI{400}{\kHz} \approx \SI{2.51E6}{}$ rad/s, +$R_1 = \SI{100}{\ohm}$ and $C_1 = \SI{3.9}{\nano\farad}$ will suffice. Only $R_2$ remains to be selected to determine the limit on gain; selecting $R_2 = \SI{100}{\kohm}$ yields $K = 1000 = \SI{60}{dB}$. @@ -227,8 +256,8 @@ Combining equations \ref{eqn:kcl} and \ref{eqn:known}, \begin{align} \begin{split} 0 &= \frac{v_{in}-v_n}{R_1+\frac{1}{s C_1}} - \frac{v_n - A(-v_n)}{R_2} \\ - &= \frac{v_{in}}{R_1+\frac{1}{s C_1}} - v_n \left(\frac{1}{R_1+s C_1} + \frac{A+1}{R_2} \right) \\ - &= \frac{v_{in}}{R_1+\frac{1}{s C_1}} + \frac{v_{out}}{A} \left(\frac{1}{R_1+s C_1} + \frac{A+1}{R_2} \right) \\ + &= \frac{v_{in}}{R_1+\frac{1}{s C_1}} - v_n \left(\frac{1}{R_1+\frac{1}{s C_1}} + \frac{A+1}{R_2} \right) \\ + &= \frac{v_{in}}{R_1+\frac{1}{s C_1}} + \frac{v_{out}}{A} \left(\frac{1}{R_1+\frac{1}{s C_1}} + \frac{A+1}{R_2} \right) \\ \end{split} \end{align} @@ -236,10 +265,9 @@ So, \begin{align} \begin{split} - \frac{v_{out}}{A} \left(\frac{1}{R_1+s C_1} + \frac{A+1}{R_2} \right) &= -\frac{v_{in}}{R_1+\frac{1}{s C_1}} \\ + \frac{v_{out}}{A} \left(\frac{1}{R_1+\frac{1}{s C_1}} + \frac{A+1}{R_2} \right) &= -\frac{v_{in}}{R_1+\frac{1}{s C_1}} \\ H(s) = \frac{v_{out}}{v_{in}} &= -A \frac{R_2}{R_2+(A+1)(R_1+\frac{1}{s C_1})} \\ - &= -A\frac{\SI{10}{\kohm}}{\SI{10}{\kohm} + (A + 1) (\SI{100}{\ohm} + \frac{1}{s \SI{39}{\nano\farad}})} \\ - &= -A\frac{\SI{E4}{}}{\SI{E4}{} + (A + 1) (\SI{E2}{} + \frac{\SI{2.56E7}{}}{s})} + &= -A\frac{\SI{10}{\kohm}}{\SI{10}{\kohm} + (A + 1) (\SI{100}{\ohm} + \frac{1}{s \SI{3.9}{\nano\farad}})} \\ \end{split} \end{align} @@ -284,11 +312,16 @@ approximately $\omega_c = 25$ rad/s. This yields: In this case, the peak gain $A_0$ is still approximately $\SI{2E5}{}$ (agreeing with earlier content of the datasheet, noting -$A_{VD}= 200V/mV$ typical). The cut-off frequency, however, is much -higher, closer to $\omega_c = 210$ rad/s. +$A_{VD}= 200V/mV$ typical). The cut-off frequency, however, is higher, +closer to $\omega_c = 210$ rad/s. \subsection{A whole new world: the OPA818} +The TI OPA818 is a much higher-cost, much higher-bandwidth, and much +less common op-amp than either the LM741 or the TL08X. It was selected +in case neither of the previous two op-amps were able to perform well +enough in this application. + \begin{figure}[h] \caption{The open-loop gain of the OPA818} \label{img:opa818_olgm} @@ -311,11 +344,161 @@ $-\frac{AR_2}{A(R_1 + \frac{1}{sC_1})} = -\frac{R_2}{R_1 + function seen in Equation \ref{eqn:hpf_tf} for the inverting ideal active high-pass filter. +\section{A complete comparison} +MATLAB is used to compare the final transfer functions of all four +cases; the result is shown in Figure \ref{img:bode_plots}. Of +particular note: MATLAB's symbolic handling does some heavy lifting to +generate Bode plots without having to further simplify the transfer +functions, beyond substituting each $A(s)$ into place. + +\begin{figure}[h] + \caption{Bode plots of our four filters} + \label{img:bode_plots} + \centering + \includegraphics[width=0.5\textwidth]{bode_plots} +\end{figure} + +Figure \ref{img:bode_plots} clearly shows that while the ideal op-amp +has no problem enabling a 'proper' $\omega_c = \SI{400}{\kHz}$, both +the LM741 and TL081 miss the mark substantially, and act in practice +more like band-pass filters with upper cutoff frequencies of around +$\SI{1.2E5}{}$ rad/s and $\SI{3.0E5}{}$ rad/s, respectively, both +\textit{below} the intended \textit{lower} cutoff frequency of our +high-pass filter. + +Ultimately, even the much more capable OPA818 acts as a band-pass +filter rather than a high-pass filter. Nevertheless, it succeeds in +reaching an upper $\omega_{c_2} = \SI{4E7}{}$ rad/s +$\approx \SI{6.37}{\MHz}$, making it functional, if not necessarily +suitable, for the intended application. + +\subsection{Gain response} +In terms of the frequency response of gain, it is clear that only +exceptional op-amps succeed in higher-frequency circumstances. Note as +well that the application described -- AM radio reception -- is, +compared to other types of radio amplification, relatively +low-frequency. Compare, for example, FM radio, which operates in the +$\SI{87.9}{\MHz}$ through $\SI{107.9}{\MHz}$ band. Of our models, the +only one that comes out unscathed is the ideal op-amp model. + +\subsection{Phase response} +The phase response of the three non-ideal op-amps is consistent: below +the cutoff frequency, the phase is delayed by 270 degrees; in the +effective pass-band, the phase shift moves towards 180 degrees, and +after the pass-band, it reduces to 90 degrees. + +Note that for any time-sensitive applications, where the bandwidth of +the signal being carried is a substantial portion of the frequency of +the signal, this phase shift would be problematic. An additional +phase-shift is entirely expected since we are using it as an inverting +op-amp, obligating an 180 degree phase-shift in the passband. + +The ideal op-amp yields a true high-pass filter, which is reflected as +well in the fact that the phase shift never decreases past 180 +degrees. + +\section{Summary} +The exploration of op-amps applied to a higher-frequency application +makes for an excellent illustration for the extremely limited +applicability of some op-amps in this application. While an LM741 or +TL081 would make for a fine low-power audio amplifier, they are, due +to their low cutoff frequency, not suitable for $\ge \SI{100}{\kHz}$ +applications; indeed, even more performant op-amps have limits in +amplifying higher-frequency signals. + +\section{Code appendix} + +\begin{lstlisting}[style=mystyle,breaklines=true,language=Octave] +% Define symbolic variables +syms s + +r_1 = 1.e2 +r_2 = 1.e5 +c_1 = 3.9e-9 + +% Transfer function setup: LM741 % +A_0_LM741 = 2.e5; +tau_LM741 = 1./25; +A_sym_LM741 = A_0_LM741 / (tau_LM741 * s + 1); + +% Symbolic setup and consumption: LM741 % +sym_LM741 = -A_sym_LM741 * (r_2) / (r_2 + (A_sym_LM741 + 1) * (r_1 + 1 / (s * c_1))); +tf_sym_LM741 = subs(sym_LM741, A_sym_LM741, A_0_LM741 / (tau_LM741 * s + 1)); + +% Perform sym extraction for LM741, and generate polynomial num/denom % +[nH_LM741um_sym_LM741, den_sym_LM741] = numden(tf_sym_LM741); +num_coeffs_LM741 = sym2poly(num_sym_LM741); +den_coeffs_LM741 = sym2poly(den_sym_LM741); + +% Create the numeric transfer function object for LM741 % +LM741 = tf(num_coeffs_LM741, den_coeffs_LM741); + + +% Transfer function setup: TL081 % +A_0_TL081 = 2.e5; +tau_TL081 = 1./210; +A_sym_TL081 = A_0_TL081 / (tau_TL081 * s + 1); + +% Symbolic setup and consumption: TL081 % +sym_TL081 = -A_sym_TL081 * (r_2) / (r_2 + (A_sym_TL081 + 1) * (r_1 + 1 / (s * c_1))); +tf_sym_TL081 = subs(sym_TL081, A_sym_TL081, A_0_TL081 / (tau_TL081 * s + 1)); + +% Perform sym extraction for TL081, and generate polynomial num/denom % +[num_sym_TL081, den_sym_TL081] = numden(tf_sym_TL081); +num_coeffs_TL081 = sym2poly(num_sym_TL081); +den_coeffs_TL081 = sym2poly(den_sym_TL081); + +% Create the numeric transfer function object for TL081 % +TL081 = tf(num_coeffs_TL081, den_coeffs_TL081); + + +% Transfer function setup: OPA818 % +A_0_OPA818 = 4.e4; +tau_OPA818 = 1./7.E5; +A_sym_OPA818 = A_0_OPA818 / (tau_OPA818 * s + 1); + +% Symbolic setup and consumption: OPA818 % +sym_OPA818 = -A_sym_OPA818 * (r_2) / (r_2 + (A_sym_OPA818 + 1) * (r_1 + 1 / (s * c_1))); +tf_sym_OPA818 = subs(sym_OPA818, A_sym_OPA818, A_0_OPA818 / (tau_OPA818 * s + 1)); + +% Perform sym extraction for OPA818, and generate polynomial num/denom % +[num_sym_OPA818, den_sym_OPA818] = numden(tf_sym_OPA818); +num_coeffs_OPA818 = sym2poly(num_sym_OPA818); +den_coeffs_OPA818 = sym2poly(den_sym_OPA818); + +% Create the numeric transfer function object for OPA818 % +OPA818 = tf(num_coeffs_OPA818, den_coeffs_OPA818); + +% Create a numeric TF for the ideal op-amp % +% Symbolic consumption: ideal % +tf_sym_ideal = - (r_2) / (r_1 + 1 / (s * c_1)); + +% Perform sym extraction for OPA818, and generate polynomial num/denom % +[num_sym_ideal, den_sym_ideal] = numden(tf_sym_ideal); +num_coeffs_ideal = sym2poly(num_sym_ideal); +den_coeffs_ideal = sym2poly(den_sym_ideal); + +% Create the numeric transfer function object for the ideal op-amp % +ideal = tf(num_coeffs_ideal, den_coeffs_ideal); + +% Generate the Bode plot +hold on; +bode(LM741); +bode(TL081); +bode(OPA818); +bode(ideal); +legend('LM741','TL081','OPA818','ideal'); + +grid on; +title('Frequency responses of op-amp driven high-pass filters'); +hold off; +\end{lstlisting} + \begin{thebibliography}{00} \bibitem{b1} J. Karki, ``Understanding Operational Amplifier Specifications.'' Accessed: May 05, 2025. [Online]. Available: https://www.ti.com/lit/an/sloa011b/sloa011b.pdf, p. 14. \bibitem{b2} J. W. Nilsson and S. A. Riedel, Electric Crircuits, 12th ed., Hoboken: Pearson, 2022, p.168 \bibitem{b3} J. W. Nilsson and S. A. Riedel, Electric Crircuits, 12th ed., Hoboken: Pearson, 2022, p.576 -\bibitem{b4} ``MSF radio time signal,'' NPLWebsite. https://www.npl.co.uk/msf-signal +\bibitem{b4} N. US Department of Commerce, ``NOAA Weather Radio Frequently Asked Questions,'' www.weather.gov. https://www.weather.gov/phi/nwrfaq \end{thebibliography} \vspace{12pt} \end{document}