eeet-331/week8/14-10-2021/14-10-2021.tex

133 lines
4 KiB
TeX

% File: 14-10-2021.tex
% Created: 08:11:06 Thu, 14 Oct 2021 EDT
% Last Change: 08:11:06 Thu, 14 Oct 2021 EDT
%
\documentclass[letterpaper]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{cancel}
\usepackage{amssymb}
\usepackage{listings}
\usepackage[shortlabels]{enumitem}
\usepackage{lipsum}
\usepackage{soul}
\usepackage[smartEllipses,hashEnumerators,hybrid]{markdown}
\usepackage{minted}
\usepackage{geometry}
\usepackage{dirtytalk}
\geometry{portrait, margin=1in}
%\begin{minted}[linenos,bgcolor=LightGray]{[language]}
\date{10/14/2021}
\title{%
Butterworth and Chebychev Filters\\
\large EEET-331-01: Systems, Signals, and Transforms}
\author{Blizzard MacDougall}
\begin{document}
\maketitle
\pagenumbering{arabic}
\section{Chebychev Filters}
Here we will be de-normalizing filters.
\subsection{Example 1}
Given a 3rd order Chebychev with a $0.5dB$ ripple, make a low-pass filter with a cutoff of $1kHz$.
\begin{minted}[linenos]{matlab}
[z,p,k]=cheb1ap(3,0.5)
[num,den]=zp2tf(z,p,k)
%This will give you the numerator and denominator of the transfer function.
%The transfer function can also be found through a table in the textbook, but thats effort.
\end{minted}
\begin{equation}
H(p)=\frac{0.7157}{p^3+1.2529p^2+1.5349p+0.7157}
\end{equation}
This is takes a bit of memorization here, but they're fairly easy to remember.\\
\begin{equation}
\begin{split}
Low-pass== p=\frac{s}{\omega_c}\\
High-pass== p=\frac{\omega_c}{s}\\
Band-pass== p=\frac{s^2+\omega_c^2}{Bs}\\
Band-stop== p=\frac{Bs}{s^2+\omega_c^2}
\end{split}
\end{equation}
Since, in this problem, we're doing a low-pass filter, we substitute $\frac{s}{2\pi*1kHz}$ for $p$. This gives us:
\begin{equation}
\begin{split}
H(p)=\frac{0.7157}{{(\frac{s}{2\pi*1kHz})}^3+1.2529{(\frac{s}{2\pi*1kHz})}^2+1.5349(\frac{s}{2\pi*1kHz})+0.7157}\\
H(p)=\frac{0.7157\omega_c^3}{s^3+1.2529(\omega_c)s^2+1.5439(\omega_c^2)s+0.7157(\omega_c^3)}\\
H(p)=\frac{1.7753_E11}{s^3+7.872_E3s^2+6.0595_E7s+1.7753_E11}
\end{split}
\end{equation}
\say{It'd be nice if at work they gave you the problem and the solution, so you could check your work.}
Continuing the code from previous, to give a bode plot:
\begin{minted}[linenos]{matlab}
[z,p,k]=cheb1ap(3,0.5)
[num,den]=zp2tf(z,p,k)
fc=1000;
wc=2*pi*fc;
[num1k,den1k]=lb2lb(num,den,wc)
%The output of line 7 isn't overly helpful, as MATLAB defaults the output to all 10^11
%Use the following to output a human-readable answer
sden1k=sprintf('\%.4e ',den1k)
% the '%' returns the fed variable. The '.n' returns n sigfigs. The 'e' returns the
%value in exponential.
\end{minted}
\subsection{Example 2}
Using a 2nd order Chebychev with 2dB ripple, make a Band-pass with a cutoff of $5rad/s$ and $8rad/s$
\begin{minted}[linenos]{matlab}
[z,p,k]=cheb1ap(2,2)
[num,den]=zp2tf(z,p,k)
%outputs:
%
%num = 0.6538
%den = 1.0000 0.8038 0.8231
%Note that this is not yet a band-pass filter.
\end{minted}
\begin{equation}
\begin{split}
\frac{0.6538}{p^2+0.8038p+0.8231}\\
p=\frac{s^2+\omega_c^2}{Bs}\\
\omega_c=\sqrt{5*8}=6.325;\ \omega_c^2=40\\
B=8-5=3rad/s
\end{split}
\end{equation}
\emph{\hl{NOTE:$B$ needs to be in $rad/s$. You may be given the frequency values in $Hz$. Remember that to convert to $rad/s$, you multiply by $2\pi$.}}
\begin{equation}
\begin{split}
\frac{0.6538}{p^2+0.8038p+0.8231}\\
\omega_c^2=40;\ B=3\\
\frac{0.6538}{(\frac{s^2+\omega_c^2}{Bs})^2+0.8038(\frac{s^2+\omega_c^2}{Bs})+0.8231}\\
\frac{0.6538{(Bs)}^2}{(s^2+\omega_c^2)^2+0.8038({s^2+\omega_c^2})Bs+0.8231B^2s^2}\\
\frac{5.8842s^2}{(s^4+80s^2+1600)+2.4114s^3+96.456s+7.4079s^2}\\
\frac{5.8842s^2}{s^4+2.4114s^3+87.41s^2+96.46s+1600}
\end{split}
\end{equation}
\begin{minted}[linenos]{matlab}
[z,p,k]=cheb1ap(2,2)
[num,den]=zp2tf(z,p,k)
wh=8;
wl=5;
wc=sqrt(wh*wl)
B=wh-wl
[numbp,denbp]=lp2bp(num,den,wc,B)
sdenbp=sprintf('\%.4e ',denbp)
bode=(numbp,denbp)
\end{minted}
\end{document}