Library / Signal processing and digital filters / DSP-28
Signal processing and digital filters
Windowed-sinc band-pass tap
Unscaled coefficient of a windowed-sinc band-pass FIR filter at offset u = n − (N − 1)/2 from the centre, from two cutoffs c1 < c2 in cycles per sample (0 < c1 < c2 < 0.5), as the difference of two low-pass prototypes with the same window value w.
- Ref
- DSP-28
- Rev
- v1
- Field
- Signal processing and digital filters
- Result
- h[n]
A band-pass filter passes the band between c1 and c2, so it is the difference of two low-pass filters with those cutoffs: h[n] = [2c₂ sinc(2c₂u) − 2c₁ sinc(2c₁u)]w[n], with u = n − (N − 1)/2. Use the same window and length for both prototypes. The coefficients here are unscaled; normalise for unit gain at the band centre if required.
Unscaled coefficient of a windowed-sinc band-pass FIR filter at offset u = n − (N − 1)/2 from the centre, from two cutoffs c1 < c2 in cycles per sample (0 < c1 < c2 < 0.5), as the difference of two low-pass prototypes with the same window value w.
Calculator
- Low-pass tap at c₂0.3027
- Low-pass tap at c₁0.1871
- Band centre, (c₁ + c₂)/20.2 cycles/sample
What drives the result
Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.
- The band-pass tap at offset 1 is 0.1156, the difference of two low-pass taps of 0.3027 and 0.1871.
- The passband is centred at 0.2 cycles per sample with a width of 0.2; the centre tap equals 2(c₂ − c₁), so a narrow band means small taps.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing () | Local step | Change in result |
|---|---|---|---|---|---|---|
| u Offset from the filter centre | −50 to 50 samples | −0.0827 | 0.4 | 0.4827 | +2 samples | −241 % |
| c2 Upper cutoff | 0.21 to 0.499 cycles/sample | −0.1851 | 0.1312 | 0.3163 | +10% | −20.6 % |
| c1 Lower cutoff | 0.001 to 0.2 cycles/sample | −5.551e-17 | 0.3007 | 0.3007 | +10% | −13.7 % |
| w Window value at this tap | 0 to 1 | 0 | 0.1156 | 0.1156 | +10% | +10 % |
Sweep of Offset from the filter centre
| Offset from the filter centre (samples) | Band-pass tap |
|---|---|
| −50 | −6.083e-17 |
| −37.5 | 0.01698 |
| −25 | 6.083e-17 |
| −12.5 | −0.05093 |
| 0 | 0.4 |
| 12.5 | −0.05093 |
| 25 | 6.083e-17 |
| 37.5 | 0.01698 |
| 50 | −6.083e-17 |
Sweep one variable
Variables and how each one contributes
Band-pass tap
What the equation gives you. Everything else feeds it.
Lower cutoff
The lower cutoff, in cycles per sample. Raising it narrows the passband from below and lowers the subtracted term’s weight. Raising it by 10 % (to 0.11) moves the result by −13.7 %, from 0.1156 to 0.09983.
Upper cutoff
The upper cutoff, in cycles per sample. Raising it widens the passband from above. Raising it by 10 % (to 0.33) moves the result by −20.6 %, from 0.1156 to 0.09184.
Offset from the filter centre
The offset from the centre tap, in samples. Moves away from the centre, where both sinc terms are largest. Raising it by 10 % (to 1.1) moves the result by −40.2 %, from 0.1156 to 0.06913.
Window value at this tap
The window value for this tap. Scales the tap in direct proportion. Raising it by 10 % (to 1.1) moves the result by +10 %, from 0.1156 to 0.1272.
Worked example with the values above
- Upper prototype: 2c₂ sinc(2c₂u) = 0.6 × 0.50455 = 0.30273.
- Lower prototype: 2c₁ sinc(2c₁u) = 0.2 × 0.93549 = 0.1871.
- h = (0.30273 − 0.1871) × 1 = 0.11563.
Assumptions and limits
- A symmetric, odd-length linear-phase FIR design with cutoffs in cycles per sample, between 0 and 0.5.
- The window value w is for the same tap index n and the same length N.
Common mistakes
- Using a cutoff in hertz where cycles per sample are needed.
- Using an even length with a high-pass design, which places a null at Nyquist.
- Forgetting to normalise the sum of the taps to one when unit DC gain is needed.
Statistics and uncertainty
Window-method designs meet their targets only approximately: a Kaiser-based tap count is a good estimate but is typically 5 % to 10 % off, so always check the achieved response and adjust the length.
Where it is used
- Designing low-pass, high-pass and band-pass FIR filters by the window method.
- Estimating filter length and delay before committing to a design.
Maths you need
- Normalised sinc: sinc(x) = sin(πx)/(πx)
- Cutoff in cycles per sample: c = fc/fs
- Linear phase: a symmetric FIR has a constant delay of (N − 1)/2 samples