function Y = bandpass_filter(N,fmin_lo,fmin_hi,fmax_lo,fmax_hi,fsmp)
  # Returns a Fourier bandpass filter with total {N} 
  # frequencies and a smooth up transition from 
  # {fmin_lo} to {fmin_hi} and a smooth down transition 
  # from {fimax_lo} to {fmax_hi}.
  Ylo = lowpass_filter(N,fmin_lo,fmin_hi,fsmp);
  Yhi = 1 - lowpass_filter(N,fmax_lo,fmax_hi,fsmp);
  Y = Ylo .* Yhi;
  
  dfmin_lo = floor(fmin_lo*N/fsmp);
  dfmin_hi = ceil(fmin_hi*N/fsmp);
  dfmax_lo = floor(fmax_lo*N/fsmp);
  dfmax_hi = ceil(fmax_hi*N/fsmp);

  figure 17; fourierplot(Y,0,N-1,fsmp);                title('band-pass full')
  figure 18; fourierplot(Y,0,dfmin_hi+10,fsmp);        title('low pass')
  figure 19; fourierplot(Y,dfmax_lo-10,dfmax_hi,fsmp); title('high pass')