ClearAll["Global`*"](* Low Pass Filter *)
;
(* R in series with C, (Subscript[V, out]) is across C *)
R=10; c= 0.001;v0mag=10.0; v0phase=0.0;
v0=v0mag*(E^(I v0phase));ztot[ω_] = R - (I/(ω c));
itot[ω_] = (v0/(ztot[ω]));vc[ω_]=itot[ω](- (I/(ω c)));
response[ω_]=((Abs[vc[ω]])/(Abs[v0]));
ω0 = (1/(R c)); (* this is the "cutoff" frequency *)
Print["Cutoff Frequency is (Subscript[ω, 0]) = ",ω0, " rad/s"]
Print["At this ω, ((Subscript[V, out])/(Subscript[V, in])) = ",response[ω0]]
ideal[ω_]=1-UnitStep[ω-ω0];
LogLinearPlot[{response[ω],ideal[ω]},{ω,((ω0)/1000),1000 ω0},PlotRange->Full, Frame-> True,FrameLabel->{"ω ((s^(-1)))",{"Response","Ideal"}},Axes->False, Exclusions->None, PlotLabel->"Low Pass Filter" ]

ClearAll["Global`*"](* High Pass Filter *)
;
(* R in series with C, (Subscript[V, out]) is across R *)
R=10;c = 0.001;v0mag=10.0; v0phase=0.0;v0=v0mag*(E^(I v0phase));
ztot[ω_] = R - (I/(ω c));
itot[ω_] = (v0/(ztot[ω]));vr[ω_]=itot[ω](R);
response[ω_]=((Abs[vr[ω]])/(Abs[v0]));
ω0 = (1/(R c)); (* this is the "cutoff" frequency *)
Print["Cutoff Frequency is (Subscript[ω, 0]) = ",ω0, " rad/s"]
Print["At this ω, ((Subscript[V, out])/(Subscript[V, in])) = ",response[ω0]]
ideal[ω_]=UnitStep[ω-ω0];
LogLinearPlot[{response[ω],ideal[ω]},{ω,((ω0)/1000),1000 ω0},PlotRange->Full, Frame-> True,FrameLabel->{"ω ((s^(-1)))",{"Response","Ideal"}},Axes->False, Exclusions->None, PlotLabel->"High Pass Filter"]

ClearAll["Global`*"](* Combined Low-High Reject Filter using RLC *)
;
R=10;c = 0.1;L=.001;v0mag=10.0; v0phase=0.0;v0=v0mag*(E^(I v0phase));
ztot[ω_] = R +L ω I- (I/(ω c));
itot[ω_] = (v0/(ztot[ω]));vr[ω_]=itot[ω](R);
response[ω_]=((Abs[vr[ω]])/(Abs[v0])); (*response is measured across the resistor *)
ω1 = (1/(R c)) ;(* this is the lower "start" frequency *)
ω2 = (R/(L )) ;(* this is the upper "end" frequency *)
ideal[ω_]=(1-UnitStep[ω-ω2])*UnitStep[ω-ω1] ;
LogLinearPlot[{response[ω],ideal[ω]},{ω,((ω1)/1000),10000 ω2},PlotRange->Full, Frame-> True,FrameLabel->{"ω ((s^(-1)))",{"Response","Ideal"}},Axes->False, Exclusions->None, PlotLabel->"Band Pass Filter"]

ClearAll["Global`*"](* Combined Low-High Reject Filter using RLC *)
 ;
R=10000; (* note that these are different numbers than in the previous examples... *)
c = 0.001;L=.05;v0mag=10.0; v0phase=0.0;v0=v0mag*(E^(I v0phase));
ztot[ω_] = R +L ω I- (I/(ω c));
itot[ω_] = (v0/(ztot[ω]));vLc[ω_]=itot[ω](L ω I- (I/(ω c)));
response[ω_]=((Abs[vLc[ω]])/(Abs[v0])); (*response is measured across the inductor + capacitor *)
ω1 = (1/(R c)) (* this is the lower "start" frequency *)
ω2 = (R/(L )) (* this is the upper "end" frequency *)
ideal[ω_]=1-(1-UnitStep[ω-ω2])*UnitStep[ω-ω1] ;
LogLinearPlot[{response[ω],ideal[ω]},{ω,((ω1)/1000),10000 ω2},PlotRange->Full, Frame-> True,FrameLabel->{"ω ((s^(-1)))",{"Response","Ideal"}},Axes->False, Exclusions->None, PlotLabel->"Band Reject Filter"]

