Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- """
- Lanczos dual-passband filter generator
- by Damian Yerrick
- Bisqwit wanted help making the FIR filter for NTSC luma/chroma
- separation. I'm using a crossover at 5/6 and 7/6 Fsc (3.0 and
- 4.2 MHz).
- """
- from __future__ import division
- import math
- def sinc(x):
- pix = math.pi*x
- return math.sin(pix)/pix if pix else 1
- # A lowpass at 0 is sinc(x)
- ls = [(sinc(x * 5/36) - sinc(x * 7/36) + sinc(x * 10/36))
- * sinc(x/21)
- for x in range(-20, 21)]
- print "\n".join("%7.4f" % el for el in ls)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement