|
3 | 3 | Audio filters work on the frequency of an audio signal to attenuate unwanted frequency and amplify wanted ones. |
4 | 4 | They are used within anything related to sound, whether it is radio communication or a hi-fi system. |
5 | 5 |
|
| 6 | +## Available Filters |
| 7 | + |
| 8 | +### Butterworth Filter (`butterworth_filter.py`) |
| 9 | +Implementation of Butterworth low-pass and high-pass filters with configurable cutoff frequency and Q-factor. |
| 10 | + |
| 11 | +### IIR Filter (`iir_filter.py`) |
| 12 | +Generic N-order Infinite Impulse Response (IIR) filter implementation that serves as the foundation for other filters. |
| 13 | + |
| 14 | +### Equal Loudness Filter (`equal_loudness_filter.py`) |
| 15 | +A psychoacoustic filter that compensates for the human ear's non-linear frequency response based on the Robinson-Dadson equal loudness contours. This filter combines a Yule-Walker approximation with a Butterworth high-pass filter. |
| 16 | + |
| 17 | +**Features:** |
| 18 | +- Compensates for human auditory perception |
| 19 | +- Based on Robinson-Dadson curves (1956) |
| 20 | +- Suitable for sample rates ≥ 44.1kHz |
| 21 | +- Includes comprehensive test suite |
| 22 | + |
| 23 | +## Usage Example |
| 24 | + |
| 25 | +```python |
| 26 | +from audio_filters.equal_loudness_filter import EqualLoudnessFilter |
| 27 | + |
| 28 | +# Create filter with default 44.1kHz sample rate |
| 29 | +filter = EqualLoudnessFilter() |
| 30 | + |
| 31 | +# Process audio samples |
| 32 | +processed_sample = filter.process(0.5) |
| 33 | + |
| 34 | +# Or specify custom sample rate |
| 35 | +filter_48k = EqualLoudnessFilter(48000) |
| 36 | +``` |
| 37 | + |
| 38 | +## Testing |
| 39 | + |
| 40 | +Run the test suite for audio filters: |
| 41 | +```bash |
| 42 | +python -m pytest audio_filters/tests/ |
| 43 | +``` |
| 44 | + |
| 45 | +## References |
| 46 | + |
6 | 47 | * <https://www.masteringbox.com/filter-types/> |
7 | 48 | * <http://ethanwiner.com/filters.html> |
8 | 49 | * <https://en.wikipedia.org/wiki/Audio_filter> |
9 | 50 | * <https://en.wikipedia.org/wiki/Electronic_filter> |
| 51 | +* Robinson, D. W., & Dadson, R. S. (1956). A re-determination of the equal-loudness relations for pure tones. British Journal of Applied Physics, 7(5), 166. |
0 commit comments