提供RC和LC低通滤波器计算界面的开源代码 - 知乎专栏
文章推薦指數: 80 %
... 掉高频辐射信号,常常会使用无源的低通滤波器,其中包括RC低通滤波和LC低通滤波。
RC低通滤波其截止频率的计算公式为: F_{cutoff}=1/2πRC 2. LC…
无障碍写文章登录/注册笔者在做硬件工程师的工作过程中,发现对于EMC工程师来说,为了滤掉高频辐射信号,常常会使用无源的低通滤波器,其中包括RC低通滤波和LC低通滤波。
RC低通滤波1.1RC低通无源滤波其截止频率的计算公式为:F_{cutoff}=1/2πRC2.LC低通滤波2.1LC低通无源滤波其截止频率的计算公式为:F_{cutoff}=1/2π\sqrt{LC}对于高频信号(例如1GMHz以上的)来讲,常常需要使用到各种pF,nH级别的电容电感进行无源滤波,有绝对值很大的指数,但是电脑自带的计算器有比较呆板,所以常常会有计算错误的情况发生,于是笔者就旨在设计一款专门运用于高频无源滤波调试的开源脚本来进行计算RLC的参数:3.RC滤波计算界面脚本#RC_Filterimporttkinterastkimporttkinter.messageboximportmathwindow=tk.Tk()window.title('RCFilterCalculator')window.geometry('450x300')#VarDefinitionR_insert_var=tk.DoubleVar()C_insert_var=tk.DoubleVar()F_insert_var=tk.DoubleVar()#function#YouknowCandcutofffrequency,soyouwanttocalculateR.defcalculate_R():C_insert=C_insert_var.get()F_insert=F_insert_var.get()ifC_insert>0andF_insert>0:R_calculation=float('%0.4f'%(1/(2*math.pi*F_insert*C_insert)*1e6));tk.messagebox.showinfo(title='Result',message='Youneeda{}Ωresistor'.format(R_calculation))else:tk.messagebox.showerror(title='Error',message='Pleaseinsertvalidvalueofcapacityandgoalfrequency.');#YouknowRandcutofffrequency,soyouwanttocalculateC.defcalculate_C():R_insert=R_insert_var.get()F_insert=F_insert_var.get()ifR_insert>0andF_insert>0:C_calculation=float('%0.4f'%(1/(2*math.pi*F_insert*R_insert)*1e6));tk.messagebox.showinfo(title='Result',message='Youneeda{}pFcapacitor'.format(C_calculation))else:tk.messagebox.showerror(title='Error',message='Pleaseinsertvalidvalueofresistanceandgoalfrequency.');#YouknowLandC,soyouwanttocalculatecutofffrequency.defcalculate_F():R_insert=R_insert_var.get()C_insert=C_insert_var.get()ifR_insert>0andC_insert>0:F_calculation=float('%0.4f'%(1/(2*math.pi*C_insert*R_insert)*1e6));tk.messagebox.showinfo(title='Result',message='Thecutofffrequencycalculationresultis{}MHz'.format(F_calculation))else:tk.messagebox.showerror(title='Error',message='Pleaseinsertvalidvalueofresistancenandcapacity.');#Widgetpackl_R=tk.Label(window,text='Pleaseinserttheresistancevalue',font=('Arial',12),width=30,height=2)l_R.place(x=-5,y=20,anchor="nw")R_insert=tk.Entry(window,textvariable=R_insert_var)R_insert.place(x=255,y=30)l_C=tk.Label(window,text='Pleaseinsertthecapacityvalue',font=('Arial',12),width=30,height=2)l_C.place(x=-5,y=80,anchor="nw")C_insert=tk.Entry(window,textvariable=C_insert_var)C_insert.place(x=255,y=90)l_F=tk.Label(window,text='Pleaseinsertthegoalfrequency',font=('Arial',12),width=30,height=2)l_F.place(x=-5,y=140,anchor="nw")F_insert=tk.Entry(window,textvariable=F_insert_var)F_insert.place(x=255,y=150)b_R=tk.Button(window,text='CalculateR',command=calculate_R)b_R.place(x=60,y=200,anchor="nw")b_C=tk.Button(window,text='CalculateC',command=calculate_C)b_C.place(x=160,y=200,anchor="nw")b_F=tk.Button(window,text='CalculateFrequency',command=calculate_F)b_F.place(x=260,y=200,anchor="nw")l_ohm=tk.Label(window,text='Ω',font=('Arial',12),width=5,height=2)l_ohm.place(x=380,y=20,anchor="nw")l_pf=tk.Label(window,text='pf',font=('Arial',12),width=5,height=2)l_pf.place(x=380,y=80,anchor="nw")l_MHz=tk.Label(window,text='MHz',font=('Arial',12),width=5,height=2)l_MHz.place(x=380,y=140,anchor="nw")window.mainloop()4.LC滤波计算界面脚本#LC_Filterimporttkinterastkimporttkinter.messageboxfrommathimport*window=tk.Tk()window.title('LCFilterCalculator')window.geometry('450x300')#VarDefinitionL_insert_var=tk.DoubleVar()C_insert_var=tk.DoubleVar()F_insert_var=tk.DoubleVar()#functiondefcalculate_L():C_insert=C_insert_var.get()F_insert=F_insert_var.get()ifC_insert>0andF_insert>0:L_calculation=pow(1/(2*pi*sqrt(C_insert)*F_insert),2)*1e9L_calculation=float('%0.4f'%L_calculation);tk.messagebox.showinfo(title='Result',message='Youneeda{}nHinductor'.format(L_calculation))else:tk.messagebox.showerror(title='Error',message='Pleaseinsertvalidvalueofcapacityandgoalfrequency.');defcalculate_C():L_insert=L_insert_var.get()F_insert=F_insert_var.get()ifL_insert>0andF_insert>0:C_calculation=pow(1/(2*pi*sqrt(L_insert)*F_insert),2)*1e9C_calculation=float('%0.4f'%C_calculation);tk.messagebox.showinfo(title='Result',message='Youneeda{}pFcapacitor'.format(C_calculation))else:tk.messagebox.showerror(title='Error',message='Pleaseinsertvalidvalueofinductanceandgoalfrequency.');defcalculate_F():L_insert=L_insert_var.get()C_insert=C_insert_var.get()ifL_insert>0andC_insert>0:F_calculation=1/(2*pi*sqrt(L_insert*1e-9*C_insert*1e-12)*1e6)F_calculation=float('%0.4f'%F_calculation);tk.messagebox.showinfo(title='Result',message='Thecutofffrequencycalculationresultis{}MHz'.format(F_calculation))else:tk.messagebox.showerror(title='Error',message='Pleaseinsertvalidvalueofinductanceandcapacity.');#Widgetpackl_L=tk.Label(window,text='Pleaseinserttheinductancevalue',font=('Arial',12),width=30,height=2)l_L.place(x=-5,y=20,anchor="nw")L_insert=tk.Entry(window,textvariable=L_insert_var)L_insert.place(x=255,y=30)l_C=tk.Label(window,text='Pleaseinsertthecapacityvalue',font=('Arial',12),width=30,height=2)l_C.place(x=-5,y=80,anchor="nw")C_insert=tk.Entry(window,textvariable=C_insert_var)C_insert.place(x=255,y=90)l_F=tk.Label(window,text='Pleaseinsertthegoalfrequency',font=('Arial',12),width=30,height=2)l_F.place(x=-5,y=140,anchor="nw")F_insert=tk.Entry(window,textvariable=F_insert_var)F_insert.place(x=255,y=150)b_L=tk.Button(window,text='CalculateL',command=calculate_L)b_L.place(x=60,y=200,anchor="nw")b_C=tk.Button(window,text='CalculateC',command=calculate_C)b_C.place(x=160,y=200,anchor="nw")b_F=tk.Button(window,text='CalculateFrequency',command=calculate_F)b_F.place(x=260,y=200,anchor="nw")l_nH=tk.Label(window,text='nH',font=('Arial',12),width=5,height=2)l_nH.place(x=380,y=20,anchor="nw")l_pf=tk.Label(window,text='pf',font=('Arial',12),width=5,height=2)l_pf.place(x=380,y=80,anchor="nw")l_MHz=tk.Label(window,text='MHz',font=('Arial',12),width=5,height=2)l_MHz.place(x=380,y=140,anchor="nw")window.mainloop()5.界面展示5.1LC滤波界面如图,当你需要滤波的通路上已经有68nH的电感,你需要滤除掉300MHz的噪声,这个时候你就可以输入你设定的值,然后点击“CalculateC”就会得到一个结果如图所示:5.2LC滤波器计算功能展示同理可运用在RC滤波计算。
发布于2020-12-1420:17无源网络赞同4添加评论分享喜欢收藏申请转载
延伸文章資訊
- 1Lc 濾波器截止頻率計算 - Amini
这里其实LC低通滤波器的截止频率没有以0.707倍定义,而是直接使用了谐振频率点,因为是基本类似的,仅有一点小误差LC电路频率在线计算器.
- 2LC低通濾波器的截止頻率是怎麼推導出來的?公式是什麼?
lc電路截止頻率公式是:Q=wL\R=2πfL\R(因爲w=2πf)=1/wCR=1/2πfCR 阻抗:Zc=1/jwc ;Zl=jwl;. LC低通、高通濾波器,類似RC低通、高通濾波器;只要...
- 3LC低通滤波器的截止频率与LC谐振频率的关系 - CSDN博客
AA截止频率: 1,LC谐振公式:1/(2Π*√LC)=Fxz 注解:对于A低通滤波器,这里的截止频率位于滤波器的低频侧而不是位于滤波器的高频侧不同频率频率能量转换 ...
- 4一文读懂LC滤波器简单设计方法及原理介绍 - 电子工程专辑
基本节按电路结构分有定k型和m导出型。以LC低通滤波器为例,定k型低通基本节的阻带衰减随频率增加而单调增大;m导出 ...
- 5提供RC和LC低通滤波器计算界面的开源代码 - 知乎专栏
... 掉高频辐射信号,常常会使用无源的低通滤波器,其中包括RC低通滤波和LC低通滤波。 RC低通滤波其截止频率的计算公式为: F_{cutoff}=1/2πRC 2. LC…