# Second-Order Band-Pass (`bandpass`)

> Passes one band of frequencies around a centre frequency.

![bandpass](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/img/bandpass.svg)

[Component reference](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/) · [繁體中文](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/control/bandpass/)

**Group:** Control · **Kind:** `{"block":"bandpass","kind":"control"}`

## When to use it

Use it to pick out one harmonic or resonance, such as a ripple component. Use Second-Order Low-Pass to keep everything below a corner.

## Pins

| Pin | Domain | Meaning |
|---|---|---|
| `in` | signal | Signal to filter |
| `out` | signal | Band-passed signal |

## Common parameters

- `f0`: Frequency the filter passes best (Default: required)
- `q`: How narrow the passed band is (Default: 1)

## Parameters

| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
| `f0` | Hz | required |  | Frequency the filter passes best |
| `q` | — | 1 |  | How narrow the passed band is |

_Parameter descriptions are in English in both languages._

## Model

H(s) = (w0/Q)·s / (s² + (w0/Q)·s + w0²) with w0 = 2·pi·f0. The gain is 1 at f0 and 0 at DC and at very high frequency. The -3 dB band is f0/q wide. The block has no direct feedthrough and is integrated with the trapezoidal rule, like Transfer Function.

## Common mistakes

- q sets how sharp the band is, and the width in hertz is f0 divided by q. A high q keeps ringing for a while, so run the simulation long enough for the output to settle.
- f0 is in hertz. A band-pass has zero gain at DC, so use it only on the AC part of a signal.

## Datasheet and sources

There is no datasheet. f0 is the frequency you want to extract, such as a line harmonic, a ripple frequency or a resonance of your plant. q is f0 divided by the bandwidth you need.

## Example

Open the example with the command `file.openExample` and the name `demo:bandpass`.

---
Generated by `cargo xtask reference` from the usage texts and parameter specs. Do not edit by hand.
