Ir al contenido
Español
Respuesta de un filtro FIR viene con Pro. La vista previa aparece al desbloquearlo.

Cómo funciona

A textbook figure of FIR design by the window method. The target is an ideal band (gain 1 between two edges, 0 elsewhere), drawn as a dashed step over a pale fill. Its ideal impulse response is infinitely long; the filter keeps 17 taps of it, h[−8] to h[8], multiplied by a rectangular or a Hamming window, and the solid line is the magnitude of the resulting response from 0 to π. The stem plot under it shows the 17 taps. The readout gives the overshoot (how far the response rises above 1) and the edge width (the widest 10% to 90% transition): a rectangular window keeps the edges steep but rings by about 9% (the Gibbs phenomenon), a Hamming window removes the ringing and doubles the edge width. When the band is narrower than 17 taps can resolve, the note says how high the response gets.

Úsalo para

  • Teach why a finite filter cannot have a brick-wall response, and what a window trades: ringing against edge width.
  • Let learners draw low-pass, band-pass and high-pass targets and watch the taps change shape.

Busca otra opción cuando

  • For designing a production filter, use a design tool with more taps and an equiripple method: this figure fixes the length at 17 and offers two windows.

Uso

import React, { useState } from 'react'
import { FirTemplateBench } from './FirTemplateBench.jsx'

export function FilterLesson() {
  const [band, setBand] = useState({ low: 0.25, high: 0.6 })
  return (
    <FirTemplateBench
      value={band}
      onChange={(next, { taps, overshoot }) => setBand(next)}
      defaultWindowShape="hamming"
      labels={{ title: 'A band-pass filter with 17 taps' }}
    />
  )
}

Propiedades

PropiedadTipoPor defectoQué hace
value{ low, high }—Banda objetivo controlada: sus flancos como fracciones de π (la frecuencia de Nyquist) de 0 a 1, ajustados a 0,05 y separados al menos 0,05. Un low de 0 da un pasabajos y un high de 1 un pasaaltos.
defaultValue{ low, high }{ low: 0.25, high: 0.6 }Banda inicial sin control externo y el destino de Restablecer en ambos modos.
onChange(band, result) => void—Recibe la nueva banda y { reason ('drag', 'draw', 'tap', 'key', 'cancel' o 'reset'), edge ('low', 'high' o null), taps (17 números, de h[−8] a h[8]), overshoot (una fracción), edgeWidth (fracción de π o null) }.
windowShape'rectangular' | 'hamming'—Ventana controlada que se aplica a los 17 coeficientes.
defaultWindowShape'rectangular' | 'hamming''rectangular'Ventana inicial sin control externo y la que recupera Restablecer.
onWindowShapeChange(shape, { reason }) => void—Se llama al cambiar la ventana, con reason 'press', 'key' o 'reset'.
labelsobject—Sustituye cualquier texto integrado: title, caption, target, response, taps, window, rectangular, hamming, low, high, overshoot, edgeWidth, hint, narrow ('{peak}') y reset.
localestring'en'Etiqueta de idioma para las cifras.
classNamestring—Clase extra para la tarjeta, por ejemplo para fijar su ancho (30rem por defecto, nunca más que su contenedor).

Accesibilidad

  • The two edges are sliders named Lower edge and Upper edge, with value text such as 0.25π. Arrow keys move an edge by 0.05π, Shift and Page Up or Down by 0.2π, Home and End to the ends of its range; the edges never cross.
  • The window is a radio group with one tab stop; arrow keys change it. Reset is a button, marked unavailable while nothing has changed.
  • The readout is a polite live region with the overshoot, the edge width and a note. The stem plot is an image whose name lists the 17 taps.
  • Dragging uses pointer capture. A press near an edge drags it; elsewhere a sideways drag draws a new band and a tap moves the nearest edge there. The edge strips set touch-action: none; the rest of the plot sets pan-y, so a vertical swipe still scrolls the page. Escape or a cancelled gesture puts the band back.
  • Colour is not the only key: the target is dashed and the response solid, the legend names both, and the edges carry their values above the plot.

Movimiento

Nothing animates: the response, the taps and the readout redraw on every input, and a dragged edge follows the pointer directly. Only hover and press feedback use transitions, and reduced motion turns them off.

Añádelo a tu proyecto

Los miembros Pro copian un prompt y su agente de programación instala el código, igual que con los gratuitos.

FirTemplateBench.jsxfir-template-bench.csstokens.cssREADME.md

Los dos archivos se instalan juntos. La hoja de estilos lee las variables de tokens.css y lleva valores de reserva, así que también funciona sola.

Gráficos
Trilateración viene con Pro. La vista previa aparece al desbloquearlo.