18
$\begingroup$

We can easily design interpolation filters that obey certain frequency-domain constraints using the Parks-McClellan algorithm. However, it's not immediately clear how to enforce time-domain constraints; in particular, I'm interested in generating Nyquist filters. So if I'm oversampling by a factor of N, I want the filter to have zero-crossings at kN, for non-zero integer k (this ensures that the input samples to my interpolator will appear in the output sequence).

I've seen Harris1 talk about a technique for designing half-band filters, i.e. the special case where N=2. Is there a general solution for this? (I know that we can easily design filters with the window method, but that doesn't give us the same control.)

[1] Multirate Signal Processing for Communication Systems, pp. 208-209

$\endgroup$
3
  • $\begingroup$ For N=2 see my answer to: FIR Filter design: Window vs Parks-McClellan and Least-Squares. $\endgroup$ May 3, 2019 at 11:49
  • $\begingroup$ A couple of literature references that are paywalled, unfortunately: F. Mintzer, “On half-band, third-band, and Nth-band FIR filters and their design,” IEEE Trans. Acoust., Speech & Signal Process., vol. ASSP-30, no. 5, pp. 734–738, Oct. 1982. T. Saramaki and Y. Neuvo, “A class of FIR Nyquist (Nth-band) filters with zero intersymbol interference,” IEEE Trans. Circuits & Syst., vol. CAS-34, no. 10, pp. 1182–1190, Oct. 1987. $\endgroup$ May 3, 2019 at 12:41
  • $\begingroup$ And this paper which seems very much to the point: X. Zhang, "Design of Mth-band FIR linear phase filters," 2014 19th International Conference on Digital Signal Processing, Hong Kong, 2014, pp. 7-11. doi: 10.1109/ICDSP.2014.6900776 $\endgroup$ May 3, 2019 at 14:00

2 Answers 2

10
$\begingroup$

One design method, albeit one that is limited to powers of two, would be to start with one halfband filter, insert zeros at every other (creates a spectral replica), then convolve it with a second halfband filter having a wider transition band. Repeat the process until you get to the required power of 2.

Here's an example that creates a lowpass filter with Fc=fs/8 and zero crossings every 4 samples:

b0=remez(34,[0 .45 .55 1],[1 1 0 0])';
b1=remez(6,[0 .25 .75 1],[1 1 0 0])';
b0up = zeros(1,2*length(b0)-1);
b0up(1:2:end) = b0;
B0up=freqz(b0up);
b2 = conv(b0up,b1);  % length = 34*2+1 + 6 = 75 coefficients

Comparison of example filters

$\endgroup$
2
  • $\begingroup$ I was going to suggest that same thing. $\endgroup$
    – Phonon
    Aug 18, 2011 at 14:13
  • 6
    $\begingroup$ +1 for awesome graph. i will ALWAYS +1 awesome graphs because they are way better than long ... often boring/bad explanations. $\endgroup$ Aug 21, 2011 at 16:50
6
$\begingroup$

One method to get your desired zero crossings is to do a hybrid design.

Start out with a Parks-McLellan/Remez half-band filter given equal weight to passband and stopband. Since it is a halfband filter, it will have zeros at alternate samples. You can then interpolate the time domain by sin(x)/x by zero-stuffing in the frequency domain.

Example: creating a fs/12 lowpass filter with zero crossings every 6 samples.

% prototype Remez filter 
taps=18; 
b = remez(taps,[0 .4 .6 1],[1 1 0 0])';  
% force halfband condition of zeros at every other sample
b(2:2:end)=0;  b(taps/2+1)=.5; 

% zero pad the time domain to give the Gibbs ripple some deadspace
B=fft(b,4*(taps+1) ); 
% split the frequency domain into two halves, split the Nyquist bin
Blo = [ B(1:length(B)/2) 0.5*B(length(B)/2+1) ]; 
Bhi = [ 0.5*B(length(B)/2+1) B(length(B)/2+2:length(B))  ]; 

% insert padding at pi to increase size 3x
Bpad = [ Blo zeros(1,3*length(B)-length(Blo)-length(Bhi) ) Bhi];  
bint = real( ifft(Bpad) ); % this has zeros every 6 samples

The resulting filter is close to, but not quite as good as, the prototype in terms of stopband/passband ripple. The sin(x)/x interpolation does introduce some low level ringing. You might need to slightly overdesign the prototype filter to get the required level of attenuation in the interpolated filter.

$\endgroup$
2
  • 1
    $\begingroup$ +1: Interesting idea; I need to think about this a little. Two questions occur to me, though. First, is it safe to say that we can translate our equiripple design constraints to the half-band filter simply by scaling? Second, what about odd values of N? $\endgroup$ Aug 16, 2011 at 21:20
  • $\begingroup$ Odd values of N can be handled by decimating an even FIR by 2. e.g. if you want zeros every 7 samples, design a fir with zeros every 14, then decimate such that you retain the zeros. The top half of the spectrum will be aliased in, but the integrated sidelobes may be pretty negligible in practice. $\endgroup$ Aug 19, 2011 at 3:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.