Skip to content

FIR filter module in PyTorch for neural networks, enabling integration of predefined filters or training coefficients to observe frequency adaptation during training. Ideal for signal processing tasks in deep learning.

Notifications You must be signed in to change notification settings

LiFeng-NJU/FirConv

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FirConv: A PyTorch-based module for building trainable FIR filter ⏳ Version PyTorch

FirCNN Architecture Diagram

πŸš€ Introduction

A PyTorch-based module for building trainable FIR filters in deep neural networks. Key features:

  • πŸ”§ Seamless integration with existing PyTorch models
  • 🎚️ Pre-defined filters or learnable coefficients
  • πŸ“Š Real-time frequency adaptation visualization
  • ⚑ CUDA-accelerated computation

"Enabling neural networks to understand signal processing through differentiable filters"

πŸ“¦ Installation

From Source

git clone https://github.com/FunkyFrog1/FirConv.git
cd FirConv
pip install .

From PyPI (coming soon)

pip install firconv

πŸ› οΈ Basic Usage

import torch
from firconv.firconv import FirConv

# Create learnable FIR filter with 32 taps
fir = FirConv(fres=100, fs=250)

# Process 1D signal batch: (batch_size, channels, seq_len)
x = torch.randn(1, 63, 250)  # Batch of 63 signals
y = fir(x)  # Output shape: (1, 63, 250)

πŸ“š Documentation

Argument Type Default Description
fres int 100 Filter frequency range [0-fres]
N int - Filter window size(default compute by fres and fs
fs int 250 Sample rate

πŸ“… Release Notes

0.1.1 - 2025-02-24

  • Initial public release
  • Add CUDA kernel optimization
  • Support multi-channel filtering

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

πŸ“œ License

Apache 2.0 Β© 2025 FunkyFrog

About

FIR filter module in PyTorch for neural networks, enabling integration of predefined filters or training coefficients to observe frequency adaptation during training. Ideal for signal processing tasks in deep learning.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%