Period Operator Using filtfilt
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am trying to understand the function filtfilt, but I am having difficulties wrapping my head around it. I believe it may be because I am unsure of what one of the operations is in the help document for filtfilt. The operation is: y=filtfilt(d.Numerator,1,x);
What does d.Numberator do?
0 comentarios
Respuestas (2)
Wayne King
el 21 de Sept. de 2012
Editada: Wayne King
el 21 de Sept. de 2012
The answer to what the period operator in your example does is the following.
filtfilt() unlike filter() does not accept a dfilt object input. The portion of the example you are showing is using a dfilt object. What you have is an FIR filter dfilt object, so the example is extracting the numerator coefficients (in the Numerator field) and providing those to filtfilt.m.
For example:
x = randn(10000,1); % just create some noise to filter
% Design a lowpass FIR filter with a sampling rate of 1 kHz
D = fdesign.lowpass('Fp,Fst,Ap,Ast',100,150,1,40,1000);
d = design(D,'equiripple'); % design FIR equiripple filter
Now you cannot filter data using filtfilt() with
y = filtfilt(d,x); % this will error
% However the following works
y = filter(d,x);
So to use filtfilt.m, you have to extract the numerator coefficients. For an FIR filter the denominator coefficient is 1.
y = filtfilt(d.Numerator,1,x);
0 comentarios
Jan
el 21 de Sept. de 2012
Editada: Jan
el 21 de Sept. de 2012
Do you understand the command filter? If not look at first to doc filter. You find a M-version here: Answers: Filter Constants.
Now filtfilt does the following:
- Create some initial conditions to reduce the transitional effects on the margins. This is a kind of warm-up the filter.
- Filter from start to end and backwards from end to start. This eliminates the delay effects: With a single filter, the values of a point depends on its predecessors, such that a peak is shifted to the right. Filtering in backward direction again shifts it to the left again.
0 comentarios
Ver también
Categorías
Más información sobre Filter Design en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!