Ltran0325 / 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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

MATLAB Code:

% 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

Oscilloscope (Scopy):

60 Hz is filtered.

image

About

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.


Languages

Language:C 100.0%