besself acting like a high pass filter... fixable by using different domain?

6 ビュー (過去 30 日間)
Ben
Ben 2012 年 3 月 30 日
i think the solution is found below and that my problem stems from my ignorance of how filters work. i just wanted to make sure that the explanation below, found elsewhere, is the correct one.
I'm trying to low-pass filter my data with a bessel filter cut-off at 5000Hz. (sampled at 40kHz): > [b,a] = besself(2,5000/20000); > f = filtfilt(b,a,input);
filtered version shows a high-passed look with a much lower magnitude. If I substitute besself with butter it seems to work as expected... tried higher orders, lower cut-off freqs, those lead to seemingly better high pass filters...
"
[am i using the coefficients in the s-domain in a command that i should feed with coefficients in the z-domain? when i use the matlab command "filtfilt", does matlab think i'm entering z-coefficients? how can i use the filter function with bessel the same way as with butter?]
"
%**************************************************************** n = 5 w0 = 2*pi*5000; %The frequency with constant group delay %(it isn't cut-off frequency);
%Calculating the filter in the "s-domain" [b,a]= besself(n,w0);
%Plotting the bode of the filter. transfer = tf(b,a); bode(transfer);
%If you want to use the matlab command filter or filtfilt you have %to use a method for analog-to-digital filter conversion.
%Defining the sampling frequency. fs > 2*max_frequency. fs = 4*5000;
%Maybe you have to use the prewarp fp, when using this command. [num,den] = bilinear(b,a,fs);
%Filtering the signal X. y = filter(num,den,X);
"
i found that code at the same place i found the explanations (dsprelated.)
so it sounds like i have a similar problem but that transforming the besself outputs into something "digital" that the filter function will understand is the solution.
is that correct???
thanks for any efforts, b s

回答 (4 件)

Ben
Ben 2012 年 4 月 2 日
i see (in the besself documentation) that matlab doesn't support digital bessel filters, and that the besself algorithm doesn't use bilinear like the butter algorithm does (i.e. tautological with it not supporting digital bessel filter design, right?); i've used bilinear from the above solution, but i think that's not supposed to done given some phase issues with a digital implementation of a bessel filter,no?
my question then is how do i filter anything with besself??? i imagine i'm not using it correctly, but is it just not working correctly?
thanks for any info, ben

Ben
Ben 2012 年 4 月 5 日
hi self, another problem you might notice is that filter(b,a,data) doesn't actually work at all. you can use fvtool to see the response, but that's not actually what you get when you use filter... hmmmm i wonder how to filter in matlab???

Ben
Ben 2012 年 4 月 5 日
ben, if you'll notice that filter operates along the first non-singleton dimension, then you might save yourself some spilt tears and broken philanges, sport. grow up, kid.

Ben
Ben 2012 年 4 月 5 日
self, you're wonderful! and to think: all i needed was to think that others were paying attention! oh life is swell!
b s

カテゴリ

Help Center および File ExchangeAnalog Filters についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by