python filter design

该博客展示了如何使用Python中的scipy库设计和应用一个低通滤波器。通过butter函数计算滤波器系数,然后利用lfilter进行滤波,最后通过freqz绘制频率响应,并通过示例数据展示滤波前后的信号效果。
摘要由CSDN通过智能技术生成











import numpy as np;
import matplotlib.pyplot as plt
import cv2;
import math;
from cmath import sin
from numpy.core.numeric import dtype
from scipy.signal import butter, lfilter, freqz
from scipy.fftpack import fft;
'''    
A few comments:


The Nyquist frequency is half the sampling rate.
You are working with regularly sampled data, so you want a digital filter, not an analog filter. This means you should not use analog=True in the call to butter, and you should use scipy.signal.freqz (not freqs) to generate the frequency response.
One goal of those short utility functions is to allow you to leave all your frequencies expressed in Hz. You shouldn't have to convert to rad/sec. As long as you express your frequencies with consistent units, the scaling in the utility functions takes care of the normalization for you.
Here's my modified version 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值