cancel
Showing results for 
Search instead for 
Did you mean: 

Hello everybody I need implement real time notch filter to 50 HZ powerline noise My MCU is stm32h753bi , how to do that? is it rationale to do that in MCU or I should that on PC side? thank you

mkh
Associate
 
4 REPLIES 4
Dvorak.Peter
Senior II

If you need a lowpass filter, then Just average a lot of equally spaced ADC samples for 20ms .

my samples are at 244 us

mckenney
Senior

One of my applications is running a 4-channel bandpass at 32ksps(/chan). That, plus some light-to-moderate analysis, takes up about 1/3rd of a modest little F411 (M4) at 96MHz. I suspect your 400+MHz M7 can handle it.

I've been quite pleased with the CMSIS-DSP library. It's small, fast, straightforward, and didn't require much thinking on my part.

CMSIS-DSP won't help you with designing the filter. I use Matlab, but there are plenty of filter-design things out there.

gregstm
Senior III

I tried using an analogue notch filter - I didn't like the results. I still ended up with overtones of 50 Hz and it reduced/distorted other frequencies I was interested in. For the notch to block the 50Hz well, the components have to be very accurate. If this is for a product you will have to use different filter components for the USA for 60Hz. It's hard to say much more without more information of your application. I find it best to stick to Low/High pass filters - and ideally optimise the analogue circuitry to minimise the 50 Hz getting in from the start. If possible, get the signal into the micro with minimal distortion and do the filtering digitally.