# MSP432-Digital-Notch-Filter
This program removes unwanted noise (60 Hz) using a digital notch filter. A sine wave enters the MSP432's precision ADC module and exits through an external DAC after being digitally filtered. Matlab is used to calculate the 60Hz notch filter transfer function which is then implemented in C.
https://github.com/Ltran0325/MSP432-Digital-Notch-Filter/blob/main/main.c
**Demo:**
https://www.youtube.com/watch?v=BwOXYYQE5To
**Notch Filter Transfer Function:**
<a href="https://www.codecogs.com/eqnedit.php?latex=H(s)&space;=&space;\frac{s^w&space;+&space;w_n^2}{s^2&space;+&space;(w_n/Q)s&space;+w_n^2}" target="_blank"><img src="https://latex.codecogs.com/svg.latex?H(s)&space;=&space;\frac{s^w&space;+&space;w_n^2}{s^2&space;+&space;(w_n/Q)s&space;+w_n^2}" title="H(s) = \frac{s^w + w_n^2}{s^2 + (w_n/Q)s +w_n^2}" /></a>
<a href="https://www.codecogs.com/eqnedit.php?latex=H(z)&space;=&space;\frac{b_2z^2&space;+b_1z^2&space;+b_0}{z^2&space;+a_1z&space;+&space;a_0}" target="_blank"><img src="https://latex.codecogs.com/svg.latex?H(z)&space;=&space;\frac{b_2z^2&space;+b_1z^2&space;+b_0}{z^2&space;+a_1z&space;+&space;a_0}" title="H(z) = \frac{b_2z^2 +b_1z^2 +b_0}{z^2 +a_1z + a_0}" /></a>
**MATLAB Code:**
```MATLAB
% H(s) = (s^2 + w^2)/(s^2 + (w/Q)s + w^2)
% w = 60Hz = center frequency to reject
% Q = 3 = quality factor (increase to narrow rejection)
% w/Q = bandwidth of the rejection band
Hc = tf([1, 0, (2 * pi * 60)^2], [1, 20, (2 * pi * 60)^2]);
bode(Hc);
Hd = c2d(Hc, 1/2000)
```
**MATLAB Bode Plot:**
60Hz notch filter.
![image](https://user-images.githubusercontent.com/62213019/112414144-ccb56380-8cde-11eb-8755-160d54b66b95.png)
**Oscilloscope (Scopy):**
60 Hz is filtered.
![image](https://user-images.githubusercontent.com/62213019/112414497-61b85c80-8cdf-11eb-8b1b-fc9883f2d173.png)
没有合适的资源?快使用搜索试试~ 我知道了~
MSP432-Digital-Notch-Filter:该程序使用数字陷波滤波器消除不需要的噪声(60 Hz)。 正弦波进入MS...
共2个文件
md:1个
c:1个
需积分: 46 14 下载量 27 浏览量
2021-04-20
01:19:51
上传
评论 2
收藏 3KB ZIP 举报
温馨提示
MSP432-数字陷波滤波器 该程序使用数字陷波滤波器消除不需要的噪声(60 Hz)。 正弦波进入MSP432的精密ADC模块,并在经过数字滤波后通过外部DAC退出。 Matlab用于计算60Hz陷波滤波器传递函数,然后在C语言中实现。 演示: 陷波滤波器传递函数: MATLAB代码: % H(s) = (s^2 + w^2)/(s^2 + (w/Q)s + w^2) % w = 60Hz = center frequency to reject % Q = 3 = quality factor (increase to narrow rejection) % w/Q = bandwidth of the rejection band Hc = tf([ 1 , 0 , ( 2 * pi * 60 )^2], [ 1 , 20 , ( 2 * pi * 60 )^2]); bod
资源详情
资源评论
资源推荐
收起资源包目录
MSP432-Digital-Notch-Filter-main.zip (2个子文件)
MSP432-Digital-Notch-Filter-main
main.c 5KB
README.md 2KB
共 2 条
- 1
蕾拉聊以色列
- 粉丝: 20
- 资源: 4696
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0