y = sinc_filter(x,Wn,N)
y = sinc_filter(x,Wn) applies a near-ideal low-pass or band-pass brickwall filter to the vector or matrix x. If x is a matrix the filter is applied to each column. The cutoff frequency/frequencies are specified in Wn. If Wn is a scalar, then Wn specifies the low-pass cutoff frequency. If Wn is a two-element vector, then Wn specifies the band-pass interval. Wn must be 0.0 < Wn < 1.0, with 1.0 corresponding to half the sample rate.
The filtering is performed by FFT-based convolution of x with the sinc kernel.
y = sinc_filter(x,Wn,N) allows the filter length to be specified. If N is even, the final filter length will be N+1. The default value is N=1025. The filter length is doubled in the band-pass case.