Filter out a particular frequency from a mixed signal

Hi All, I have a signal of mixed frequency 11 hrz, 50 hrz, 9000 hrz, and I want to filter out the 50 hrz signal from the mixed signal. The record length of the signal may be 10^6 long or may be more. Any help will be appreciated.
Thanks

Answers (2)

With a 1 MHz sampling frequency, it is not possible to implement a discrete FIR or IIR filter for a 50 Hz signal that produces reliable output.
You either need to implement the 50 Hz notch (narrow bandstop) filter in hardware, or significantly decrease your sampling frequency (perhaps to 20 KHz).
The statement that a discrete FIR or IIR filter cannot be implemented for a 50 Hz signal at a 1 MHz sampling rate is somewhat too strong.
A digital notch (bandstop) filter at 50 Hz is mathematically feasible even when the sampling frequency is 1 MHz. The challenge is that the normalized frequency is extremely small:
As a result, the filter poles and zeros are located very close to z=1, which can make the design numerically sensitive and difficult to visualize on standard frequency-response plots.
For example, the following filter can be designed in MATLAB:
d = designfilt('bandstopiir', ...
'FilterOrder',2, ...
'HalfPowerFrequency1',49.5, ...
'HalfPowerFrequency2',50.5, ...
'SampleRate',1e6);
When the frequency response is examined with sufficient resolution around 50 Hz, a notch is clearly visible. Therefore, the issue is not whether a digital filter can be designed, but rather whether it is the most robust and efficient approach for the application.
For a signal containing components at 11 Hz, 50 Hz, and 9 kHz, alternative approaches may be preferable:
  • Decimate the signal (after appropriate anti-alias filtering) and then design the notch filter at the lower sample rate.
  • Estimate and subtract the 50 Hz interference directly if it is a stable sinusoidal component.
  • Use a higher-order notch filter if greater attenuation is required.
The best solution depends on the sampling frequency, the required attenuation at 50 Hz, and whether the 50 Hz component is a fixed power-line interference or part of a more complex signal. However, it is generally possible to implement a digital FIR or IIR notch filter for a 50 Hz component even when the original data is sampled at 1 MHz.

Categories

Find more on Mixed-Signal Blockset in Help Center and File Exchange

Asked:

on 22 Sep 2017

Answered:

on 6 Jul 2026

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!