ClearAll["Global`*"](* Filtering to remove AC Noise *)
;
f1=60.0;f2=1000.0;
vsignal[t_]= 0.1 Sin[2 π f2 t];
vnoise[t_]=1 Sin[2 π  f1 t] ;
vtot[t_]=vsignal[t]+vnoise[t];
Plot[{vsignal[t],vnoise[t],vtot[t]},{t,0,0.04},PlotRange->Full, Frame-> True,FrameLabel->{"t (s)","V"},Axes->False,PlotLegends-> Placed[{"Signal","Noise","Measured"},{1,.7}]]
R=10;c = 100 (10^(-6));L=0.0703;
zLC[ω_] = ((-(I ω L * (I/(ω c))))/((I ω L - (I/(ω c)))));
VoutPerVin[ω_] := (R/(R+zLC[ω]));
Voutsignal[t_]=Re[vsignal[t]*VoutPerVin[2 π f2] ];
Voutnoise[t_]=Re[vnoise[t]*VoutPerVin[2 π f1] ];
Vout[t_]=Re[Voutsignal[t]+Voutnoise[t]];
plotoffset=0.5;
Plot[{vsignal[t]+plotoffset,Voutnoise[t],Vout[t]},{t,0,0.04},PlotRange->{-1,1}, Frame-> True,FrameLabel->{"t (s)","V"},Axes->False,PlotLegends-> Placed[{"Orig Signal @ Offset","Noise","Measured"},{1,.7}]]
(* note that I added an "offset" to the original signal just so I can see it
on the plot. Otherwise, the input was covered up by the output! *)

ClearAll["Global`*"](* Band Stop Behavior of prior circuit *)
;
R=10; c= 100 (10^(-6));L=0.0703; 
(* remember, we are trying to eliminate 377 rad/s and keep 6283 rad/s *)
v0mag=0.2; v0phase=0.0;v0=v0mag*(E^(I v0phase));
ztot[ω_] =  ((-(I ω L * (I/(ω c))))/((I ω L - (I/(ω c)))))+R;
itot[ω_] = (v0/(ztot[ω]));vR[ω_]=itot[ω](R);
response[ω_]=((Abs[vR[ω]])/(Abs[v0]))  ; (*response is measured across the resistor *)
ω1 =ω/.FindRoot[response[ω]-(1/(Sqrt[2])),{ω,100}];(* this is the lower "start" frequency *)
ω2 =ω/.FindRoot[response[ω]-(1/(Sqrt[2])),{ω,1000}];(* this is the upper "end" frequency *)
ω0 =ω/.FindMinimum[response[ω],{ω,400}] [[2]];//Quiet(* this is the central frequency *) 

ideal[ω_]=1-(1-UnitStep[ω-ω2])*UnitStep[ω-ω1] ;
Print["(Subscript[ω, 0]) = ",ω0 ," rad/s,  (Subscript[ω, min]) = ",ω1 ," rad/s,  (Subscript[ω, max]) = ",ω2 ," rad/s"   ]
LogLinearPlot[{response[ω],ideal[ω]},{ω,10,100000},PlotRange->Full, Frame-> True,FrameLabel->{"ω ((s^(-1)))",{"Response","Ideal"}},Axes->False, Exclusions->None, PlotLabel->"Notch Filter"]

ClearAll["Global`*"](* Symbolic Band Stop Behavior of prior circuit *)
ωrule=Solve[ComplexExpand[Abs[(R/(R+(L/(c (-(I/(c ω))+I L ω)))))]]- (1/(Sqrt[2]))==0,ω];//Quiet
ω/.ωrule[[3]]
ω/.ωrule[[4]]
R=10;c = 100 (10^(-6));L=0.0703;   (* now verify numeric results *)
ω/.ωrule[[3]]
ω/.ωrule[[4]]