Butterworth Notch Filters
77 次查看(过去 30 天)
显示 更早的评论
I'm designing a simple 60 Hz butterworth notch filter like this
[b a] = butter(n, [59 61]./(fs/2), 'stop');
When I use fvtool to look at the magnitude and phase response everything looks fine until I make n>=5, then both responses start to go all of the place. My magnitude response no longer looks like a notch.
My suspicion is that there is some roundoff error going on somewhere , but I'm unsure. Also, on my machine
>> eps
ans =
2.22044604925031e-16
Thanks for any help.
采纳的回答
Rob Graessle
2011-4-15
For higher order filters (possibly starting as low as order 8), numerical problems due to roundoff errors may occur when forming the transfer function using the [b,a] syntax. You can avoid this by using the [z,p,k] syntax to design IIR filters. Here is an example:
[z p k] = butter(10, [59 61]./(fs/2), 'stop'); % 10th order filter
[sos,g]=zp2sos(z,p,k); % Convert to 2nd order sections form
h=dfilt.df2sos(sos,g); % Create filter object
fvtool(h);
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Filter Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!