# Phase difference removal by using Filtering, butterworth, filtfilt command

25 Ansichten (letzte 30 Tage)
MAT-Magic am 5 Jun. 2020
Kommentiert: Nimish Iwale am 8 Jul. 2020
Hi Guys!
I am using 6th order Butterworth bandpass filter to extract the 10-20 Hz band from the signal (x). After that, I applied the filtfilt command on to the Butterworth bandpass filtered signal (10-20 Hz) to remove the phase delay. Is that I am doing right?
Thanks in advance. The code is given below. Feel free to correct the code.
Fs = 500;
fcutlow = 6; % low cut frequency in Hz
fcuthigh = 14; % high cut frequency in Hz
[b,a] = butter(6,[fcutlow,fcuthigh]/(Fs/2));
Butterworth_bandpass_filter = filter(b,a,x);
Filt_filt_signal = filtfilt(b,a, Butterworth_bandpass_filter);
##### 0 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Akzeptierte Antwort

Alberto Mora am 5 Jun. 2020
Bearbeitet: Alberto Mora am 5 Jun. 2020
I think that you just need to do:
Fs = 500;
fcutlow = 6; % low cut frequency in Hz
fcuthigh = 14; % high cut frequency in Hz
[b,a] = butter(6,[fcutlow,fcuthigh]/(Fs/2));
Filt_filt_signal = filtfilt(b,a, rawSignal );
without "Butterworth_bandpass_filter = filter(b,a,x);", otherwise you firstly compute a filter on the signal (with phase lag), and then you pass the filtered signal into filtfilt routine that filter again twice the incoming signal, but the incoming signal is already with a phase delay.
If you wanto to be sure about the results, have a look the frequency domain, comparin initial and final spectrums.
##### 4 Kommentare2 ältere Kommentare anzeigen2 ältere Kommentare ausblenden
MAT-Magic am 6 Jun. 2020
Thank you!
Nimish Iwale am 8 Jul. 2020
Is there any way this can be implemented in Simulink? I want to remove the phase shift in a simulink model.

Melden Sie sich an, um zu kommentieren.

### Kategorien

Mehr zu Butterworth finden Sie in Help Center und File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by