Period Operator Using filtfilt
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (2)
Wayne King
le 21 Sep 2012
Modifié(e) : Wayne King
le 21 Sep 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 commentaires
Jan
le 21 Sep 2012
Modifié(e) : Jan
le 21 Sep 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 commentaires
Voir également
Catégories
En savoir plus sur Filter Design dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!