Digital Bessel filter problem
Show older comments
I'm getting strange results under certain circumstances when using a digital Bessel filter. A minimal working example is shown below. I get similarly weird results using slight variations, such as using bilinear instead of impinvar, or by using the lower level functions rather than besself. The example raw data is simply a line with slope one (black). I expect the filtered signal (red) to be a line with the same slope, slightly delayed from the original. I can achieve this result with a higher cutoff frequency, or by using a different filter, such as Butterworth. Any ideas what it happening here? Thanks! R2015b
numpoints=10000;
data=1:numpoints;
sampling_freq=10;
order=8;
cutoff=0.03;
[b, a] = besself(order,cutoff*2*pi);
[bz, az] = impinvar(b,a,sampling_freq);
filtered=filter(bz,az,data);
plot(data,'k');
hold on
plot(filtered,'r');

Accepted Answer
More Answers (1)
Star Strider
on 19 Mar 2016
2 votes
Bessel filters are excellent analogue (hardware) designs because of their lack of phase distortion. However the MATLAB documentation says:
- besself does not support the design of digital Bessel filters.
and my reference (Proakis and Manolakis, Digital Signal Processing, 2007 p. 727) says ‘However, we should emphasize that the linear-phase characteristics of the analog [Bessel] filter are destroyed in the process of converting the filter into the digital domain by means of the transformations described previously.’
So if you want linear-phase filtering, use filtfilt with any filter design.
8 Comments
Scott Webster
on 19 Mar 2016
Edited: Scott Webster
on 19 Mar 2016
Star Strider
on 19 Mar 2016
My pleasure.
I don’t use Bessel filters except in hardware, and then principally as anti-aliasing filters, so I have no experience with them as discrete filters. Based on what I’ve read, there is no reliable way of discretising them. I haven’t analysed the reasons they cannot be reliably discretised, since I never needed to do so. I will leave you to explore this if you want to.
Based on my experience and what I’ve read, I would abandon the effort. I would use another filter design that can be reliably discretised, and filtfilt to produce a phase-neutral response.
Scott Webster
on 31 Mar 2016
Star Strider
on 31 Mar 2016
The second-order-section implementation is superior to others for all filters.
Using it and using filtfilt will produce the sort of filter response you want, but so would any filter design using second-order-section implementation and the filtfilt filter implementation.
Scott Webster
on 1 Apr 2016
Star Strider
on 1 Apr 2016
The Butterworth filter likely has a larger band-pass region and sharper roll-off than the Bessel filter (that has probably the most gradual roll-off of any filter design).
That said, this isn’t actually ‘ringing’ (Gibbs phenomenon) but the filter’s frequency selection of the input signal. The Butterworth design is passing more frequencies than the Bessel design, so the approximation of the input waveform is more precise. The Bessel design is approximating the square wave with a sine wave, while the Butterworth design is transmitting an additional harmonic to approximate the square wave. I suspect the freqz function would demonstrate a corresponding difference the the two filter pass-bands.
True Gibbs phenomenon would have ringing only at the sharp transitions that would decay by the end of the ‘constant’ section of the waveform. (I don’t know if that would be true of filtfilt though, since I never did that experiment.)
Scott Webster
on 1 Apr 2016
Star Strider
on 1 Apr 2016
Actually, they don’t have the same parameters. The transfer functions of each are entirely different, as are their pass-bands and stop-bands.
The ‘correct’ filter design depends on what you want to do, and if you want to do it in software (discrete) or hardware (continuous).
Signal processing in any domain is quite definitely not a trivial exercise!
Categories
Find more on Analog Filters in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!