The aim of this task is to build a bandpass filter to filter out the noise from a given data. The sampling frequency was 3490Hz. I have used fft to determine what the noises are in the given signal which are: 20Hz. 110Hz, 200Hz and 470Hz. The peak at 20Hz is peculiar to me though as the left hand side of the fft figure should be a mirror image of the right hand side of the figure. This is the fft result that I achieved:
The frequency is in bins and was converted to Hz by comparing with the sampling frequency.
Next, I need to determine the actual noise of the signals. I am not sure how to determine this. After all that, I can then possibly make a bandpass filter by the basic code flow below:
Fs = 3490; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency (Hz)
Wp = [futcutlow fcuthigh]/Fn; % Passband Frequency (Normalised)
Ws = [futcutlow*0.95 fcuthigh/0.95]/Fn; % Stopband Frequency (Normalised)
Rp = 1; % Passband Ripple (dB)
Rs = 150; % Stopband Ripple (dB)
[n,Wn] = buttord(Wp,Ws,Rp,Rs); % Filter Order
[z,p,k] = butter(n,Wn); % Filter Design
[sosbp,gbp] = zp2sos(z,p,k); % Convert To Second-Order-Section For Stability
freqz(sosbp, 2^20, Fs) % Filter Bode Plot
filtered_signal = filtfilt(sosbp, gbp, signal); % Filter Signal
The problems that I've encountered is: 1) Why is there a spike in the left hand side of the fft at 20Hz? 2) How do I determine the actual noise that I need to eliminate? 3) How can I make the basic code flow work from that point onwards?
Best Answer