Why does the “filtfilt” function cause a large transient response?
I have observed that the "filtfilt" function exhibits undesired behavior when I use it with IIR bandpass filters that have steep transition bands. Specifically, the output signal shows an excessive transient response.
Here is a code to generate an example
%% filter design
bp = designfilt(‘bandpassiir’, ‘StopbandFrequency1’, 50, ‘PassbandFrequency1’, 250,…
‘PassbandFrequency2’, 3600, ‘StopbandFrequency2’, 3700, ‘StopbandAttenuation1’, 30,…
‘PassbandRipple’, 0.1, ‘StopbandAttenuation2’, 30, ‘SampleRate’, 8000, ‘DesignMethod’, ‘cheby2’);
%% apply filtfilt to a random (white) long input signal; output signal shows an undesirable transient
rng(100);
x = randn(2^20,1);
ysos = filtfilt(bp,x);
% plot result with sos form
figure(1)
plot(ysos)
axis padded
The above code generates the following results, which shows an excessive transient response at a level of 1 × 10^7 at the beginning and the end of filtered signal.I have observed that the "filtfilt" function exhibits undesired behavior when I use it with IIR bandpass filters that have steep transition bands. Specifically, the output signal shows an excessive transient response.
Here is a code to generate an example
%% filter design
bp = designfilt(‘bandpassiir’, ‘StopbandFrequency1’, 50, ‘PassbandFrequency1’, 250,…
‘PassbandFrequency2’, 3600, ‘StopbandFrequency2’, 3700, ‘StopbandAttenuation1’, 30,…
‘PassbandRipple’, 0.1, ‘StopbandAttenuation2’, 30, ‘SampleRate’, 8000, ‘DesignMethod’, ‘cheby2’);
%% apply filtfilt to a random (white) long input signal; output signal shows an undesirable transient
rng(100);
x = randn(2^20,1);
ysos = filtfilt(bp,x);
% plot result with sos form
figure(1)
plot(ysos)
axis padded
The above code generates the following results, which shows an excessive transient response at a level of 1 × 10^7 at the beginning and the end of filtered signal. I have observed that the "filtfilt" function exhibits undesired behavior when I use it with IIR bandpass filters that have steep transition bands. Specifically, the output signal shows an excessive transient response.
Here is a code to generate an example
%% filter design
bp = designfilt(‘bandpassiir’, ‘StopbandFrequency1’, 50, ‘PassbandFrequency1’, 250,…
‘PassbandFrequency2’, 3600, ‘StopbandFrequency2’, 3700, ‘StopbandAttenuation1’, 30,…
‘PassbandRipple’, 0.1, ‘StopbandAttenuation2’, 30, ‘SampleRate’, 8000, ‘DesignMethod’, ‘cheby2’);
%% apply filtfilt to a random (white) long input signal; output signal shows an undesirable transient
rng(100);
x = randn(2^20,1);
ysos = filtfilt(bp,x);
% plot result with sos form
figure(1)
plot(ysos)
axis padded
The above code generates the following results, which shows an excessive transient response at a level of 1 × 10^7 at the beginning and the end of filtered signal. filterdesign, secondordersection, iirfilterdesign, filtfilt MATLAB Answers — New Questions