# How to find specific frequency in signal

21 views (last 30 days)
Ali Asghar on 11 Aug 2019
Commented: Star Strider on 16 Aug 2019
Dear
I have signal 30000x2 size.
i want to find out the specific reqency in signal like 50hz noise and band of 60-2000hz freq.
How can i do it?

Star Strider on 11 Aug 2019
If you have R2018a or later and the Signal Processing Toolbox, use the bandpass function to filter your signal.

Star Strider on 15 Aug 2019
1-Use a notch filter. You can use a FIR filter or the bandstop function. (You can find a link to bandstop in the bandpass documentation I linked to.)
2-Create a sine function with a 50 Hz frequency:
Fs = 1000; % Sampling Frequency
t = linspace(0, Fs, 500)/Fs; % Time Vector (Seconds)
Hz50 = sin(2*pi*t*50); % 50 Hz Sine
figure
plot(t, Hz50)
grid
Ali Asghar on 16 Aug 2019
to clean 50hz from the signal, can i use
bandstop(signal,[49 50],Fs); ??
Star Strider on 16 Aug 2019
I would use:
[signal_filtered, df] = bandstop(signal, [49 51], Fs);
You can then also use ‘df’ with filtfilt to filter other signals.