Using zero-pole-gain Butterworth filter
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Natali N
el 4 de Mzo. de 2017
Respondida: Star Strider
el 4 de Mzo. de 2017
Hi,
I want use Butterworth filter but this design:
% Zero-Pole-Gain design
[z,p,k] = butter(n,Wn,ftype);
How can I then filter data? For example, something like this:
dataOut = filter(b,a,dataIn);
0 comentarios
Respuesta aceptada
Star Strider
el 4 de Mzo. de 2017
The zero-pole-gain is a good start. To filter your data, I would convert it to second order section implementation for stability, then use that to filter your data. Use the filtfilt function to do the actual filtering, since it has a maximally flat phase response and so does not produce any phase distortion in your filtered signal.
It is always good to be certain your filter is doing what you want by using the freqz function first.
Try this:
[z,p,k] = butter(n,Wn,ftype);
[sos, g] = zp2sos(z, p, k);
figure(1)
freqz(sos, 2^16)
dataOut = filtfilt(sos, g, dataIn);
That should work.
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!